data/method/lib/Makefile

22 lines
471 B
Makefile
Raw Permalink Normal View History

2024-01-29 10:44:43 +08:00
TOPDIR = ${CURDIR}
SRCDIR = ${CURDIR}/src
INCLUDEDIR = ${CURDIR}/include
SRC = $(wildcard ${SRCDIR}/*.c)
OUT = ${TOPDIR}/out
target = ${OUT}/main
TMP = ${TOPDIR}/tmp
OBJS = $(patsubst $(SRCDIR)/%.c, $(TMP)/%.o, $(SRC))
${info "${patsubst %.c,${TMP}/%.o,${notdir ${SRC}}}"}
all:${target}
${target}:${OBJS}
mkdir -p ${dir $@}
gcc $^ -o $@
${OBJS}:${TMP}/%.o:${SRCDIR}/%.c
mkdir -p ${dir $@}
gcc -c $< -o $@ -I${INCLUDEDIR}
clean:
rm -rf ${TMP} ${OUT}
.PHONY:clean