forked from GerHobbelt/docco
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (44 loc) · 1.38 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
63
64
65
66
67
68
# ** TOOLS **
# 'cake' is not 'cake' on Ubuntu but 'cake.coffeescript'.
# Anyhow, we are now using a local (modern!) install of Cake, so the problem is moot.
#CAKE=cake.coffeescript
CAKE=node_modules/.bin/cake
COFFEE=node_modules/.bin/coffee
# linear | parallel | pretty | plain-markdown | classic
TEMPLATE=parallel
# ** COMMON DEPENDENCIES **
SRC_DEPS= \
Makefile \
Cakefile \
package.json \
docco.litcoffee
TOOL_DEPS= \
$(CAKE) \
$(COFFEE)
# ** MAIN BUILD TARGETS **
.PHONY: all install build doc loc clean
all: build doc loc
install: build doc loc
$(CAKE) install
build: docco.js
doc: index.html
loc: $(SRC_DEPS) $(TOOL_DEPS)
$(CAKE) loc
clean:
-rm index.html
-rm docco.js
superclean: clean
-rm -rf node_modules
# ** ASSISTANT/SUBSERVIENT BUILD TARGETS **
docco.js: $(SRC_DEPS) $(TOOL_DEPS)
$(COFFEE) -c docco.litcoffee
#$(CAKE) build
index.html: $(SRC_DEPS) $(TOOL_DEPS)
bin/docco --layout $(TEMPLATE) docco.litcoffee
sed -e 's/docco.css/resources\/$(TEMPLATE)\/docco.css/g' < docs/docco.litcoffee.html > index.html
rm -rf docs
#$(CAKE) doc
# did 'npm install' run before?
$(TOOL_DEPS):
@echo "*** Installing NodeJS / Cake dependencies for Docco ***"
npm install