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
|
|
|
|
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
|
|
|
|
|
2003-10-21 22:28:36 +02:00
|
|
|
prefix = @prefix@
|
|
|
|
|
2006-01-19 03:17:31 +01:00
|
|
|
SUBDIRS = @mod_irc@ @mod_pubsub@ @mod_muc@ @eldap@ @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
|
2003-10-21 22:28:36 +02:00
|
|
|
|
2005-11-17 06:29:33 +01:00
|
|
|
ASN_FLAGS = -bber_bin +der +compact_bit_string +optimize +noobj
|
|
|
|
|
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) $<
|
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)
|
|
|
|
install -d $(MSGSDIR)
|
|
|
|
install -m 644 msgs/*.msg $(MSGSDIR)
|
2004-07-06 23:34:50 +02:00
|
|
|
install -d $(ETCDIR)
|
|
|
|
install -b -m 644 ejabberd.cfg.example $(ETCDIR)/ejabberd.cfg
|
|
|
|
install -d $(LOGDIR)
|
2004-05-17 22:36:41 +02:00
|
|
|
|
|
|
|
clean: clean-recursive clean-local
|
|
|
|
|
|
|
|
clean-local:
|
2003-10-17 21:15:38 +02:00
|
|
|
rm -f *.beam $(ERLSHLIBS)
|
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
|