2004-08-05 22:46:24 +02:00
|
|
|
# $Id$
|
|
|
|
|
|
|
|
CC = @CC@
|
2007-11-29 17:59:35 +01:00
|
|
|
CFLAGS = @CFLAGS@
|
2004-08-05 22:46:24 +02:00
|
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
LDFLAGS = @LDFLAGS@
|
2007-11-29 17:59:35 +01:00
|
|
|
LIBS = @LIBS@
|
|
|
|
|
|
|
|
SSL_CFLAGS = @SSL_CFLAGS@
|
|
|
|
SSL_LIBS = @SSL_LIBS@
|
|
|
|
|
|
|
|
ERLANG_CFLAGS = @ERLANG_CFLAGS@
|
|
|
|
ERLANG_LIBS = @ERLANG_LIBS@
|
2004-08-05 22:46:24 +02:00
|
|
|
|
2009-03-07 10:52:26 +01:00
|
|
|
# Assume Linux-style dynamic library flags
|
|
|
|
DYNAMIC_LIB_CFLAGS = -fpic -shared
|
2006-08-28 16:56:13 +02:00
|
|
|
ifeq ($(shell uname),Darwin)
|
2009-03-07 10:52:26 +01:00
|
|
|
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
|
|
|
|
|
2010-07-09 20:02:29 +02:00
|
|
|
EFLAGS += @ERLANG_SSLVER@
|
2008-07-16 18:58:42 +02:00
|
|
|
EFLAGS += -I ..
|
2008-07-13 21:10:01 +02:00
|
|
|
EFLAGS += -pz ..
|
|
|
|
|
2007-05-29 16:31:12 +02: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
|
2007-05-29 16:31:12 +02:00
|
|
|
endif
|
|
|
|
|
2010-08-07 14:04:57 +02:00
|
|
|
ifeq (@md2@, true)
|
|
|
|
EFLAGS+=-DHAVE_MD2
|
|
|
|
ERLANG_CFLAGS += -DHAVE_MD2
|
|
|
|
endif
|
|
|
|
|
2010-06-21 18:30:16 +02:00
|
|
|
ERLSHLIBS = ../tls_drv.so ../sha_drv.so
|
2007-12-17 19:59:51 +01:00
|
|
|
OUTDIR = ..
|
|
|
|
SOURCES = $(wildcard *.erl)
|
|
|
|
BEAMS = $(addprefix $(OUTDIR)/,$(SOURCES:.erl=.beam))
|
|
|
|
|
2004-08-05 22:46:24 +02:00
|
|
|
|
2007-12-17 19:59:51 +01:00
|
|
|
all: $(BEAMS) $(ERLSHLIBS)
|
2004-08-05 22:46:24 +02:00
|
|
|
|
|
|
|
$(OUTDIR)/%.beam: %.erl
|
2004-11-05 22:14:31 +01:00
|
|
|
@ERLC@ -W $(EFLAGS) -o $(OUTDIR) $<
|
2004-08-05 22:46:24 +02:00
|
|
|
|
|
|
|
#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) \
|
|
|
|
$(SSL_LIBS) \
|
|
|
|
$(SSL_CFLAGS) \
|
|
|
|
$(ERLANG_LIBS) \
|
|
|
|
$(ERLANG_CFLAGS) \
|
|
|
|
-o $@ \
|
|
|
|
$(DYNAMIC_LIB_CFLAGS)
|
2004-08-05 22:46:24 +02:00
|
|
|
|
|
|
|
clean:
|
2007-12-17 19:59:51 +01:00
|
|
|
rm -f $(BEAMS) $(ERLSHLIBS)
|
2004-08-05 22:46:24 +02:00
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
rm -f Makefile
|
|
|
|
|
|
|
|
TAGS:
|
|
|
|
etags *.erl
|