alhafoudh
12/3/2013 - 1:58 AM

erlzmq-c_src-Makefile

LINUX=$(shell uname | grep Linux | wc -l | xargs echo)
DEPS=../deps

ifeq ($(LINUX),1)
ZMQ_FLAGS="--with-pgm=libpgm-5.2.122"
else
ZMQ_FLAGS="--with-pgm=libpgm-5.2.122"
endif

ifndef ZEROMQ_VERSION
ZEROMQ_VERSION=3.2.2
endif

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

clean:
	if test -e $(DEPS)/zeromq3/Makefile; then \
		cd $(DEPS)/zeromq3; make clean; \
	else \
		true; \
	fi

distclean:
	@rm -rf $(DEPS)

$(DEPS)/zeromq3:
	@mkdir -p $(DEPS)
	@curl http://download.zeromq.org/zeromq-$(ZEROMQ_VERSION).tar.gz -o $(DEPS)/zeromq-$(ZEROMQ_VERSION).tar.gz
	@cd $(DEPS) && tar xzvfp zeromq-$(ZEROMQ_VERSION).tar.gz && mv zeromq-$(ZEROMQ_VERSION) zeromq3 && curl https://openpgm.googlecode.com/files/libpgm-5.2.122.tar.gz > ./zeromq3/foreign/openpgm/libpgm-5.2.122.tar.gz && curl https://gist.githubusercontent.com/alhafoudh/7979717/raw | patch -p1 -d ./zeromq3/

$(DEPS)/zeromq3/src/.libs/libzmq.a: $(DEPS)/zeromq3
	@cd $(DEPS)/zeromq3 && ./configure $(ZMQ_FLAGS) && make