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
|
2005-12-06 20:32:50 +01:00
|
|
|
# make debug=true to compile Erlang module with debug informations.
|
|
|
|
ifdef debug
|
|
|
|
ERLC_FLAGS+=+debug_info
|
|
|
|
endif
|
|
|
|
|
2006-04-01 18:05:20 +02:00
|
|
|
ifdef ejabberd_debug
|
|
|
|
ERLC_FLAGS+=-Dejabberd_debug
|
|
|
|
endif
|
|
|
|
|
2005-12-11 20:48:31 +01:00
|
|
|
ifeq (@roster_gateway_workaround@, true)
|
|
|
|
ERLC_FLAGS+=-DROSTER_GATEWAY_WORKAROUND
|
|
|
|
endif
|
|
|
|
|
2007-07-31 14:05:00 +02:00
|
|
|
ifeq (@full_xml@, true)
|
|
|
|
ERLC_FLAGS+=-DFULL_XML_SUPPORT
|
|
|
|
endif
|
|
|
|
|
2007-09-14 16:16:36 +02:00
|
|
|
ifeq (@transient_supervisors@, false)
|
|
|
|
ERLC_FLAGS+=-DNO_TRANSIENT_SUPERVISORS
|
|
|
|
endif
|
|
|
|
|
2003-10-21 22:28:36 +02:00
|
|
|
prefix = @prefix@
|
|
|
|
|
2007-10-01 12:33:03 +02:00
|
|
|
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @mod_proxy65@ @eldap@ @pam@ @web@ stringprep @tls@ @odbc@ @ejabberd_zlib@
|
2003-10-17 21:15:38 +02:00
|
|
|
ERLSHLIBS = expat_erl.so
|
2005-12-11 20:48:31 +01:00
|
|
|
SOURCES = $(wildcard *.erl)
|
|
|
|
BEAMS = $(SOURCES:.erl=.beam)
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2006-02-02 17:59:38 +01:00
|
|
|
DESTDIR =
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2006-02-02 17:59:38 +01:00
|
|
|
EJABBERDDIR = $(DESTDIR)@prefix@/var/lib/ejabberd
|
2004-05-17 22:36:41 +02:00
|
|
|
BEAMDIR = $(EJABBERDDIR)/ebin
|
2003-10-21 22:28:36 +02:00
|
|
|
PRIVDIR = $(EJABBERDDIR)/priv
|
2004-05-17 22:36:41 +02:00
|
|
|
SODIR = $(PRIVDIR)/lib
|
2003-11-13 20:09:33 +01:00
|
|
|
MSGSDIR = $(PRIVDIR)/msgs
|
2006-02-02 17:59:38 +01:00
|
|
|
LOGDIR = $(DESTDIR)@prefix@/var/log/ejabberd
|
|
|
|
ETCDIR = $(DESTDIR)@prefix@/etc/ejabberd
|
2007-06-25 14:09:43 +02:00
|
|
|
SBINDIR = $(DESTDIR)@prefix@/sbin
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2006-08-28 16:56:13 +02:00
|
|
|
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
|
|
|
|
|
2004-05-17 22:36:41 +02:00
|
|
|
all: $(ERLSHLIBS) compile-beam all-recursive
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2005-12-11 20:48:31 +01:00
|
|
|
compile-beam: XmppAddr.hrl $(BEAMS)
|
|
|
|
|
|
|
|
%.beam: %.erl
|
|
|
|
@ERLC@ -W $(ERLC_FLAGS) $<
|
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) $<
|
2007-05-29 16:31:12 +02:00
|
|
|
@ERLC@ -W $(ERLC_FLAGS) $*.erl
|
2005-11-17 06:29:33 +01:00
|
|
|
|
2003-10-18 21:15:12 +02:00
|
|
|
$(ERLSHLIBS): %.so: %.c
|
2004-08-05 22:46:24 +02:00
|
|
|
gcc -Wall $(CFLAGS) $(LDFLAGS) $(LIBS) \
|
2003-10-17 21:15:38 +02:00
|
|
|
$(subst ../,,$(subst .so,.c,$@)) \
|
2004-09-26 22:46:43 +02:00
|
|
|
$(EXPAT_LIBS) $(EXPAT_CFLAGS) \
|
|
|
|
$(ERLANG_LIBS) $(ERLANG_CFLAGS) \
|
2006-08-28 16:56:13 +02:00
|
|
|
-o $@ $(DYNAMIC_LIB_CFLAGS)
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2003-10-21 22:28:36 +02:00
|
|
|
install: all
|
2004-05-17 22:36:41 +02:00
|
|
|
install -d $(BEAMDIR)
|
|
|
|
install -m 644 *.beam $(BEAMDIR)
|
|
|
|
rm -f $(BEAMDIR)/configure.beam
|
|
|
|
install -m 644 *.app $(BEAMDIR)
|
|
|
|
install -d $(SODIR)
|
|
|
|
install -m 644 *.so $(SODIR)
|
2007-10-17 04:33:19 +02:00
|
|
|
-install -m 750 epam $(SODIR)
|
2004-05-17 22:36:41 +02:00
|
|
|
install -d $(MSGSDIR)
|
|
|
|
install -m 644 msgs/*.msg $(MSGSDIR)
|
2004-07-06 23:34:50 +02:00
|
|
|
install -d $(ETCDIR)
|
2007-04-30 09:08:01 +02:00
|
|
|
[ -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
|
2007-05-21 05:41:13 +02:00
|
|
|
sed -e "s*@rootdir@*@prefix@*" ejabberdctl.template > ejabberdctl.example
|
2007-10-17 04:33:19 +02:00
|
|
|
[ -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 ejabberd.inetrc $(ETCDIR)/ejabberd.inetrc
|
2007-06-25 14:09:43 +02:00
|
|
|
install -d $(SBINDIR)
|
|
|
|
install -m 755 ejabberdctl.example $(SBINDIR)/ejabberdctl
|
2004-07-06 23:34:50 +02:00
|
|
|
install -d $(LOGDIR)
|
2004-05-17 22:36:41 +02:00
|
|
|
|
|
|
|
clean: clean-recursive clean-local
|
|
|
|
|
|
|
|
clean-local:
|
2007-10-01 12:33:03 +02:00
|
|
|
rm -f *.beam $(ERLSHLIBS) epam
|
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
|
|
|
|
|
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 .
|
|
|
|
|