hop-2012/server/Makefile

65 lines
1.5 KiB
Makefile
Raw Normal View History

2012-05-01 21:36:38 +00:00
APP=hop_server
2012-04-29 23:41:04 +00:00
TEMPLATES=$(wildcard web/bootstrap/templates/*.xml)
HTML=$(subst web/bootstrap/templates/,web/,$(subst .xml,.html,$(TEMPLATES)))
2012-01-08 17:41:04 +00:00
2012-05-05 22:18:23 +00:00
# Augment the path ocamlfind uses to discover installed packages.
OCAMLPATH=$(CURDIR)/thirdparty/_dist
export OCAMLPATH
LWT_SRC_DIR=thirdparty/lwt-2.3.2
all: \
thirdparty/_dist \
message.ml amqp_spec.ml \
$(APP).native \
webpages
thirdparty/_dist:
mkdir -p $@
(mkdir $@/lwt && \
(cd $(LWT_SRC_DIR) && \
2012-05-05 23:18:13 +00:00
./configure && \
2012-05-05 22:18:23 +00:00
make && \
OCAMLFIND_LDCONF=ignore \
OCAMLFIND_DESTDIR="$(CURDIR)/$@" \
make install))
2012-04-29 23:41:04 +00:00
webpages: $(HTML) web/bootstrap/css/bootstrap.css
2012-04-29 20:31:29 +00:00
web/bootstrap/css/bootstrap.css: web/bootstrap/less/*.less
recess --compile web/bootstrap/less/bootstrap.less > $@
2012-01-08 17:41:04 +00:00
2012-04-29 23:41:04 +00:00
web/%.html: web/bootstrap/templates/%.xml web/bootstrap/template.xsl web/bootstrap/nav.xml
xsltproc web/bootstrap/template.xsl $< > $@
message.ml: ../protocol/messages.json codegen.py
2012-01-08 17:41:04 +00:00
python codegen.py > $@
amqp_spec.ml: amqp0-9-1.stripped.xml amqp_codegen.py
python amqp_codegen.py > $@
2012-04-29 23:41:04 +00:00
webclean:
rm -f $(HTML)
clean: webclean
2012-01-08 17:41:04 +00:00
ocamlbuild -clean
rm -f message.ml
rm -f amqp_spec.ml
2012-01-08 17:41:04 +00:00
2012-05-05 22:18:23 +00:00
thirdpartyclean:
rm -rf thirdparty/_dist
rm -rf $(LWT_SRC_DIR)/_build
rm -f $(LWT_SRC_DIR)/setup.data
rm -f $(LWT_SRC_DIR)/setup.log
rm -f $(LWT_SRC_DIR)/src/unix/lwt_config.h
rm -f $(LWT_SRC_DIR)/src/unix/lwt_config.ml
veryclean: clean thirdpartyclean
2012-04-29 20:31:29 +00:00
rm -f web/bootstrap/css/bootstrap.css
2012-01-08 17:41:04 +00:00
$(APP).native: $(wildcard *.ml)
2012-05-08 20:52:08 +00:00
ocamlbuild -use-ocamlfind -X thirdparty -X scratch $@
2012-01-08 17:41:04 +00:00
run: all
./$(APP).native