Files
znc/modules/Makefile.in
psychon d7c51ed141 And again some makefile stuff (this time it's some new depend code)
We are back to the behaviour of some old version of the Makefile

If you want to compile ZNC only once, just use make.

If you want the Makefile do to dependency tracking and that fancy stuff,
run make depend which creates the .depend and modules/.depend dirs.

From then on some dependency files get written when you compile something.

(The way we did it before now was bad, because all the .cpp files depended on
 the .depend dir which got its mtime updated regulary)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@922 726aef4b-f618-498e-8847-2d620e286838
2008-01-16 20:56:07 +00:00

96 lines
2.1 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 := @CXXFLAGS@
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
DEPEND := $(wildcard .depend)
ifeq ($(DEPEND), )
DEPEND := no
else
DEPEND := yes
endif
.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)
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)
ifeq ($(DEPEND), yes)
%.so: %.cpp
$(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 $(wildcard .depend/*.dep)