26 lines
387 B
Makefile
26 lines
387 B
Makefile
# 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}
|
|
|