-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
42 lines (31 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.DEFAULT_GOAL := unspecified
unspecified:
@echo "Error: use 'make static_clang' or 'make dynamic_clang' or 'make static_gcc' or 'make dynamic_gcc'"
static_clang:
clang src/*.c -c -O3 -fpic
ar rcs containers.a *.o
rm *.o
dynamic_clang:
clang -shared -o containers.so -O3 -fPIC src/*.c
static_gcc:
gcc src/*.c -c -O3 -fpic
ar rcs containers.a *.o
rm *.o
dynamic_gcc:
gcc -shared -o containers.so -O3 -fPIC src/*.c
header:
python3 compile_headers.py $(version)
test_debug:
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -o ContainersTest
test_optimized:
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -ldl -o ContainersTest
test_debug_no_malloc_fail:
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -o ContainersTest
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
test_optimized_no_malloc_fail:
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -o ContainersTest
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
test_coverage:
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -g -coverage -o ContainersTest