From 947f2d9b2e60100613d289d2a96163144f5a63bd Mon Sep 17 00:00:00 2001 From: Victor Fernandes Date: Thu, 2 Feb 2017 15:04:19 -0500 Subject: [PATCH] Makefile --- Makefile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..98e33f2 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +## CLANG flags +CLANG = clang + +CL_SANITIZE = -fsanitize=address +CL_FLAGS = -fno-omit-frame-pointer + +## GCC flags +GCC = gcc-6 +GCC_FLAGS = -Wall -ansi -pedantic + +## Target executable filename, source, dependencies +SRC = buffer.c platy_bt.c +DEPS = buffer.h +ALL = $(SRC) $(DEPS) + +# Object files +OBJ = buffer.o platy_bt.o + +.PHONY : gcc +gcc : $(ALL) + $(GCC) $(ALL) -o buffer_gcc + +.PHONY : clang +clang : $(OBJ) + $(CLANG) -g $(CL_SANITIZE) $(OBJ) -o buffer_clang + +# Used exclusively by clang +*.o: $(ALL) + $(CLANG) -g $(CL_SANITIZE) $(CL_FLAGS) $(SRC) + +.PHONY : clean +clean : + rm *.o \ No newline at end of file