diff options
author | Andinus <andinus@nand.sh> | 2021-08-11 20:20:37 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2021-08-11 20:20:37 +0530 |
commit | b0623be206e24c8efdfa85a21e72d723731edda0 (patch) | |
tree | 6f9fa91023d37c438ce5bead85a5a162171577be /c/two-fer/makefile | |
parent | c6d284ed8dcf0c5ef91036669eb20ad8e786a10a (diff) | |
download | exercism-b0623be206e24c8efdfa85a21e72d723731edda0.tar.gz |
C: Two-fer
Diffstat (limited to 'c/two-fer/makefile')
-rw-r--r-- | c/two-fer/makefile | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/c/two-fer/makefile b/c/two-fer/makefile new file mode 100644 index 0000000..f34535a --- /dev/null +++ b/c/two-fer/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: test/*.c src/*.c src/*.h + @echo Compiling $@ + @$(CC) $(ASANFLAGS) $(CFLAGS) src/*.c test/vendor/unity.c test/*.c -o memcheck.out $(LIBS) + @./memcheck.out + @echo "Memory check passed" + +.PHONY: clean +clean: + rm -rf *.o *.out *.out.dSYM + +tests.out: test/*.c src/*.c src/*.h + @echo Compiling $@ + @$(CC) $(CFLAGS) src/*.c test/vendor/unity.c test/*.c -o tests.out $(LIBS) |