Files
znc/modules/Makefile.in
psychon 5822a2de75 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
2008-04-20 12:21:26 +00:00

82 lines
1.9 KiB
Makefile

prefix := @prefix@
exec_prefix := @exec_prefix@
datarootdir := @datarootdir@
bindir := @bindir@
datadir := @datadir@
sysconfdir := @sysconfdir@
libdir := @libdir@
sbindir := @sbindir@
localstatedir := @localstatedir@
CXX := @CXX@
# CXXFLAGS are for the main binary, so don't even think of using them here
# CXXFLAGS := @CXXFLAGS@
MODFLAGS := @MODFLAGS@
LDFLAGS := @LDFLAGS@
INCLUDES := @INCLUDES@ -I..
LIBS := @LIBS@
PERL := @PERL@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(wildcard *.cpp), \
$(if $(shell grep REQUIRESSL $(file)), \
, \
$(basename $(file)) \
))
else
FILES := $(basename $(wildcard *.cpp))
endif
ifneq "$(PERL)" ""
PERLCC := -DHAVE_PERL `$(PERL) -MExtUtils::Embed -e perl_inc`
PERLLD := `$(PERL) -MExtUtils::Embed -e perl_inc -e ldopts`
PERLHOOK := modperl_install
else
FILES := $(shell echo $(FILES) | sed -e "s/modperl//")
endif
modperlFLAGS := $(PERLLD) $(PERLCC)
ifeq "@SASL@" ""
FILES := $(shell echo $(FILES) | sed -e "s/saslauth//")
endif
saslauthFLAGS := -lsasl2
SRCS := $(wildcard ../*.cpp) $(addsuffix .cpp, $(FILES))
TARGETS := $(addsuffix .so, $(FILES))
CLEAN := *.so
.PHONY: all clean install modperl_install
all: $(TARGETS)
install: all create_install_dir install_metadirs $(PERLHOOK)
install -m 0755 $(TARGETS) $(DESTDIR)$(MODDIR)
create_install_dir:
mkdir -p $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)
rm -rf $(DESTDIR)$(MODDIR)/*.so
install_metadirs: create_install_dir
for a in *; do \
if [ -d $$a ] && [ -f $${a}.so ]; then \
cp -Rp $$a $(DESTDIR)$(DATADIR); \
fi \
done
clean:
rm -rf $(CLEAN)
%.so: %.cpp
@mkdir -p .depend
$(CXX) $(MODFLAGS) $(INCLUDES) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep
modperl_install: create_install_dir
for i in *.pm; do \
install -m 0755 $$i $(DESTDIR)$(MODDIR); \
done
-include $(wildcard .depend/*.dep)