makefile (769B)
1 ### If you wish to use extra libraries (math.h for instance), 2 ### add their flags here (-lm in our case) in the "LIBS" variable. 3 4 LIBS = -lm 5 6 ### 7 CFLAGS = -std=c99 8 CFLAGS += -g 9 CFLAGS += -Wall 10 CFLAGS += -Wextra 11 CFLAGS += -pedantic 12 CFLAGS += -Werror 13 CFLAGS += -DUNITY_SUPPORT_64 14 15 ASANFLAGS = -fsanitize=address 16 ASANFLAGS += -fno-common 17 ASANFLAGS += -fno-omit-frame-pointer 18 19 test: tests.out 20 @./tests.out 21 22 memcheck: test/*.c src/*.c src/*.h 23 @echo Compiling $@ 24 @$(CC) $(ASANFLAGS) $(CFLAGS) src/*.c test/vendor/unity.c test/*.c -o memcheck.out $(LIBS) 25 @./memcheck.out 26 @echo "Memory check passed" 27 28 clean: 29 rm -rf *.o *.out *.out.dSYM 30 31 tests.out: test/*.c src/*.c src/*.h 32 @echo Compiling $@ 33 @$(CC) $(CFLAGS) src/*.c test/vendor/unity.c test/*.c -o tests.out $(LIBS)