aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Holstein <nathan.holstein@gmail.com>2015-08-09 22:05:34 -0400
committerNathan Holstein <nathan.holstein@gmail.com>2015-08-09 22:18:37 -0400
commit610e74190352a5c8c1f1746a272fc7364cb2bac3 (patch)
treeddc3a0a2b2d10d0404df94bee3435a7342020f00
parent45b991b31341fac961e4f933cb1d96de62889f7e (diff)
downloadopendoas-610e74190352a5c8c1f1746a272fc7364cb2bac3.tar.gz
Generate automatic header dependencies.
-rw-r--r--.gitignore1
-rw-r--r--bsd.prog.mk6
2 files changed, 6 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 763bd71..8d285f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@ doas
version.h
*.a
+*.d
*.o
*.swp
diff --git a/bsd.prog.mk b/bsd.prog.mk
index 1f01d29..80d3231 100644
--- a/bsd.prog.mk
+++ b/bsd.prog.mk
@@ -11,7 +11,7 @@ OPENBSD:=$(addprefix libopenbsd/,${OPENBSD:.c=.o})
libopenbsd.a: ${OPENBSD}
${AR} -r $@ $?
-CFLAGS:=${CFLAGS} -I${CURDIR}/libopenbsd ${COPTS}
+CFLAGS:=${CFLAGS} -I${CURDIR}/libopenbsd ${COPTS} -MD -MP
OBJS:=${SRCS:.y=.c}
OBJS:=${OBJS:.c=.o}
@@ -46,8 +46,12 @@ clean:
rm -f version.h
rm -f libopenbsd.a
rm -f ${OPENBSD}
+ rm -f ${OPENBSD:.o=.d}
rm -f ${OBJS}
+ rm -f ${OBJS:.o=.d}
rm -f ${PROG}
+-include ${objs:.o=.d} ${OPENBSD:.o=.d}
+
.PHONY: default clean install man
.INTERMEDIATE: .${PROG}.chmod