2006-01-19 03:17:31 +01:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
CC = @CC@
|
2007-11-29 17:59:35 +01:00
|
|
|
CFLAGS = @CFLAGS@
|
2006-01-19 03:17:31 +01:00
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
2007-11-29 17:59:35 +01:00
|
|
|
LIBS = @LIBS@
|
|
|
|
|
|
|
|
ZLIB_CFLAGS = @ZLIB_CFLAGS@
|
|
|
|
ZLIB_LIBS = @ZLIB_LIBS@
|
|
|
|
|
|
|
|
ERLANG_CFLAGS = @ERLANG_CFLAGS@
|
|
|
|
ERLANG_LIBS = @ERLANG_LIBS@
|
2006-01-19 03:17:31 +01:00
|
|
|
|
2006-08-28 16:56:13 +02:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2007-12-17 19:59:51 +01:00
|
|
|
DYNAMIC_LIB_CFLAGS = -fPIC -bundle -flat_namespace -undefined suppress
|
2006-08-28 16:56:13 +02:00
|
|
|
else
|
2007-12-17 19:59:51 +01:00
|
|
|
# Assume Linux-style dynamic library flags
|
|
|
|
DYNAMIC_LIB_CFLAGS = -fpic -shared
|
2006-08-28 16:56:13 +02:00
|
|
|
endif
|
|
|
|
|
2008-07-17 17:33:50 +02:00
|
|
|
EFLAGS += -I ..
|
2008-07-15 10:45:05 +02:00
|
|
|
EFLAGS += -pz ..
|
2008-07-17 17:33:50 +02:00
|
|
|
|
2007-05-29 16:31:12 +02:00
|
|
|
# make debug=true to compile Erlang module with debug informations.
|
|
|
|
ifdef debug
|
2007-12-17 19:59:51 +01:00
|
|
|
EFLAGS+=+debug_info
|
2007-05-29 16:31:12 +02:00
|
|
|
endif
|
|
|
|
|
2007-12-17 19:59:51 +01:00
|
|
|
ERLSHLIBS = ../ejabberd_zlib_drv.so
|
|
|
|
OUTDIR = ..
|
|
|
|
SOURCES = $(wildcard *.erl)
|
|
|
|
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
2006-01-19 03:17:31 +01:00
|
|
|
|
2007-12-17 19:59:51 +01:00
|
|
|
all: $(BEAMS) $(ERLSHLIBS)
|
2006-01-19 03:17:31 +01:00
|
|
|
|
|
|
|
$(OUTDIR)/%.beam: %.erl
|
|
|
|
@ERLC@ -W $(EFLAGS) -o $(OUTDIR) $<
|
|
|
|
|
|
|
|
#all: $(ERLSHLIBS)
|
|
|
|
# erl -s make all report "{outdir, \"..\"}" -noinput -s erlang halt
|
|
|
|
|
|
|
|
$(ERLSHLIBS): ../%.so: %.c
|
2008-04-11 19:32:20 +02:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \
|
|
|
|
$(subst ../,,$(subst .so,.c,$@)) \
|
|
|
|
$(LIBS) \
|
|
|
|
$(ZLIB_LIBS) \
|
|
|
|
$(ZLIB_CFLAGS) \
|
|
|
|
$(ERLANG_LIBS) \
|
|
|
|
$(ERLANG_CFLAGS) \
|
|
|
|
-o $@ \
|
|
|
|
$(DYNAMIC_LIB_CFLAGS)
|
2006-01-19 03:17:31 +01:00
|
|
|
|
|
|
|
clean:
|
2007-12-17 19:59:51 +01:00
|
|
|
rm -f $(BEAMS) $(ERLSHLIBS)
|
2006-01-19 03:17:31 +01:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f Makefile
|
|
|
|
|
|
|
|
TAGS:
|
|
|
|
etags *.erl
|