From: Gunnar Beutner Date: Sat, 27 Jul 2013 09:21:52 +0000 (+0200) Subject: Build .d files in a separate directory. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/3148e566b53ef314f7b5ceab2749c8946013675a Build .d files in a separate directory. --- diff --git a/build.mk.in b/build.mk.in index b0331d75..d2fb54b4 100644 --- a/build.mk.in +++ b/build.mk.in @@ -22,10 +22,11 @@ default: all .SUFFIXES: .so .y .l --include $(wildcard *.d) +-include $(wildcard .deps/*.d) .c.o: - $(CC) $(CFLAGS) -MMD -c -o $@ $< + @if [ ! -d .deps ]; then mkdir .deps || true; fi + $(CC) $(CFLAGS) -MMD -MF .deps/$(subst .o,.d,$@) -c -o $@ $< .o.so: $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS) diff --git a/chanserv/Makefile b/chanserv/Makefile index 467ae183..29fdfd5a 100644 --- a/chanserv/Makefile +++ b/chanserv/Makefile @@ -14,6 +14,7 @@ $(CSDIRS): clean: rm -f */*.o */*.d */*.so *.o *.d *.so + rm -rf */.deps .deps distclean: rm -f */.autobuild.mk .autobuild.mk diff --git a/geoip/Makefile b/geoip/Makefile index 2322c520..d0651dc3 100644 --- a/geoip/Makefile +++ b/geoip/Makefile @@ -18,3 +18,4 @@ $(GEOIPDIRS): clean: rm -f */*.o */*.d */*.so *.o *.d *.so */*.a + rm -rf .deps */.deps diff --git a/newsearch/Makefile b/newsearch/Makefile index 3a13a793..75df6d42 100644 --- a/newsearch/Makefile +++ b/newsearch/Makefile @@ -23,6 +23,7 @@ lex.yy.c: newsearch.l y.tab.h clean: rm -f *.o *.d *.so y.tab.c y.tab.h lex.yy.c + rm -rf .deps distclean: diff --git a/trusts/Makefile b/trusts/Makefile index 1e504fcc..74ea0045 100644 --- a/trusts/Makefile +++ b/trusts/Makefile @@ -32,6 +32,7 @@ $(TRUSTSDIRS): clean: rm -f */*.o */*.d */*.so *.o *.d *.so + rm -rf */.deps .deps distclean: