mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-10 15:47:30 +01:00
ab1610021d
in multi core CPUs: fix compilation dependencies; compile behaviors before other source code. (thanks to Jonathan Schleifer) * src/mod_pubsub/Makefile.in: Likewise * src/eldap/Makefile.in: Likewise SVN Revision: 1258
162 lines
3.9 KiB
Makefile
162 lines
3.9 KiB
Makefile
# $Id$
|
|
|
|
CC = @CC@
|
|
CFLAGS = @CFLAGS@
|
|
CPPFLAGS = @CPPFLAGS@
|
|
LDFLAGS = @LDFLAGS@
|
|
LIBS = @LIBS@
|
|
|
|
EXPAT_CFLAGS = @EXPAT_CFLAGS@
|
|
ERLANG_CFLAGS= @ERLANG_CFLAGS@
|
|
|
|
EXPAT_LIBS = @EXPAT_LIBS@
|
|
ERLANG_LIBS = @ERLANG_LIBS@
|
|
|
|
ERLC_FLAGS += @ERLANG_SSL39@
|
|
|
|
ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
|
|
# make debug=true to compile Erlang module with debug informations.
|
|
ifdef debug
|
|
ERLC_FLAGS+=+debug_info
|
|
endif
|
|
|
|
ifdef ejabberd_debug
|
|
ERLC_FLAGS+=-Dejabberd_debug
|
|
endif
|
|
|
|
ifeq (@hipe@, true)
|
|
ERLC_FLAGS+=+native
|
|
endif
|
|
|
|
ifeq (@roster_gateway_workaround@, true)
|
|
ERLC_FLAGS+=-DROSTER_GATEWAY_WORKAROUND
|
|
endif
|
|
|
|
ifeq (@full_xml@, true)
|
|
ERLC_FLAGS+=-DFULL_XML_SUPPORT
|
|
endif
|
|
|
|
ifeq (@transient_supervisors@, false)
|
|
ERLC_FLAGS+=-DNO_TRANSIENT_SUPERVISORS
|
|
endif
|
|
|
|
INSTALL_EPAM=
|
|
ifeq (@pam@, pam)
|
|
INSTALL_EPAM=install -m 750 epam $(PBINDIR)
|
|
endif
|
|
|
|
prefix = @prefix@
|
|
|
|
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @mod_proxy65@ @eldap@ @pam@ @web@ stringprep @tls@ @odbc@ @ejabberd_zlib@
|
|
ERLSHLIBS = expat_erl.so
|
|
ERLBEHAVS = cyrsasl.erl gen_mod.erl p1_fsm.erl
|
|
SOURCES_ALL = $(wildcard *.erl)
|
|
SOURCES = $(filter-out $(ERLBEHAVS),$(SOURCES_ALL))
|
|
ERLBEHAVBEAMS = $(ERLBEHAVS:.erl=.beam)
|
|
BEAMS = $(SOURCES:.erl=.beam)
|
|
|
|
DESTDIR =
|
|
|
|
EJABBERDDIR = $(DESTDIR)@prefix@/var/lib/ejabberd
|
|
BEAMDIR = $(EJABBERDDIR)/ebin
|
|
PRIVDIR = $(EJABBERDDIR)/priv
|
|
SODIR = $(PRIVDIR)/lib
|
|
PBINDIR = $(PRIVDIR)/bin
|
|
MSGSDIR = $(PRIVDIR)/msgs
|
|
LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd
|
|
ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd
|
|
SBINDIR = $(DESTDIR)@prefix@/sbin
|
|
|
|
ifeq ($(shell uname),Darwin)
|
|
DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
|
|
else
|
|
# Assume Linux-style dynamic library flags
|
|
DYNAMIC_LIB_CFLAGS = -fpic -shared
|
|
endif
|
|
|
|
all: $(ERLSHLIBS) compile-beam all-recursive
|
|
|
|
compile-beam: XmppAddr.hrl $(ERLBEHAVBEAMS) $(BEAMS)
|
|
|
|
$(BEAMS): $(ERLBEHAVBEAMS)
|
|
|
|
all-recursive: $(ERLBEHAVBEAMS)
|
|
|
|
%.beam: %.erl
|
|
@ERLC@ -W $(ERLC_FLAGS) $<
|
|
|
|
|
|
all-recursive install-recursive uninstall-recursive \
|
|
clean-recursive distclean-recursive \
|
|
mostlyclean-recursive maintainer-clean-recursive:
|
|
@subdirs="$(SUBDIRS)"; for subdir in $$subdirs; do \
|
|
target=`echo $@|sed 's,-recursive,,'`; \
|
|
echo making $$target in $$subdir; \
|
|
(cd $$subdir && $(MAKE) $$target) || exit 1; \
|
|
done
|
|
|
|
|
|
%.hrl: %.asn1
|
|
@ERLC@ $(ASN_FLAGS) $<
|
|
@ERLC@ -W $(ERLC_FLAGS) $*.erl
|
|
|
|
$(ERLSHLIBS): %.so: %.c
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) \
|
|
$(subst ../,,$(subst .so,.c,$@)) \
|
|
$(EXPAT_LIBS) $(EXPAT_CFLAGS) \
|
|
$(ERLANG_LIBS) $(ERLANG_CFLAGS) \
|
|
-o $@ $(DYNAMIC_LIB_CFLAGS)
|
|
|
|
install: all
|
|
install -d $(BEAMDIR)
|
|
install -m 644 *.beam $(BEAMDIR)
|
|
rm -f $(BEAMDIR)/configure.beam
|
|
install -m 644 *.app $(BEAMDIR)
|
|
install -d $(SODIR)
|
|
install -d $(PBINDIR)
|
|
install -m 644 *.so $(SODIR)
|
|
$(INSTALL_EPAM)
|
|
install -d $(MSGSDIR)
|
|
install -m 644 msgs/*.msg $(MSGSDIR)
|
|
install -d $(ETCDIR)
|
|
[ -f $(ETCDIR)/ejabberd.cfg ] && install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new || install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
|
|
sed -e "s*@rootdir@*@prefix@*" ejabberdctl.template > ejabberdctl.example
|
|
[ -f $(ETCDIR)/ejabberdctl.cfg ] && install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new || install -b -m 644 ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
|
install -b -m 644 inetrc $(ETCDIR)/inetrc
|
|
install -d $(SBINDIR)
|
|
install -m 755 ejabberdctl.example $(SBINDIR)/ejabberdctl
|
|
install -d $(LOGDIR)
|
|
|
|
uninstall: uninstall-binary
|
|
|
|
uninstall-binary:
|
|
rm -rf $(BEAMDIR)
|
|
rm -rf $(SODIR)
|
|
rm -rf $(MSGSDIR)
|
|
rm -rf $(PRIVDIR)
|
|
rm -rf $(SBINDIR)/ejabberdctl
|
|
|
|
uninstall-all: uninstall-binary
|
|
rm -rf $(ETCDIR)
|
|
rm -rf $(LOGDIR)
|
|
rm -rf $(EJABBERDDIR)
|
|
|
|
clean: clean-recursive clean-local
|
|
|
|
clean-local:
|
|
rm -f *.beam $(ERLSHLIBS) epam
|
|
rm -f XmppAddr.asn1db XmppAddr.erl XmppAddr.hrl
|
|
|
|
distclean: distclean-recursive clean-local
|
|
rm -f config.status
|
|
rm -f config.log
|
|
rm -f Makefile
|
|
|
|
TAGS:
|
|
etags *.erl
|
|
|
|
Makefile: Makefile.in
|
|
|
|
dialyzer: $(BEAMS)
|
|
@dialyzer -c .
|