added generic makefile for c/cpp. should be updated for various headers hh, hpp, and src (.cpp)

This commit is contained in:
random-toto@localhost 2016-06-14 23:48:45 +02:00
parent d6f1cd2c81
commit f3266bd6bb
1 changed files with 25 additions and 0 deletions

25
cpp/makefile Normal file
View File

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