From 68e38f49b234474bdd123120de004de96fae8715 Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Thu, 8 Jun 2023 14:43:29 +0000 Subject: [PATCH] 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. --- Makefile | 22 +++++++++++++++++++++- configure | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index dad03f3..d0d935b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/configure b/configure index c7a1609..adb662d 100755 --- a/configure +++ b/configure @@ -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