Files
znc/modules/Makefile.in
psychon 3ecbf13390 Use autoheader
This commit adds a zncconfig.h to ZNC that is automatically generated by
configure. This is done because the -DPACKAGE_STRING=\"znc\ 0.097\" that
configure adds to CXXFLAGS breaks znc-buildmod.

This means that we have to include zncconfig.h as the very first header in every
C++ file that is compiled. This commit kinda cheats and instead adds this
include as the very first thing to all header files we have. This should
hopefully mean that modules don't have to include this.

Because Csocket includes defines.h too late, this commit causes znc to divert
from upstream Csocket once again. :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2250 726aef4b-f618-498e-8847-2d620e286838
2011-01-07 15:01:08 +00:00

129 lines
3.0 KiB
Makefile

all:
SHELL := @SHELL@
# 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 := @DEFS@ @CPPFLAGS@ @MODFLAGS@ -I$(srcdir)/.. -I..
MODLINK := @MODLINK@
LDFLAGS := @LDFLAGS@
# LIBS are not and should not be used in here.
# The znc binary links already against those.
# LIBS := @LIBS@
PERL_ON := @PERL@
PERL := @PERL_BINARY@
PYCFG := @PYTHONCFG_BINARY@
SWIG := @SWIG_BINARY@
MODDIR := @MODDIR@
DATADIR := @DATADIR@
LIBZNC := @LIBZNC@
LIBZNCDIR:= @LIBZNCDIR@
INSTALL := @INSTALL@
INSTALL_PROGRAM := @INSTALL_PROGRAM@
INSTALL_SCRIPT := @INSTALL_SCRIPT@
INSTALL_DATA := @INSTALL_DATA@
TCL_FLAGS:= @TCL_FLAGS@
ifneq "$(V)" ""
VERBOSE=1
endif
ifeq "$(VERBOSE)" ""
Q=@
E=@echo
else
Q=
E=@\#
endif
ifneq "$(LIBZNC)" ""
LDFLAGS += -L.. -lznc -Wl,-rpath,$(LIBZNCDIR)
endif
CLEAN :=
FILES := $(notdir $(wildcard $(srcdir)/*.cpp))
# If extra is enabled
ifeq "@EXTRA@" "yes"
FILES += $(addprefix extra/, $(notdir $(wildcard $(srcdir)/extra/*.cpp)))
endif
include $(srcdir)/modperl/Makefile.inc
include $(srcdir)/modpython/Makefile.inc
include $(srcdir)/Makefile.modtcl
FILES := $(basename $(FILES))
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(FILES), \
$(if $(shell grep REQUIRESSL $(srcdir)/$(file).cpp), \
, \
$(basename $(file)) \
))
endif
ifeq "@SASL@" ""
FILES := $(shell echo $(FILES) | sed -e "s:extra/saslauth::")
endif
saslauthFLAGS := -lsasl2
ifeq "@CHARSET@" ""
FILES := $(shell echo $(FILES) | sed -e "s:extra/charset::")
endif
charsetFLAGS := @LIBICONV@
TARGETS := $(addsuffix .so, $(FILES))
CLEAN += *.so extra/*.so
.PHONY: all clean install install_metadirs create_install_dir uninstall
all: $(TARGETS)
install: all create_install_dir install_metadirs
$(INSTALL_PROGRAM) $(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;s:modperl::;s:modpython::"); \
if [ -d $$a ] && [ -f $${d}.so ]; then \
cp -Rp $$a $(DESTDIR)$(DATADIR); \
fi \
done
clean:
rm -rf $(CLEAN)
%.so: %.cpp Makefile
@mkdir -p .depend
@mkdir -p extra
$(E) Building $(if $(filter %extra/,$(dir $<)),extra )module $(notdir $(basename $@))...
$(Q)$(CXX) $(MODFLAGS) $(LDFLAGS) $(MODLINK) -o $@ $< $($(notdir $(basename $@))FLAGS) -MMD -MF .depend/$(notdir $@).dep
uninstall:
# Yes, we are lazy, just remove everything in there
rm -rf $(DESTDIR)$(MODDIR)/*
rm -rf $(DESTDIR)$(DATADIR)/*
rmdir $(DESTDIR)$(MODDIR)
rmdir $(DESTDIR)$(DATADIR)
-include $(wildcard .depend/*.dep)