Permalink
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (42 sloc) 1.19 KB
# -*- makefile-gmake -*-
DOC_DIR=doc
VERSION=0.0.1
EJABBERD_INCLUDE_DIR=/usr/lib/ejabberd/include
CANONICAL_RABBIT_HEADER=../rabbitmq-server/include/rabbit.hrl
WIDTH=1024
#WIDTH=800
DPI=$(shell echo '90 * $(WIDTH) / 1024' | bc)
ifeq ($(shell uname -s),Darwin)
SED=gsed
else
SED=sed
endif
all: check_rabbit_hrl mod_rabbitmq.beam
check_rabbit_hrl:
@if [ -e $(CANONICAL_RABBIT_HEADER) ]; then diff -q $(CANONICAL_RABBIT_HEADER) src/rabbit.hrl; else echo Skipping rabbit.hrl check because $(CANONICAL_RABBIT_HEADER) does not exist; fi
clean:
rm -f mod_rabbitmq.beam
rm -f build-stamp install-stamp
clean-doc:
rm -rf doc/*
doc:
mkdir ./doc
.PHONY: documentation
documentation: \
doc/overview.edoc \
doc/xmpp-amqp-gateway.png \
doc/whole-network-1.png \
doc/whole-network-2.png
$(MAKE) doc
erl -noshell \
-eval 'edoc:application(mod_rabbitmq, ".", [])' \
-run init stop
$(SED) -e 's:\(<p><i>Generated by EDoc\), .*\(</i></p>\):\1\2:' -i doc/*.html
doc/overview.edoc: src/overview.edoc.in
$(MAKE) doc
$(SED) -e 's:%%VERSION%%:$(VERSION):g' < $< > $@
doc/%.png: src/%.svg
inkscape --export-dpi=$(DPI) --export-png=$@ $<
%.beam: src/%.erl
erlc -I $(EJABBERD_INCLUDE_DIR) $<
distclean: clean