28 lines
460 B
Makefile
28 lines
460 B
Makefile
include chad.mk
|
|
DEBUG:=1
|
|
CFLAGS:=-std=c99 -O2 -Wvla -Wshadow -Wundef $(if ${DEBUG}, ${CHAD_DEBUG},'')
|
|
CPPFLAGS:=-D_FORTIFY_SOURCE=2
|
|
|
|
SRC.dir:=source/
|
|
SRC:=$(shell find ${SRC.dir} -iname '*.c')
|
|
HDR:=$(shell find ${SRC.dir} -iname '*.h')
|
|
OBJ:=$(subst .c,.o,${SRC})
|
|
|
|
OUT:=hl
|
|
OUTARGS:=${OUT} < source/main.c
|
|
|
|
main: ${OBJ} ${HDR}
|
|
${LINK.c} ${OBJ} -o hl
|
|
|
|
%.o: %.c
|
|
${COMPILE.c} $< -o $@
|
|
|
|
install:
|
|
cp hl /usr/bin/hl
|
|
|
|
clean:
|
|
-rm ${OBJ}
|
|
-rm ${OUT}
|
|
|
|
test: chad_test
|