Files
znc/modules/Makefile.in
psychon 9c4a5a1d90 Some tweaking and cleaning up to configure.in
- Make it clear to autoconf that we are C++ only. It now no longer checks for a
  C compiler which might save time on some boxes.
- Honour CPPFLAGS.
- Remove some unused vars from AC_SUBST.
- Add includes to CXXFLAGS instead of using $INCLUDES for this.
- Use autoconf macros instead of 'echo' for the 'checking for perl' message.
- Fix all warnings from 'autoconf -W all'.
- Use AC_CONFIG_SRCDIR for helping configure find the source dir.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1251 726aef4b-f618-498e-8847-2d620e286838
2008-10-15 18:36:08 +00:00

79 lines
1.8 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 use them here, use MODFLAGS instead
MODFLAGS := @CPPFLAGS@ @MODFLAGS@ -I..
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@
ifeq "@NOSSL@" "1"
FILES := $(foreach file, $(wildcard *.cpp), \
$(if $(shell grep REQUIRESSL $(file)), \
, \
$(basename $(file)) \
))
else
FILES := $(basename $(wildcard *.cpp))
endif
ifneq "$(PERL)" ""
modperlFLAGS := `$(PERL) -MExtUtils::Embed -e perl_inc -e ldopts`
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 *; do \
if [ -d $$a ] && [ -f $${a}.so ]; then \
cp -Rp $$a $(DESTDIR)$(DATADIR); \
fi \
done
clean:
rm -rf $(CLEAN)
%.so: %.cpp Makefile
@mkdir -p .depend
$(CXX) $(MODFLAGS) $(LDFLAGS) -shared -o $@ $< $($(basename $<)FLAGS) -MMD -MF .depend/$<.dep
modperl_install: create_install_dir
for i in *.pm; do \
install -m 0644 $$i $(DESTDIR)$(MODDIR); \
done
-include $(wildcard .depend/*.dep)