aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-08-07 19:33:03 +0200
committerHarald Welte <laforge@gnumonks.org>2010-08-07 19:33:03 +0200
commit55497ba30c5b1f3ff43316b5b84db8bed83e0a32 (patch)
tree653efcf66339f6e3d39fbc3fcecabf361f5a0483
parentaed61bf02a01737be51f8f45769c3db349f6c9d8 (diff)
Add Makefile.otp and Emakefile for erlang build systemHEADmaster
-rw-r--r--Emakefile6
-rw-r--r--Makefile.otp31
2 files changed, 37 insertions, 0 deletions
diff --git a/Emakefile b/Emakefile
new file mode 100644
index 0000000..4ef79bb
--- /dev/null
+++ b/Emakefile
@@ -0,0 +1,6 @@
+{["src/*"],
+ [{i, "include"},
+ {outdir, "ebin"},
+ debug_info]
+}.
+
diff --git a/Makefile.otp b/Makefile.otp
new file mode 100644
index 0000000..bcd0c33
--- /dev/null
+++ b/Makefile.otp
@@ -0,0 +1,31 @@
+
+ERL=erl
+APP=epcap
+
+CC=gcc
+
+ERL_LIB=/usr/local/lib/erlang/lib/erl_interface-3.7
+#ARCH=-m32
+CFLAGS=-g -Wall
+CPPFLAGS=-I$(ERL_LIB)/include
+LDFLAGS=-L$(ERL_LIB)/lib -lpcap -lerl_interface -lei -lpthread
+
+
+all: dir erl sccp_node
+
+dir:
+ -@mkdir -p priv/tmp ebin
+
+erl:
+ @$(ERL) -noinput +B \
+ -eval 'case make:all() of up_to_date -> halt(0); error -> halt(1) end.'
+
+sccp_node: c_src/sccp_node
+ @mv $^ priv/
+
+%.o: c_src/%.c
+ $(CC) $(ARCH) $(CFLAGS) $(CPPFLAGS) -o c_src/$@ -c $<
+
+clean:
+ @rm -fv ebin/*.beam c_src/*.o
+