Skip to content
This repository
Browse code

Freshened up build to work via rebar only:

* Updated rebar version
* Added pre/post build hooks to handle building ZeroMQ
* Added c_src/Makefile to modularize build
  • Loading branch information...
commit 2b57f69c646f1eb9fe8455cb5504534ffb382d16 1 parent b6a6abf
Kevin Smith kevsmith authored
38 Makefile
... ... @@ -1,42 +1,24 @@
1   -LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
  1 +all: compile
2 2
3   -
4   -ifeq ($(LINUX),1)
5   -ZMQ_FLAGS=--with-pic
6   -else
7   -ZMQ_FLAGS=
8   -endif
9   -
10   -ifndef ZEROMQ_VERSION
11   -ZEROMQ_VERSION=v2.1.7
12   -endif
13   -
14   -all: perf
15   -
16   -deps/zeromq2:
17   - @mkdir -p deps
18   - @git clone git://github.com/zeromq/zeromq2-1.git deps/zeromq2
19   - @echo $(ZEROMQ_VERSION)
20   - @cd deps/zeromq2 && git checkout $(ZEROMQ_VERSION)
21   -
22   -deps/zeromq2/src/.libs/libzmq.a: deps/zeromq2
23   - @cd deps/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
24   -
25   -dependencies: deps/zeromq2/src/.libs/libzmq.a
26   -
27   -compile: dependencies
  3 +compile:
28 4 @./rebar compile
29 5
30   -perf: compile
  6 +perftest: compile
31 7 @cd perf && erlc erlzmq_perf.erl
32 8
  9 +clean:
  10 + @./rebar clean
  11 +
  12 +distclean: clean
  13 + @cd c_src;make distclean
  14 +
33 15 test: compile
34 16 @./rebar eunit
35 17
36 18 docs:
37 19 @./rebar doc
38 20
39   -bench: perf
  21 +bench: perftest
40 22 @echo 'Running benchmarks, this could take some time...'
41 23 @mkdir -p graphs
42 24 @./perf/perfgraphs.py
29 c_src/Makefile
... ... @@ -0,0 +1,29 @@
  1 +LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
  2 +
  3 +
  4 +ifeq ($(LINUX),1)
  5 +ZMQ_FLAGS=--with-pic
  6 +else
  7 +ZMQ_FLAGS=
  8 +endif
  9 +
  10 +ifndef ZEROMQ_VERSION
  11 +ZEROMQ_VERSION=v2.1.7
  12 +endif
  13 +
  14 +all: deps/zeromq2/src/.libs/libzmq.a
  15 +
  16 +clean:
  17 + @cd deps/zeromq2; make clean
  18 +
  19 +distclean:
  20 + @rm -rf deps
  21 +
  22 +deps/zeromq2:
  23 + @mkdir -p deps
  24 + @git clone git://github.com/zeromq/zeromq2-1.git deps/zeromq2
  25 + @echo $(ZEROMQ_VERSION)
  26 + @cd deps/zeromq2 && git checkout $(ZEROMQ_VERSION)
  27 +
  28 +deps/zeromq2/src/.libs/libzmq.a: deps/zeromq2
  29 + @cd deps/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
BIN  rebar
Binary file not shown
11 rebar.config
... ... @@ -1,4 +1,9 @@
  1 +{erl_opts, [debug_info, warnings_as_errors]}.
  2 +
1 3 {port_envs,
2   - [{"DRV_LDFLAGS","deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++ -luuid"},
3   - {"darwin", "DRV_LDFLAGS", "deps/zeromq2/src/.libs/libzmq.a -bundle -flat_namespace -undefined suppress $ERL_LDFLAGS"},
4   - {"DRV_CFLAGS","-Ic_src -Ideps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}.
  4 + [{"DRV_LDFLAGS","c_src/deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++ -luuid"},
  5 + {"darwin", "DRV_LDFLAGS", "c_src/deps/zeromq2/src/.libs/libzmq.a -bundle -flat_namespace -undefined suppress $ERL_LDFLAGS"},
  6 + {"DRV_CFLAGS","-Ic_src -Ic_src/deps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}.
  7 +
  8 +{pre_hooks,[{compile,"make -C c_src"},
  9 + {clean, "make -C c_src clean"}]}.

0 comments on commit 2b57f69

Please sign in to comment.
Something went wrong with that request. Please try again.