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} +