-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
62 lines (48 loc) · 1.78 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
60
61
62
###-----------------------------------------------------------------------------
### APPLICATION LAYOUT
###-----------------------------------------------------------------------------
APPNAME = oserl
ERLS = $(patsubst src/%.erl,%.erl,$(wildcard src/*.erl))
MODS = $(subst $(space),$(comma)$(space),$(ERLS:.erl=))
DOCS = $(patsubst doc/%.ndoc,%.ndoc,$(wildcard doc/*.ndoc))
MANS = $(DOCS:.ndoc=.3)
HTMS = $(DOCS:.ndoc=.html)
TEXS = $(DOCS:.ndoc=.tex)
PDFS = $(DOCS:.ndoc=.pdf)
### Dependecy Search Paths
VPATH = src:include:ebin:doc
.PHONY: compile clean clobber doc
.SUFFIXES: .erl .hrl .beam .app.src .app .rel .ndoc
###-----------------------------------------------------------------------------
### TARGETS
###-----------------------------------------------------------------------------
all: deps compile
compile:
./rebar compile
deps:
./rebar get-deps
clean:
./rebar clean
clobber: clean
@$(RM) -R doc/html
@$(RM) -R doc/man
@$(RM) -R doc/pdf
doc: man html pdf
man: $(MANS)
@$(MV) doc/man/$(APPNAME)_overview.3 doc/man/$(APPNAME).1
html: $(HTMS)
@$(MV) doc/html/$(APPNAME)_overview.html doc/html/index.html
pdf: $(PDFS)
## Rules
%.3: %.ndoc
@$(CD) doc; $(SED) "s|%MODULES%|`echo $(MODS)`|g" ../$^ | \
$(SED) "s|%VSN%|$(VSN)|g" | $(SED) "s|%APPLICATION%|$(APPNAME)|g" | \
$(ERLDOC) -i - -t man --no-toc --erl -o man/$@; $(CD) ..
%.html: %.ndoc
@$(CD) doc; $(SED) "s|%MODULES%|`echo $(MODS)`|g" ../$^ | \
$(SED) "s|%VSN%|$(VSN)|g" | $(SED) "s|%APPLICATION%|$(APPNAME)|g" | \
$(ERLDOC) -i - -t xhtml --erl -o html/$@; $(CD) ..
%.pdf: %.ndoc
@$(CD) doc; $(SED) "s|%MODULES%|`echo $(MODS)`|g" ../$^ | \
$(SED) "s|%VSN%|$(VSN)|g" | $(SED) "s|%APPLICATION%|$(APPNAME)|g" | \
$(ERLDOC) -i - -t pdf --no-toc --erl -o pdf/$@; $(CD) ..