From f3266bd6bb462d919e316a8e33717ba0a55a8d9f Mon Sep 17 00:00:00 2001 From: "random-toto@localhost" Date: Tue, 14 Jun 2016 23:48:45 +0200 Subject: [PATCH] added generic makefile for c/cpp. should be updated for various headers hh, hpp, and src (.cpp) --- cpp/makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cpp/makefile diff --git a/cpp/makefile b/cpp/makefile new file mode 100644 index 0000000..cb67205 --- /dev/null +++ b/cpp/makefile @@ -0,0 +1,25 @@ +# var. C/C++ +CC = gcc +#CC = g++ +CFLAGS = -Wall -std=c11 -g +#CFLAGS = -Wall -O0 -g -std=c++1y -Werror=uninitialized -Werror=conversion +RM = /bin/rm + +# src, .o, .out +SRC = ${wildcard *.c} +HEAD = ${SRC:.c=.h} +OBJ = ${SRC:.c=.o} +ELF = ${SRC:.c=.out} + +# target +${ELF}: ${OBJ} + ${CC} ${OBJ} -o ${ELF} + +# object +%.o: %.c + ${CC} -c ${CFLAGS} $< -o $@ + +# cleanall +clean: + ${RM} -f ${ELF} ${OBJ} +