Skip to content

Commit

Permalink
Merge pull request zeromq#10 from kevsmith/build_cleanup
Browse files Browse the repository at this point in the history
Freshened up build to work via rebar only
  • Loading branch information
yrashk committed Jun 12, 2011
2 parents 152e218 + 4122ef0 commit d0b50df
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 29 deletions.
38 changes: 10 additions & 28 deletions Makefile
@@ -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
@@ -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
@@ -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"}]}.

0 comments on commit d0b50df

Please sign in to comment.