mirror of
https://github.com/bkthomps/Containers.git
synced 2025-11-16 04:24:47 +00:00
43 lines
1.2 KiB
Makefile
43 lines
1.2 KiB
Makefile
.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
|