Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 105 lines (76 sloc) 2.69 kB
f6c04bb @assaf Switching from Vows to Mocha.
authored
1 default : test
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
2 .PHONY : build clean publish setup test
f6c04bb @assaf Switching from Vows to Mocha.
authored
3
4
5 # Setup everything
6 setup :
7 npm install
8
72b095d @assaf Added code coverage report.
authored
9 # CoffeeScript to JavaScript
d46910a @assaf Fix annotated source code not showing on site.
authored
10 build :
72b095d @assaf Added code coverage report.
authored
11 coffee -b -c -l -o lib/zombie lib/zombie/*.coffee
12
f6c04bb @assaf Switching from Vows to Mocha.
authored
13 # Run test suite
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
14 test : setup
9f6eef3 @assaf Spec files must end with _spec
authored
15 npm test
2e56750 @assaf Switched to using Makefile
authored
16
17
72b095d @assaf Added code coverage report.
authored
18 # Run coverage report
7fdffb1 @assaf Fixed Makefile creating empty HTML directory
authored
19 coverage : setup lib-cov html
72b095d @assaf Added code coverage report.
authored
20 env LIB_PATH=lib-cov mocha -R html-cov > html/coverage.html
21 echo open html/coverage.html
22
23 lib-cov : build
24 jscoverage --no-highlight lib lib-cov
25
26 html/coverage.html :
27 if [ `which jscoverage` ] ; then make coverage ; fi
28
29
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
30 # Remove temporary files
31 clean :
32 rm -rf html man7
33 rm -f lib/zombie/*.js
72b095d @assaf Added code coverage report.
authored
34 rm -rf lib-cov
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
35
36
2e56750 @assaf Switched to using Makefile
authored
37 # Documentation consists of Markdown files converted to HTML, CSS/images copied over, annotated source code and PDF.
38 doc : html html/source html/zombie.pdf
39
40 html/index.html : README.md doc/layout/main.html
41 mkdir -p html
42 coffee doc/render.coffee $< $@
43
44 html/changelog.html : CHANGELOG.md doc/layout/main.html
45 mkdir -p html
46 coffee doc/render.coffee $< $@
47
48 html/%.html : doc/%.md doc/layout/main.html
49 mkdir -p html
50 coffee doc/render.coffee $< $@
51
52 html : $(foreach file,$(wildcard doc/*.md),html/$(notdir $(basename $(file))).html) html/index.html html/changelog.html
53 mkdir -p html
54 cp -fr doc/css doc/images html/
55
56 html/source : lib/**/*.coffee
57 @echo "Documenting source files ..."
58 docco lib/**/*.coffee
59 mkdir -p html
60 mv docs html/source
61
62 html/zombie.pdf : html/*.html
63 @echo "Generating PDF documentation ..."
64 wkhtmltopdf \
65 --disable-javascript --outline --print-media-type --title Zombie.js --header-html doc/layout/header.html --allow doc/images \
66 --margin-left 30 --margin-right 30 --margin-top 30 --margin-bottom 30 --header-spacing 5 \
67 cover doc/layout/cover.html toc --disable-dotted-lines \
68 html/index.html html/api.html html/selectors.html html/troubleshoot.html \
69 html/zombie.pdf
70
71
72 # Man pages.
73 man7 : $(foreach file,$(wildcard doc/*.md),man7/zombie-$(notdir $(basename $(file))).7) man7/zombie.7 man7/zombie-changelog.7
74 mkdir -p man7
75
76 man7/zombie.7 : README.md
77 mkdir -p man7
78 ronn --roff $< > $@
79
80 man7/zombie-changelog.7 : README.md
81 mkdir -p man7
82 ronn --roff $< > $@
83
84 man7/zombie-%.7 : doc/%.md
85 mkdir -p man7
86 ronn --roff $< > $@
87
88
89 # Get version number from package.json, need this for tagging.
90 version = $(shell node -e "console.log(JSON.parse(require('fs').readFileSync('package.json')).version)")
91
92 # Publish site only.
d46910a @assaf Fix annotated source code not showing on site.
authored
93 publish-docs : clean html html/source html/zombie.pdf html/coverage.html
2e56750 @assaf Switched to using Makefile
authored
94 @echo "Uploading documentation ..."
95 rsync -chr --del --stats html/ labnotes.org:/var/www/zombie/
96
97 # npm publish, public-docs and tag
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
98 publish : build doc man7
2e56750 @assaf Switched to using Makefile
authored
99 npm publish
864d6c8 @assaf Precompile CoffeeScript and published JavaScript files.
authored
100 git push
2e56750 @assaf Switched to using Makefile
authored
101 git tag v$(version)
102 git push --tags origin master
7fdffb1 @assaf Fixed Makefile creating empty HTML directory
authored
103 make publish-docs clean
2e56750 @assaf Switched to using Makefile
authored
104
Something went wrong with that request. Please try again.