Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 10 additions & 28 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,24 @@
LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
all: compile


ifeq ($(LINUX),1)
ZMQ_FLAGS=--with-pic
else
ZMQ_FLAGS=
endif

ifndef ZEROMQ_VERSION
ZEROMQ_VERSION=v2.1.7
endif

all: perf

deps/zeromq2:
@mkdir -p deps
@git clone git://github.com/zeromq/zeromq2-1.git deps/zeromq2
@echo $(ZEROMQ_VERSION)
@cd deps/zeromq2 && git checkout $(ZEROMQ_VERSION)

deps/zeromq2/src/.libs/libzmq.a: deps/zeromq2
@cd deps/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make

dependencies: deps/zeromq2/src/.libs/libzmq.a

compile: dependencies
compile:
@./rebar compile

perf: compile
perftest: compile
@cd perf && erlc erlzmq_perf.erl

clean:
@./rebar clean

distclean: clean
@cd c_src;make distclean

test: compile
@./rebar eunit

docs:
@./rebar doc

bench: perf
bench: perftest
@echo 'Running benchmarks, this could take some time...'
@mkdir -p graphs
@./perf/perfgraphs.py
Expand Down
29 changes: 29 additions & 0 deletions c_src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
DEPS=../deps

ifeq ($(LINUX),1)
ZMQ_FLAGS=--with-pic
else
ZMQ_FLAGS=
endif

ifndef ZEROMQ_VERSION
ZEROMQ_VERSION=v2.1.7
endif

all: $(DEPS)/zeromq2/src/.libs/libzmq.a

clean:
@cd $(DEPS)/zeromq2; make clean

distclean:
@rm -rf $(DEPS)

$(DEPS)/zeromq2:
@mkdir $(DEPS)
@git clone git://github.com/zeromq/zeromq2-1.git $(DEPS)/zeromq2
@echo $(ZEROMQ_VERSION)
@cd $(DEPS)/zeromq2 && git checkout $(ZEROMQ_VERSION)

$(DEPS)/zeromq2/src/.libs/libzmq.a: $(DEPS)/zeromq2
@cd $(DEPS)/zeromq2 && ./autogen.sh && ./configure $(ZMQ_FLAGS) && make
Binary file modified rebar
Binary file not shown.
7 changes: 6 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{erl_opts, [debug_info, warnings_as_errors]}.

{port_envs,
[{"DRV_LDFLAGS","deps/zeromq2/src/.libs/libzmq.a -shared $ERL_LDFLAGS -lstdc++ -luuid"},
{"darwin", "DRV_LDFLAGS", "deps/zeromq2/src/.libs/libzmq.a -bundle -flat_namespace -undefined suppress $ERL_LDFLAGS"},
{"DRV_CFLAGS","-Ic_src -Ideps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}.
{"DRV_CFLAGS","-Ic_src -Ideps/zeromq2/include -g -Wall -fPIC $ERL_CFLAGS"}]}.

{pre_hooks,[{compile,"make -C c_src"},
{clean, "make -C c_src clean"}]}.