]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
rework makefile
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 21 Mar 2019 02:58:58 +0000 (22:58 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 21 Mar 2019 02:58:58 +0000 (22:58 -0400)
Makefile

index 8301555994764677c3d6e81b35a2c859754a0b1f..c477b6a6d1e81ac32e3d76af68570b11f21c62f5 100644 (file)
--- 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