From 321825828ac918bad28d0597a8616c6dc9802c3c Mon Sep 17 00:00:00 2001 From: Andinus Date: Wed, 11 Aug 2021 15:26:15 +0530 Subject: Add solved exercises --- c/resistor-color/makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 c/resistor-color/makefile (limited to 'c/resistor-color/makefile') diff --git a/c/resistor-color/makefile b/c/resistor-color/makefile new file mode 100644 index 0000000..f34535a --- /dev/null +++ b/c/resistor-color/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) -- cgit 1.4.1-2-gfad0