Fix/Change the generation of .depend

Instead of having one big file which is generated in a seperated step,
we now have a directory where serveral files are created.

This fixes .depend, which was broken since we don't generate .o files
for our modules.

Everyone will have to delete his .depend file after this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@914 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-01-07 21:28:03 +00:00
parent 378563abf9
commit 3637091b60
2 changed files with 18 additions and 13 deletions
+9 -5
View File
@@ -15,6 +15,7 @@ LIBS := @LIBS@
PERL := @PERL@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
DEPEND := yes
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(wildcard *.cpp), \
@@ -45,14 +46,12 @@ TARGETS := $(addsuffix .so, $(FILES))
CLEAN := *.so
.PHONY: all clean install depend modperl_install
.PHONY: all clean install modperl_install
all: $(TARGETS)
.depend:
$(CXX) -MM $(CXXFLAGS) $(SRCS) $(INCLUDES) $(PERLCC) >.depend
depend: .depend
@mkdir -p .depend
install: all create_install_dir install_metadirs $(PERLHOOK)
install -m 0755 $(TARGETS) $(DESTDIR)$(MODDIR)
@@ -72,12 +71,17 @@ install_metadirs: create_install_dir
clean:
rm -rf $(CLEAN)
ifeq ($(DEPEND), yes)
%.so: %.cpp .depend
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) $($(basename $<)FLAGS) -shared -o $@ $< -MMD -MF .depend/$<.dep
else
%.so: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(LDFLAGS) $($(basename $<)FLAGS) -shared -o $@ $<
endif
modperl_install: create_install_dir
for i in *.pm; do \
install -m 0755 $$i $(DESTDIR)$(MODDIR); \
done
-include .depend
-include $(wildcard .depend/*.dep)