mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-08 16:52:59 +01:00
a26a7463a0
SVN Revision: 2029
281 lines
6.7 KiB
Makefile
281 lines
6.7 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@
|
|
|
|
ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
|
|
|
|
INSTALLUSER=@INSTALLUSER@
|
|
# if no user was enabled, don't set privileges or ownership
|
|
ifeq ($(INSTALLUSER),)
|
|
O_USER=
|
|
G_USER=
|
|
CHOWN_COMMAND=echo
|
|
CHOWN_OUTPUT=/dev/null
|
|
else
|
|
O_USER=-o $(INSTALLUSER)
|
|
G_USER=-g $(INSTALLUSER)
|
|
CHOWN_COMMAND=chown
|
|
CHOWN_OUTPUT=&1
|
|
endif
|
|
|
|
EFLAGS += @ERLANG_SSL39@
|
|
|
|
# make debug=true to compile Erlang module with debug informations.
|
|
ifdef debug
|
|
EFLAGS+=+debug_info
|
|
endif
|
|
|
|
ifdef ejabberd_debug
|
|
EFLAGS+=-Dejabberd_debug
|
|
endif
|
|
|
|
ifeq (@hipe@, true)
|
|
EFLAGS+=+native
|
|
endif
|
|
|
|
ifeq (@roster_gateway_workaround@, true)
|
|
EFLAGS+=-DROSTER_GATEWAY_WORKAROUND
|
|
endif
|
|
|
|
ifeq (@full_xml@, true)
|
|
EFLAGS+=-DFULL_XML_SUPPORT
|
|
endif
|
|
|
|
ifeq (@transient_supervisors@, false)
|
|
EFLAGS+=-DNO_TRANSIENT_SUPERVISORS
|
|
endif
|
|
|
|
INSTALL_EPAM=
|
|
ifeq (@pam@, pam)
|
|
INSTALL_EPAM=install -m 750 $(O_USER) epam $(PBINDIR)
|
|
endif
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_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 =
|
|
|
|
# /etc/ejabberd/
|
|
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
|
|
|
|
# /sbin/
|
|
SBINDIR = $(DESTDIR)@sbindir@
|
|
|
|
# /lib/ejabberd/
|
|
EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
|
|
|
|
# /share/doc/ejabberd
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
datarootdir = @datarootdir@
|
|
DOCDIR = $(DESTDIR)@docdir@
|
|
|
|
# /usr/lib/ejabberd/ebin/
|
|
BEAMDIR = $(EJABBERDDIR)/ebin
|
|
|
|
# /usr/lib/ejabberd/include/
|
|
INCLUDEDIR = $(EJABBERDDIR)/include
|
|
|
|
# /usr/lib/ejabberd/priv/
|
|
PRIVDIR = $(EJABBERDDIR)/priv
|
|
|
|
# /usr/lib/ejabberd/priv/bin
|
|
PBINDIR = $(PRIVDIR)/bin
|
|
|
|
# /usr/lib/ejabberd/priv/lib
|
|
SODIR = $(PRIVDIR)/lib
|
|
|
|
# /usr/lib/ejabberd/priv/msgs
|
|
MSGSDIR = $(PRIVDIR)/msgs
|
|
|
|
# /var/lib/ejabberd/
|
|
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
|
|
|
|
# /var/lib/ejabberd/.erlang.cookie
|
|
COOKIEFILE = $(SPOOLDIR)/.erlang.cookie
|
|
|
|
# /var/log/ejabberd/
|
|
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
|
|
|
|
# Assume Linux-style dynamic library flags
|
|
DYNAMIC_LIB_CFLAGS = -fpic -shared
|
|
ifeq ($(shell uname),Darwin)
|
|
DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
|
|
endif
|
|
ifeq ($(shell uname),SunOs)
|
|
DYNAMIC_LIB_CFLAGS = -KPIC -G -z text
|
|
endif
|
|
|
|
all: $(ERLSHLIBS) compile-beam all-recursive
|
|
|
|
compile-beam: XmppAddr.hrl $(ERLBEHAVBEAMS) $(BEAMS)
|
|
|
|
$(BEAMS): $(ERLBEHAVBEAMS)
|
|
|
|
all-recursive: $(ERLBEHAVBEAMS)
|
|
|
|
%.beam: %.erl
|
|
@ERLC@ -W $(EFLAGS) $<
|
|
|
|
|
|
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 $(EFLAGS) $*.erl
|
|
|
|
$(ERLSHLIBS): %.so: %.c
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) \
|
|
$(subst ../,,$(subst .so,.c,$@)) \
|
|
$(EXPAT_LIBS) \
|
|
$(EXPAT_CFLAGS) \
|
|
$(ERLANG_LIBS) \
|
|
$(ERLANG_CFLAGS) \
|
|
-o $@ \
|
|
$(DYNAMIC_LIB_CFLAGS)
|
|
|
|
translations:
|
|
../contrib/extract_translations/prepare-translation.sh -updateall
|
|
|
|
install: all
|
|
#
|
|
# Configuration files
|
|
install -d -m 750 $(G_USER) $(ETCDIR)
|
|
[ -f $(ETCDIR)/ejabberd.cfg ] \
|
|
&& install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg-new \
|
|
|| install -b -m 640 $(G_USER) ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
|
|
sed -e "s*@rootdir@*@prefix@*" \
|
|
-e "s*@installuser@*@INSTALLUSER@*" \
|
|
-e "s*@LIBDIR@*@libdir@*" \
|
|
-e "s*@SYSCONFDIR@*@sysconfdir@*" \
|
|
-e "s*@LOCALSTATEDIR@*@localstatedir@*" \
|
|
-e "s*@DOCDIR@*@docdir@*" \
|
|
-e "s*@erl@*@ERL@*" ejabberdctl.template \
|
|
> ejabberdctl.example
|
|
[ -f $(ETCDIR)/ejabberdctl.cfg ] \
|
|
&& install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
|
|
|| install -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
|
install -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
|
|
#
|
|
# Administration script
|
|
[ -d $(SBINDIR) ] || install -d -m 750 $(SBINDIR)
|
|
install -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
|
|
#
|
|
# Binary Erlang files
|
|
install -d $(BEAMDIR)
|
|
install -m 644 *.app $(BEAMDIR)
|
|
install -m 644 *.beam $(BEAMDIR)
|
|
rm -f $(BEAMDIR)/configure.beam
|
|
#
|
|
# ejabberd header files
|
|
install -d $(INCLUDEDIR)
|
|
install -m 644 *.hrl $(INCLUDEDIR)
|
|
install -d $(INCLUDEDIR)/eldap/
|
|
install -m 644 eldap/*.hrl $(INCLUDEDIR)/eldap/
|
|
install -d $(INCLUDEDIR)/mod_muc/
|
|
install -m 644 mod_muc/*.hrl $(INCLUDEDIR)/mod_muc/
|
|
install -d $(INCLUDEDIR)/mod_proxy65/
|
|
install -m 644 mod_proxy65/*.hrl $(INCLUDEDIR)/mod_proxy65/
|
|
install -d $(INCLUDEDIR)/mod_pubsub/
|
|
install -m 644 mod_pubsub/*.hrl $(INCLUDEDIR)/mod_pubsub/
|
|
install -d $(INCLUDEDIR)/web/
|
|
install -m 644 web/*.hrl $(INCLUDEDIR)/web/
|
|
#
|
|
# Binary C programs
|
|
install -d $(PBINDIR)
|
|
install -m 750 $(O_USER) ../tools/captcha.sh $(PBINDIR)
|
|
$(INSTALL_EPAM)
|
|
#
|
|
# Binary system libraries
|
|
install -d $(SODIR)
|
|
install -m 644 *.so $(SODIR)
|
|
#
|
|
# Translated strings
|
|
install -d $(MSGSDIR)
|
|
install -m 644 msgs/*.msg $(MSGSDIR)
|
|
#
|
|
# Spool directory
|
|
install -d -m 750 $(O_USER) $(SPOOLDIR)
|
|
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
|
|
chmod -R 750 $(SPOOLDIR)
|
|
[ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
|
|
#
|
|
# Log directory
|
|
install -d -m 750 $(O_USER) $(LOGDIR)
|
|
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
|
|
chmod -R 750 $(LOGDIR)
|
|
#
|
|
# Documentation
|
|
install -d $(DOCDIR)
|
|
install ../doc/guide.html $(DOCDIR)
|
|
install ../doc/*.png $(DOCDIR)
|
|
install ../doc/*.txt $(DOCDIR)
|
|
|
|
uninstall: uninstall-binary
|
|
|
|
uninstall-binary:
|
|
rm -f $(SBINDIR)/ejabberdctl
|
|
rm -fr $(DOCDIR)
|
|
rm -f $(BEAMDIR)/*.beam
|
|
rm -f $(BEAMDIR)/*.app
|
|
rm -fr $(BEAMDIR)
|
|
rm -f $(INCLUDEDIR)/*.hrl
|
|
rm -fr $(INCLUDEDIR)
|
|
rm -fr $(PBINDIR)
|
|
rm -f $(SODIR)/*.so
|
|
rm -fr $(SODIR)
|
|
rm -f $(MSGSDIR)/*.msgs
|
|
rm -fr $(MSGSDIR)
|
|
rm -fr $(PRIVDIR)
|
|
rm -fr $(EJABBERDDIR)
|
|
|
|
uninstall-all: uninstall-binary
|
|
rm -rf $(ETCDIR)
|
|
rm -rf $(EJABBERDDIR)
|
|
rm -rf $(SPOOLDIR)
|
|
rm -rf $(LOGDIR)
|
|
|
|
clean: clean-recursive clean-local
|
|
|
|
clean-local:
|
|
rm -f *.beam $(ERLSHLIBS) epam ejabberdctl.example
|
|
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 .
|