2023-08-21 09:05:27 -04:00
|
|
|
include config.mk
|
2023-08-21 09:30:48 -04:00
|
|
|
include chad.mk
|
2023-08-21 09:05:27 -04:00
|
|
|
|
|
|
|
SRC.dir:=source
|
2023-08-21 09:30:48 -04:00
|
|
|
OBJ.dir:=object
|
2023-08-16 01:06:37 -04:00
|
|
|
|
|
|
|
SRC:=$(shell find ${SRC.dir} -iname '*.c')
|
2023-08-19 07:18:34 -04:00
|
|
|
HDR:=$(shell find ${SRC.dir} -iname '*.h')
|
2023-08-21 09:25:14 -04:00
|
|
|
OBJ:=$(subst $(SRC.dir),$(OBJ.dir),$(SRC:.c=.o))
|
2023-08-19 07:18:34 -04:00
|
|
|
|
2023-08-21 09:05:27 -04:00
|
|
|
VPATH=${SRC.dir} ${OBJ.dir}
|
2023-08-19 07:18:34 -04:00
|
|
|
|
2023-08-21 09:05:27 -04:00
|
|
|
${OBJ.dir}/%.o: ${SRC.dir}/%.c
|
2023-08-16 01:06:37 -04:00
|
|
|
${COMPILE.c} $< -o $@
|
|
|
|
|
2023-08-23 22:45:13 -04:00
|
|
|
${TARGET}: ${HDR} | ${OBJ}
|
2023-08-21 09:25:14 -04:00
|
|
|
${LINK.c} $| -o $@
|
2023-08-21 09:05:27 -04:00
|
|
|
|
|
|
|
${SRC} ${HDR}:
|
|
|
|
|
|
|
|
install: ${PREFIX}
|
2023-08-27 03:31:36 -04:00
|
|
|
install -v -g ${USER} -o ${USER} -m 744 ${TARGET} ${PREFIX}/
|
2023-08-21 09:05:27 -04:00
|
|
|
|
|
|
|
uninstall:
|
|
|
|
-rm ${PREFIX}/bin/${TARGET}
|
2023-08-19 07:18:34 -04:00
|
|
|
|
|
|
|
clean:
|
2023-08-21 09:05:27 -04:00
|
|
|
-rm ${OBJ} ${TARGET}
|
2023-08-24 13:16:40 -04:00
|
|
|
-rm *.out
|
2023-08-16 11:30:29 -04:00
|
|
|
|
2023-08-19 07:18:34 -04:00
|
|
|
test: chad_test
|
2023-08-21 09:05:27 -04:00
|
|
|
|
|
|
|
.PHONY: test clean install
|
|
|
|
|
|
|
|
.DEFAULT_GOAL:=${TARGET}
|