use -MMD if the compiler supports it

it's better than the previous Makefile.depend approach since this
automatically adapts to the included headers without requiring
manual intervention to regen the list.
This commit is contained in:
Omar Polo 2023-06-08 14:43:29 +00:00
parent 3483609593
commit 68e38f49b2
2 changed files with 25 additions and 1 deletions

View File

@ -70,7 +70,7 @@ static: ${GMID_OBJS} ${GE_OBJS} ${GG_OBJS}
${CC} ${GG_OBJS} -o gg ${LDFLAGS} ${STATIC}
clean:
rm -f *.o compat/*.o y.tab.c y.tab.h y.output gmid ge gg
rm -f *.[do] compat/*.[do] y.tab.c y.tab.h y.output gmid ge gg
rm -f compile_flags.txt
${MAKE} -C regress clean
@ -130,3 +130,23 @@ ${DISTNAME}.tar.gz: ${DISTFILES}
${MAKE} -C regress DESTDIR=${PWD}/.dist/${DISTNAME}/regress dist
cd .dist/ && tar zcf ../$@ ${DISTNAME}
rm -rf .dist/
# -- dependencies --
-include config.d
-include dirs.d
-include fcgi.d
-include gg.d
-include gmid.d
-include iri.d
-include log.d
-include logger.d
-include mime.d
-include proc.d
-include proxy.d
-include puny.d
-include sandbox.d
-include server.d
-include utf8.d
-include utils.d
-include y.tab.d

4
configure vendored
View File

@ -240,6 +240,10 @@ fi
# --------
# tests for config.h
if runtest noop MMD -MMD; then
CFLAGS="${CFLAGS} -MMD"
fi
runtest err ERR || true
runtest explicit_bzero EXPLICIT_BZERO || true
runtest freezero FREEZERO || true