diff options
author | Andinus <andinus@nand.sh> | 2021-09-05 16:38:19 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-09-05 16:38:19 +0530 |
commit | b05021bb9ca6bc6f5189bfe8f2cf15e0a78fdb5e (patch) | |
tree | 027c337d0878cafe364ef13146c738dfa9f97644 /c/binary-search/makefile | |
parent | 46d81156b7bad4bef2f4443df6e9df4f03303c56 (diff) | |
download | exercism-b05021bb9ca6bc6f5189bfe8f2cf15e0a78fdb5e.tar.gz |
C: Binary Search: Add solution
Diffstat (limited to 'c/binary-search/makefile')
-rw-r--r-- | c/binary-search/makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/c/binary-search/makefile b/c/binary-search/makefile new file mode 100644 index 0000000..d5ff0a1 --- /dev/null +++ b/c/binary-search/makefile @@ -0,0 +1,37 @@ +### If you wish to use extra libraries (math.h for instance), +### add their flags here (-lm in our case) in the "LIBS" variable. + +LIBS = -lm + +### +CFLAGS = -std=c99 +CFLAGS += -g +CFLAGS += -Wall +CFLAGS += -Wextra +CFLAGS += -pedantic +CFLAGS += -Werror +CFLAGS += -Wmissing-declarations +CFLAGS += -DUNITY_SUPPORT_64 + +ASANFLAGS = -fsanitize=address +ASANFLAGS += -fno-common +ASANFLAGS += -fno-omit-frame-pointer + +.PHONY: test +test: tests.out + @./tests.out + +.PHONY: memcheck +memcheck: ./*.c ./*.h + @echo Compiling $@ + @$(CC) $(ASANFLAGS) $(CFLAGS) test-framework/unity.c ./*.c -o memcheck.out $(LIBS) + @./memcheck.out + @echo "Memory check passed" + +.PHONY: clean +clean: + rm -rf *.o *.out *.out.dSYM + +tests.out: ./*.c ./*.h + @echo Compiling $@ + @$(CC) $(CFLAGS) test-framework/unity.c ./*.c -o tests.out $(LIBS) |