From 5822a2de7573ddb1c0a2652071d4deac34edf9fd Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 20 Apr 2008 12:21:26 +0000 Subject: [PATCH] Fix the Makefile's dependency tracking Turns out that .depend's mtime changes when you modify files in there and since every .cpp file depended on .depend, make regenerated everything. Not good. Fix this by inlining the mkdir for .depend. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1027 726aef4b-f618-498e-8847-2d620e286838 --- Makefile.in | 13 +++---------- modules/Makefile.in | 10 +++------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/Makefile.in b/Makefile.in index ec4f9d89..91b15f6e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,18 +22,10 @@ CLEAN := znc znc-static *.o core core.* DISTCLEAN := Makefile config.log config.status znc-config .depend \ modules/.depend modules/Makefile -.PHONY: all modules clean depend distclean install +.PHONY: all modules clean distclean install all: znc @MODTARGET@ -.depend: - @mkdir -p .depend - -depend: .depend - @if test -n "@MODTARGET@"; then \ - $(MAKE) -C modules depend ; \ - fi - znc: $(OBJS) $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) @@ -56,7 +48,8 @@ clean: distclean: clean rm -rf $(DISTCLEAN) -%.o: %.cpp .depend +%.o: %.cpp + @mkdir -p .depend $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< -MMD -MF .depend/$<.dep install: znc @MODTARGET@ diff --git a/modules/Makefile.in b/modules/Makefile.in index a5aeb20b..0dcd6e00 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -47,15 +47,10 @@ TARGETS := $(addsuffix .so, $(FILES)) CLEAN := *.so -.PHONY: all clean depend install modperl_install +.PHONY: all clean install modperl_install all: $(TARGETS) -.depend: - @mkdir -p .depend - -depend: .depend - install: all create_install_dir install_metadirs $(PERLHOOK) install -m 0755 $(TARGETS) $(DESTDIR)$(MODDIR) @@ -74,7 +69,8 @@ install_metadirs: create_install_dir clean: rm -rf $(CLEAN) -%.so: %.cpp .depend +%.so: %.cpp + @mkdir -p .depend $(CXX) $(MODFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep modperl_install: create_install_dir