37 lines
565 B
Makefile
37 lines
565 B
Makefile
include config.mk
|
|
|
|
SRC.dir:=source
|
|
OBJ.dir:=obj
|
|
|
|
SRC:=$(shell find ${SRC.dir} -iname '*.c')
|
|
HDR:=$(shell find ${SRC.dir} -iname '*.h')
|
|
OBJ:=$(SRC:.c=.o)
|
|
|
|
VPATH=${SRC.dir} ${OBJ.dir}
|
|
|
|
${OBJ.dir}/%.o: ${SRC.dir}/%.c
|
|
${COMPILE.c} $< -o $@
|
|
|
|
${TARGET}: ${OBJ} | ${HDR}
|
|
${LINK.c} $+ -o $@
|
|
|
|
${SRC} ${HDR}:
|
|
|
|
${PREFIX} ${OBJ.dir}:
|
|
mkdir -p $@
|
|
|
|
install: ${PREFIX}
|
|
install -v -g ${USER} -o ${USER} -m 744 ${TARGET} ${PREFIX}/bin/
|
|
|
|
uninstall:
|
|
-rm ${PREFIX}/bin/${TARGET}
|
|
|
|
clean:
|
|
-rm ${OBJ} ${TARGET}
|
|
|
|
test: chad_test
|
|
|
|
.PHONY: test clean install
|
|
|
|
.DEFAULT_GOAL:=${TARGET}
|