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
This commit is contained in:
psychon
2008-04-20 12:21:26 +00:00
parent 5c5cde9c34
commit 5822a2de75
2 changed files with 6 additions and 17 deletions
+3 -10
View File
@@ -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@
+3 -7
View File
@@ -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