From 5c5cde9c34b2e426066f772f481645a113bcb8b6 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 20 Apr 2008 07:00:40 +0000 Subject: [PATCH] Makefile: Always do dependency tracking If you now change znc.h, every file that '#include's znc.h is *always* regenerated. According to [1], these compiler flags were already around with GCC 3.2, so this change shouldn't hurt anyone. [1] http://lists.samba.org/archive/ccache/2002q4/000003.html git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1026 726aef4b-f618-498e-8847-2d620e286838 --- Makefile.in | 22 +++++----------------- modules/Makefile.in | 16 ++-------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/Makefile.in b/Makefile.in index 81fd6691..ec4f9d89 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,24 +22,17 @@ CLEAN := znc znc-static *.o core core.* DISTCLEAN := Makefile config.log config.status znc-config .depend \ modules/.depend modules/Makefile -DEPEND := $(wildcard .depend) -ifeq ($(DEPEND), ) -DEPEND := no -else -DEPEND := yes -endif - -.PHONY: all modules clean distclean install +.PHONY: all modules clean depend distclean install all: znc @MODTARGET@ .depend: @mkdir -p .depend - @if test -n "@MODTARGET@"; then \ - $(MAKE) -C modules .depend ; \ - fi depend: .depend + @if test -n "@MODTARGET@"; then \ + $(MAKE) -C modules depend ; \ + fi znc: $(OBJS) $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) @@ -63,13 +56,8 @@ clean: distclean: clean rm -rf $(DISTCLEAN) -ifeq ($(DEPEND), yes) -.cpp.o: +%.o: %.cpp .depend $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< -MMD -MF .depend/$<.dep -else -.cpp.o: - $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< -endif install: znc @MODTARGET@ mkdir -p $(DESTDIR)$(prefix)/bin diff --git a/modules/Makefile.in b/modules/Makefile.in index 26f8a638..a5aeb20b 100644 --- a/modules/Makefile.in +++ b/modules/Makefile.in @@ -47,14 +47,7 @@ TARGETS := $(addsuffix .so, $(FILES)) CLEAN := *.so -DEPEND := $(wildcard .depend) -ifeq ($(DEPEND), ) -DEPEND := no -else -DEPEND := yes -endif - -.PHONY: all clean install modperl_install +.PHONY: all clean depend install modperl_install all: $(TARGETS) @@ -81,13 +74,8 @@ install_metadirs: create_install_dir clean: rm -rf $(CLEAN) -ifeq ($(DEPEND), yes) -%.so: %.cpp +%.so: %.cpp .depend $(CXX) $(MODFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep -else -%.so: %.cpp - $(CXX) $(MODFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -endif modperl_install: create_install_dir for i in *.pm; do \