2003-10-17 21:15:38 +02:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
CC = @CC@
|
2004-09-26 22:46:43 +02:00
|
|
|
CFLAGS = @CFLAGS@
|
2003-10-17 21:15:38 +02:00
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
2004-09-26 22:46:43 +02:00
|
|
|
LIBS = @LIBS@
|
|
|
|
|
|
|
|
EXPAT_CFLAGS = @EXPAT_CFLAGS@
|
|
|
|
ERLANG_CFLAGS= @ERLANG_CFLAGS@
|
|
|
|
|
|
|
|
EXPAT_LIBS = @EXPAT_LIBS@
|
|
|
|
ERLANG_LIBS = @ERLANG_LIBS@
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2007-05-29 16:31:12 +02:00
|
|
|
ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
|
2008-07-13 21:10:01 +02:00
|
|
|
|
2008-07-14 12:06:13 +02:00
|
|
|
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
|
2009-08-24 21:44:07 +02:00
|
|
|
INIT_USER=root
|
2008-07-14 12:06:13 +02:00
|
|
|
else
|
|
|
|
O_USER=-o $(INSTALLUSER)
|
|
|
|
G_USER=-g $(INSTALLUSER)
|
|
|
|
CHOWN_COMMAND=chown
|
|
|
|
CHOWN_OUTPUT=&1
|
2009-08-24 21:44:07 +02:00
|
|
|
INIT_USER=$(INSTALLUSER)
|
2008-07-14 12:06:13 +02:00
|
|
|
endif
|
|
|
|
|
2010-07-09 20:02:29 +02:00
|
|
|
EFLAGS += @ERLANG_SSLVER@ -pa .
|
2010-08-07 13:06:50 +02:00
|
|
|
ERLANG_CFLAGS += @ERLANG_SSLVER@
|
2008-07-13 21:10:01 +02:00
|
|
|
|
2005-12-06 20:32:50 +01:00
|
|
|
# make debug=true to compile Erlang module with debug informations.
|
|
|
|
ifdef debug
|
2009-12-29 20:10:52 +01:00
|
|
|
EFLAGS+=+debug_info +export_all
|
2005-12-06 20:32:50 +01:00
|
|
|
endif
|
|
|
|
|
2010-07-12 16:02:41 +02:00
|
|
|
DEBUGTOOLS = p1_prof.erl
|
|
|
|
ifdef debugtools
|
2010-05-28 00:48:04 +02:00
|
|
|
SOURCES+=$(DEBUGTOOLS)
|
2006-04-01 18:05:20 +02:00
|
|
|
endif
|
|
|
|
|
2007-12-06 18:09:35 +01:00
|
|
|
ifeq (@hipe@, true)
|
2008-07-13 21:10:01 +02:00
|
|
|
EFLAGS+=+native
|
2007-12-06 18:09:35 +01:00
|
|
|
endif
|
|
|
|
|
2005-12-11 20:48:31 +01:00
|
|
|
ifeq (@roster_gateway_workaround@, true)
|
2008-07-13 21:10:01 +02:00
|
|
|
EFLAGS+=-DROSTER_GATEWAY_WORKAROUND
|
2005-12-11 20:48:31 +01:00
|
|
|
endif
|
|
|
|
|
2007-07-31 14:05:00 +02:00
|
|
|
ifeq (@full_xml@, true)
|
2008-07-13 21:10:01 +02:00
|
|
|
EFLAGS+=-DFULL_XML_SUPPORT
|
2007-07-31 14:05:00 +02:00
|
|
|
endif
|
|
|
|
|
2010-07-01 12:54:01 +02:00
|
|
|
ifeq (@nif@, true)
|
|
|
|
EFLAGS+=-DNIF
|
|
|
|
ERLSHLIBS=xml.so
|
|
|
|
endif
|
|
|
|
|
2007-09-14 16:16:36 +02:00
|
|
|
ifeq (@transient_supervisors@, false)
|
2008-07-13 21:10:01 +02:00
|
|
|
EFLAGS+=-DNO_TRANSIENT_SUPERVISORS
|
2007-09-14 16:16:36 +02:00
|
|
|
endif
|
|
|
|
|
2010-08-07 14:04:57 +02:00
|
|
|
ifeq (@md2@, true)
|
|
|
|
EFLAGS+=-DHAVE_MD2
|
|
|
|
ERLANG_CFLAGS += -DHAVE_MD2
|
|
|
|
endif
|
|
|
|
|
2008-03-25 19:59:45 +01:00
|
|
|
INSTALL_EPAM=
|
|
|
|
ifeq (@pam@, pam)
|
2008-07-14 12:06:13 +02:00
|
|
|
INSTALL_EPAM=install -m 750 $(O_USER) epam $(PBINDIR)
|
2008-03-25 19:59:45 +01:00
|
|
|
endif
|
|
|
|
|
2003-10-21 22:28:36 +02:00
|
|
|
prefix = @prefix@
|
2008-04-02 16:24:18 +02:00
|
|
|
exec_prefix = @exec_prefix@
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2009-08-11 20:22:43 +02:00
|
|
|
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @mod_proxy65@ @eldap@ @pam@ @web@ stringprep stun @tls@ @odbc@ @ejabberd_zlib@
|
2010-07-01 12:54:01 +02:00
|
|
|
ERLSHLIBS += expat_erl.so
|
2007-12-07 09:44:22 +01:00
|
|
|
ERLBEHAVS = cyrsasl.erl gen_mod.erl p1_fsm.erl
|
2008-03-26 10:27:46 +01:00
|
|
|
SOURCES_ALL = $(wildcard *.erl)
|
2010-05-28 00:48:04 +02:00
|
|
|
SOURCES_MISC = $(ERLBEHAVS) $(DEBUGTOOLS)
|
|
|
|
SOURCES += $(filter-out $(SOURCES_MISC),$(SOURCES_ALL))
|
2008-03-26 10:27:46 +01:00
|
|
|
ERLBEHAVBEAMS = $(ERLBEHAVS:.erl=.beam)
|
2005-12-11 20:48:31 +01:00
|
|
|
BEAMS = $(SOURCES:.erl=.beam)
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2008-01-15 12:11:27 +01:00
|
|
|
DESTDIR =
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2008-07-13 21:10:01 +02:00
|
|
|
# /etc/ejabberd/
|
|
|
|
ETCDIR = $(DESTDIR)@sysconfdir@/ejabberd
|
|
|
|
|
|
|
|
# /sbin/
|
|
|
|
SBINDIR = $(DESTDIR)@sbindir@
|
|
|
|
|
|
|
|
# /lib/ejabberd/
|
|
|
|
EJABBERDDIR = $(DESTDIR)@libdir@/ejabberd
|
|
|
|
|
|
|
|
# /share/doc/ejabberd
|
|
|
|
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
2008-07-14 01:32:54 +02:00
|
|
|
datarootdir = @datarootdir@
|
2008-10-17 19:37:50 +02:00
|
|
|
DOCDIR = $(DESTDIR)@docdir@
|
2008-07-13 21:10:01 +02:00
|
|
|
|
|
|
|
# /usr/lib/ejabberd/ebin/
|
2004-05-17 22:36:41 +02:00
|
|
|
BEAMDIR = $(EJABBERDDIR)/ebin
|
2008-07-13 21:10:01 +02:00
|
|
|
|
|
|
|
# /usr/lib/ejabberd/include/
|
|
|
|
INCLUDEDIR = $(EJABBERDDIR)/include
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/
|
2003-10-21 22:28:36 +02:00
|
|
|
PRIVDIR = $(EJABBERDDIR)/priv
|
2008-07-13 21:10:01 +02:00
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/bin
|
2008-03-21 16:42:14 +01:00
|
|
|
PBINDIR = $(PRIVDIR)/bin
|
2008-07-13 21:10:01 +02:00
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/lib
|
|
|
|
SODIR = $(PRIVDIR)/lib
|
|
|
|
|
|
|
|
# /usr/lib/ejabberd/priv/msgs
|
2003-11-13 20:09:33 +01:00
|
|
|
MSGSDIR = $(PRIVDIR)/msgs
|
2008-07-13 21:10:01 +02:00
|
|
|
|
|
|
|
# /var/lib/ejabberd/
|
|
|
|
SPOOLDIR = $(DESTDIR)@localstatedir@/lib/ejabberd
|
|
|
|
|
2010-01-24 14:39:15 +01:00
|
|
|
# /var/lock/ejabberdctl
|
|
|
|
CTLLOCKDIR = $(DESTDIR)@localstatedir@/lock/ejabberdctl
|
|
|
|
|
2008-07-13 21:10:01 +02:00
|
|
|
# /var/lib/ejabberd/.erlang.cookie
|
|
|
|
COOKIEFILE = $(SPOOLDIR)/.erlang.cookie
|
|
|
|
|
|
|
|
# /var/log/ejabberd/
|
2008-04-02 16:24:18 +02:00
|
|
|
LOGDIR = $(DESTDIR)@localstatedir@/log/ejabberd
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2006-08-28 16:56:13 +02:00
|
|
|
# Assume Linux-style dynamic library flags
|
|
|
|
DYNAMIC_LIB_CFLAGS = -fpic -shared
|
2009-03-07 10:52:26 +01:00
|
|
|
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
|
2006-08-28 16:56:13 +02:00
|
|
|
endif
|
|
|
|
|
2004-05-17 22:36:41 +02:00
|
|
|
all: $(ERLSHLIBS) compile-beam all-recursive
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2008-03-26 10:27:46 +01:00
|
|
|
compile-beam: XmppAddr.hrl $(ERLBEHAVBEAMS) $(BEAMS)
|
|
|
|
|
|
|
|
$(BEAMS): $(ERLBEHAVBEAMS)
|
|
|
|
|
|
|
|
all-recursive: $(ERLBEHAVBEAMS)
|
2005-12-11 20:48:31 +01:00
|
|
|
|
|
|
|
%.beam: %.erl
|
2008-07-13 21:10:01 +02:00
|
|
|
@ERLC@ -W $(EFLAGS) $<
|
2003-10-17 21:15:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2005-11-17 06:29:33 +01:00
|
|
|
%.hrl: %.asn1
|
2005-12-11 20:48:31 +01:00
|
|
|
@ERLC@ $(ASN_FLAGS) $<
|
2008-07-13 21:10:01 +02:00
|
|
|
@ERLC@ -W $(EFLAGS) $*.erl
|
2005-11-17 06:29:33 +01:00
|
|
|
|
2003-10-18 21:15:12 +02:00
|
|
|
$(ERLSHLIBS): %.so: %.c
|
2008-04-11 19:32:20 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) \
|
|
|
|
$(subst ../,,$(subst .so,.c,$@)) \
|
|
|
|
$(EXPAT_LIBS) \
|
|
|
|
$(EXPAT_CFLAGS) \
|
|
|
|
$(ERLANG_LIBS) \
|
|
|
|
$(ERLANG_CFLAGS) \
|
|
|
|
-o $@ \
|
|
|
|
$(DYNAMIC_LIB_CFLAGS)
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2008-08-17 18:35:58 +02:00
|
|
|
translations:
|
|
|
|
../contrib/extract_translations/prepare-translation.sh -updateall
|
|
|
|
|
2003-10-21 22:28:36 +02:00
|
|
|
install: all
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Configuration files
|
2008-07-14 12:06:13 +02:00
|
|
|
install -d -m 750 $(G_USER) $(ETCDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
[ -f $(ETCDIR)/ejabberd.cfg ] \
|
2008-07-14 12:06:13 +02:00
|
|
|
&& 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
|
2008-07-13 21:10:01 +02:00
|
|
|
sed -e "s*@rootdir@*@prefix@*" \
|
|
|
|
-e "s*@installuser@*@INSTALLUSER@*" \
|
|
|
|
-e "s*@LIBDIR@*@libdir@*" \
|
|
|
|
-e "s*@SYSCONFDIR@*@sysconfdir@*" \
|
|
|
|
-e "s*@LOCALSTATEDIR@*@localstatedir@*" \
|
2009-01-20 20:42:08 +01:00
|
|
|
-e "s*@DOCDIR@*@docdir@*" \
|
2008-07-13 21:10:01 +02:00
|
|
|
-e "s*@erl@*@ERL@*" ejabberdctl.template \
|
|
|
|
> ejabberdctl.example
|
|
|
|
[ -f $(ETCDIR)/ejabberdctl.cfg ] \
|
2008-07-14 12:06:13 +02:00
|
|
|
&& 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
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Administration script
|
2009-07-07 10:27:15 +02:00
|
|
|
[ -d $(SBINDIR) ] || install -d -m 755 $(SBINDIR)
|
2008-07-14 12:06:13 +02:00
|
|
|
install -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
2009-08-24 21:44:07 +02:00
|
|
|
# Init script
|
|
|
|
sed -e "s*@ctlscriptpath@*$(SBINDIR)*" \
|
|
|
|
-e "s*@installuser@*$(INIT_USER)*" ejabberd.init.template \
|
|
|
|
> ejabberd.init
|
2011-05-30 11:46:13 +02:00
|
|
|
chmod 755 ejabberd.init
|
2009-08-24 21:44:07 +02:00
|
|
|
#
|
2008-07-13 21:10:01 +02:00
|
|
|
# Binary Erlang files
|
2004-05-17 22:36:41 +02:00
|
|
|
install -d $(BEAMDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
install -m 644 *.app $(BEAMDIR)
|
2004-05-17 22:36:41 +02:00
|
|
|
install -m 644 *.beam $(BEAMDIR)
|
|
|
|
rm -f $(BEAMDIR)/configure.beam
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# ejabberd header files
|
|
|
|
install -d $(INCLUDEDIR)
|
2008-07-16 18:58:42 +02:00
|
|
|
install -m 644 *.hrl $(INCLUDEDIR)
|
|
|
|
install -d $(INCLUDEDIR)/eldap/
|
|
|
|
install -m 644 eldap/*.hrl $(INCLUDEDIR)/eldap/
|
2008-12-02 20:23:12 +01:00
|
|
|
install -d $(INCLUDEDIR)/mod_muc/
|
|
|
|
install -m 644 mod_muc/*.hrl $(INCLUDEDIR)/mod_muc/
|
2008-07-16 18:58:42 +02:00
|
|
|
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/
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Binary C programs
|
2008-03-21 16:42:14 +01:00
|
|
|
install -d $(PBINDIR)
|
2009-04-22 12:23:22 +02:00
|
|
|
install -m 750 $(O_USER) ../tools/captcha.sh $(PBINDIR)
|
2008-03-25 19:59:45 +01:00
|
|
|
$(INSTALL_EPAM)
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Binary system libraries
|
|
|
|
install -d $(SODIR)
|
|
|
|
install -m 644 *.so $(SODIR)
|
|
|
|
#
|
|
|
|
# Translated strings
|
2004-05-17 22:36:41 +02:00
|
|
|
install -d $(MSGSDIR)
|
|
|
|
install -m 644 msgs/*.msg $(MSGSDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Spool directory
|
2008-07-14 12:06:13 +02:00
|
|
|
install -d -m 750 $(O_USER) $(SPOOLDIR)
|
|
|
|
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
|
2008-07-13 21:10:01 +02:00
|
|
|
chmod -R 750 $(SPOOLDIR)
|
2010-02-12 20:25:31 +01:00
|
|
|
[ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
|
|
|
|
#
|
2010-01-24 14:39:15 +01:00
|
|
|
# ejabberdctl lock directory
|
|
|
|
install -d -m 750 $(O_USER) $(CTLLOCKDIR)
|
|
|
|
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
|
|
|
|
chmod -R 750 $(CTLLOCKDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
#
|
|
|
|
# Log directory
|
2008-07-14 12:06:13 +02:00
|
|
|
install -d -m 750 $(O_USER) $(LOGDIR)
|
|
|
|
$(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
|
2008-07-13 21:10:01 +02:00
|
|
|
chmod -R 750 $(LOGDIR)
|
|
|
|
#
|
|
|
|
# Documentation
|
|
|
|
install -d $(DOCDIR)
|
2010-06-12 13:08:28 +02:00
|
|
|
install -m 644 ../doc/dev.html $(DOCDIR)
|
2010-01-25 19:40:17 +01:00
|
|
|
install -m 644 ../doc/guide.html $(DOCDIR)
|
|
|
|
install -m 644 ../doc/*.png $(DOCDIR)
|
|
|
|
install -m 644 ../doc/*.txt $(DOCDIR)
|
2010-06-12 13:08:28 +02:00
|
|
|
[ -f ../doc/guide.pdf ] \
|
|
|
|
&& install -m 644 ../doc/guide.pdf $(DOCDIR) \
|
|
|
|
|| echo "No ../doc/guide.pdf was built"
|
2010-06-12 14:24:12 +02:00
|
|
|
install -m 644 ../COPYING $(DOCDIR)
|
2004-05-17 22:36:41 +02:00
|
|
|
|
2007-12-02 02:03:18 +01:00
|
|
|
uninstall: uninstall-binary
|
|
|
|
|
|
|
|
uninstall-binary:
|
2008-07-13 21:10:01 +02:00
|
|
|
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)
|
2007-12-02 02:03:18 +01:00
|
|
|
|
|
|
|
uninstall-all: uninstall-binary
|
|
|
|
rm -rf $(ETCDIR)
|
|
|
|
rm -rf $(EJABBERDDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
rm -rf $(SPOOLDIR)
|
2010-01-24 14:39:15 +01:00
|
|
|
rm -rf $(CTLLOCKDIR)
|
2008-07-13 21:10:01 +02:00
|
|
|
rm -rf $(LOGDIR)
|
2007-12-02 02:03:18 +01:00
|
|
|
|
2004-05-17 22:36:41 +02:00
|
|
|
clean: clean-recursive clean-local
|
|
|
|
|
|
|
|
clean-local:
|
2008-10-27 13:19:06 +01:00
|
|
|
rm -f *.beam $(ERLSHLIBS) epam ejabberdctl.example
|
2005-12-22 15:48:01 +01:00
|
|
|
rm -f XmppAddr.asn1db XmppAddr.erl XmppAddr.hrl
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2004-05-17 22:36:41 +02:00
|
|
|
distclean: distclean-recursive clean-local
|
|
|
|
rm -f config.status
|
|
|
|
rm -f config.log
|
|
|
|
rm -f Makefile
|
2009-09-11 10:59:53 +02:00
|
|
|
[ ! -f ../ChangeLog ] || rm -f ../ChangeLog
|
2004-05-17 22:36:41 +02:00
|
|
|
|
2003-10-17 21:15:38 +02:00
|
|
|
TAGS:
|
|
|
|
etags *.erl
|
|
|
|
|
|
|
|
Makefile: Makefile.in
|
2007-05-29 16:31:12 +02:00
|
|
|
|
|
|
|
dialyzer: $(BEAMS)
|
|
|
|
@dialyzer -c .
|