-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
59 lines (41 loc) · 1.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
MARKDOWN_SOURCES=$(wildcard doc/*.md)
MARKDOWN_TARGETS=$(patsubst doc/%.md,doc/html/%.html,$(MARKDOWN_SOURCES))
HTML_SOURCES=$(wildcard priv/www/*.html)
HTML_TARGETS=$(patsubst priv/www/%.html,priv/www/standalone/%.html,$(HTML_SOURCES))
all: ebin
(cd src;$(MAKE))
java:
(cd priv/java;$(MAKE))
standalone: priv/www/standalone $(HTML_TARGETS)
priv/www/standalone/%.html: priv/www/%.html
priv/tools/onefile.pl $< > $@
priv/www/standalone:
mkdir -p priv/www/standalone
docs: erlang-docs html-docs
erlang-docs: doc/edoc
(cd src;$(MAKE) docs)
html-docs: doc/html $(MARKDOWN_TARGETS)
doc/edoc:
mkdir -p doc/edoc
doc/html:
mkdir -p doc/html
doc/html/%.html: doc/%.md
(title=`grep '^# ' $< | head -1 | sed -e 's:^# ::'` ;\
t=/tmp/$*.md ;\
sed -e "s:@TITLE@:$$title:g" < doc/header.html > $@ ;\
python doc/buildtoc.py < $< > $$t ;\
markdown $$t >> $@ ;\
rm $$t ;\
cat doc/footer.html >> $@)
ebin:
mkdir -p ebin
clean: clean-docs clean-standalone
(cd src;$(MAKE) clean)
(cd priv/java;$(MAKE) clean)
clean-docs: clean-html
rm -rf doc/edoc
clean-html:
rm -rf doc/html
clean-standalone:
rm -rf priv/www/standalone
distclean: clean