Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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