mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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
88 lines
2.0 KiB
Makefile
88 lines
2.0 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@
|
|
DEPEND := yes
|
|
|
|
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)
|
|
|
|
.depend:
|
|
@mkdir -p .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 .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 $(wildcard .depend/*.dep)
|