Files
znc/modules/Makefile.in
psychon 1701b39399 modperl: Show the actual compiler flags and get rid of the warnings
We now first run the perl command to get the compiler flags and display
those when compiling modperl, so we now what's going on.

Plus this also uses -Wno-write-strings to disabled all the perl compiler
warnings.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1261 726aef4b-f618-498e-8847-2d620e286838
2008-10-26 18:58:13 +00:00

90 lines
2.3 KiB
Makefile

# Support out-of-tree builds
srcdir := @srcdir@
VPATH := @srcdir@
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 use them here, use MODFLAGS instead
MODFLAGS := @CPPFLAGS@ @MODFLAGS@ -I$(srcdir)/..
MODLINK := @MODLINK@
LDFLAGS := @LDFLAGS@
# LIBS are not and should not be used in here.
# The znc binary links already against those.
# LIBS := @LIBS@
PERL := @PERL@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
FILES := $(basename $(wildcard $(srcdir)/*.cpp))
# Strip away the srcdir, we want them to be created in the current dir
FILES := $(shell echo $(FILES) | sed -e "s:$(srcdir)/::g")
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(FILES), \
$(if $(shell grep REQUIRESSL $(srcdir)/$(file).cpp), \
, \
$(basename $(file)) \
))
endif
ifneq "$(PERL)" ""
# We execute this now so that we see the 'beauty' of these flags in make's output
modperlFLAGS := $(shell $(PERL) -MExtUtils::Embed -e perl_inc -e ldopts)
# Perl API is ugly, casting string literals to char* :(
modperlFLAGS += -Wno-write-strings
PERLHOOK := modperl_install
else
FILES := $(shell echo $(FILES) | sed -e "s/modperl//")
endif
ifeq "@SASL@" ""
FILES := $(shell echo $(FILES) | sed -e "s/saslauth//")
endif
saslauthFLAGS := -lsasl2
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 $(srcdir)/*; do \
d=$$(echo $$a | sed -e "s:$(srcdir)/::g"); \
if [ -d $$a ] && [ -f $${d}.so ]; then \
cp -Rp $$a $(DESTDIR)$(DATADIR); \
fi \
done
clean:
rm -rf $(CLEAN)
%.so: %.cpp Makefile
@mkdir -p .depend
$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(basename $@)FLAGS) -MMD -MF .depend/$@.dep
modperl_install: create_install_dir
for i in $(srcdir)/*.pm; do \
install -m 0644 $$i $(DESTDIR)$(MODDIR); \
done
-include $(wildcard .depend/*.dep)