From: Michael D. Lowis Date: Thu, 21 Mar 2019 02:58:58 +0000 (-0400) Subject: rework makefile X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=dbc0f22a66c2c20a2141ae0adf438ee60f490d18;p=proto%2Fsclpl.git rework makefile --- diff --git a/Makefile b/Makefile index 8301555..c477b6a 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ LD = ${CC} # completed flags INCS = -Isource/ CPPFLAGS = -CFLAGS += -O0 -g ${INCS} ${CPPFLAGS} +CFLAGS += -g ${INCS} ${CPPFLAGS} -MMD LDFLAGS += ${LIBS} ARFLAGS = rcs MAKEFLAGS = -j @@ -30,7 +30,7 @@ OBJS = source/main.o \ source/codegen.o .PHONY: all specs tests -all: sclpl specs tests +all: ${BIN} tests lib${BIN}.a: ${OBJS} ${AR} ${ARFLAGS} $@ $^ @@ -49,6 +49,7 @@ tests: $(BIN) ${CC} ${CFLAGS} -c -o $@ $< clean: - @rm -f ${BIN} lib${BIN}.a - @rm -f ${TESTBIN} ${TESTOBJS} ${TESTOBJS:.o=.gcda} ${TESTOBJS:.o=.gcno} - @rm -f ${OBJS} ${OBJS:.o=.gcda} ${OBJS:.o=.gcno} source/lexer.c + find . \( -name '*.[oad]' -o -name ${BIN} \) -delete + +# load generate dependencies +-include source/*.d