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
This commit is contained in:
psychon
2008-04-20 07:00:40 +00:00
parent 8d5fa6bc3b
commit 5c5cde9c34
2 changed files with 7 additions and 31 deletions
+5 -17
View File
@@ -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
+2 -14
View File
@@ -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 \