Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 104 lines (81 sloc) 3.081 kb
64b4d65 explicitly set bash as the shell since the makefile uses bash-isms
gflarity authored
1 SHELL = bash
2
de338f9 @isaacs Support subfolders in the man/doc files
isaacs authored
3 docs = $(shell find doc -name '*.md' \
4 |sed 's|.md|.1|g' \
0e151fc @isaacs build submodules in make process
isaacs authored
5 |sed 's|doc/|man1/|g' )
6
30818ab @isaacs html docs
isaacs authored
7 htmldocs = $(shell find doc -name '*.md' \
8 |sed 's|.md|.html|g' \
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
9 |sed 's|doc/|html/doc/|g' ) html/doc/README.html
30818ab @isaacs html docs
isaacs authored
10
de338f9 @isaacs Support subfolders in the man/doc files
isaacs authored
11 doc_subfolders = $(shell find doc -type d \
0e151fc @isaacs build submodules in make process
isaacs authored
12 |sed 's|doc/|man1/|g' )
13
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
14 # This is the default make target.
15 # Since 'make' typically does non-installation build stuff,
16 # it seems appropriate.
0e151fc @isaacs build submodules in make process
isaacs authored
17 submodules:
007fedb @isaacs Update submodules recursively in make
isaacs authored
18 ! [ -d .git ] || git submodule update --init --recursive
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
19
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
20 latest: submodules
21 @echo "Installing latest published npm"
22 @echo "Use 'make install' or 'make link' to install the code"
23 @echo "in this folder that you're looking at right now."
4325dcc @isaacs fix make latest
isaacs authored
24 node cli.js install -g -f npm
743d387 @isaacs Improve install process.
isaacs authored
25
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
26 install: submodules
364dfc6 @isaacs Clobber in Makefile
isaacs authored
27 node cli.js install -g -f
743d387 @isaacs Improve install process.
isaacs authored
28
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
29 # backwards compat
30 dev: install
31
db9ee01 @isaacs clean when linking
isaacs authored
32 link: uninstall
364dfc6 @isaacs Clobber in Makefile
isaacs authored
33 node cli.js link -f
e0c6abb @isaacs Add 'clean' make target
isaacs authored
34
35 clean: uninstall
c7ec9b5 @isaacs No need to clean cache as often, makes search slow
isaacs authored
36 node cli.js cache clean
743d387 @isaacs Improve install process.
isaacs authored
37
0e151fc @isaacs build submodules in make process
isaacs authored
38 uninstall: submodules
94df8f3 @isaacs Support npm_debug env in install script
isaacs authored
39 node cli.js rm npm -g -f
86c296f @isaacs Add commands to make man files from the docs.
isaacs authored
40
30818ab @isaacs html docs
isaacs authored
41 doc: $(docs) $(htmldocs)
c638e80 @isaacs Add a makefile to build the man page.
isaacs authored
42
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
43 # use `npm install ronn` for this to work.
609c930 @isaacs More doc decruftifying
isaacs authored
44 man1/%.1: doc/%.md
7d44c11 @isaacs Don't install ronn for every doc
isaacs authored
45 @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
609c930 @isaacs More doc decruftifying
isaacs authored
46 @[ -d man1 ] || mkdir -p man1
ad8bb00 @isaacs Always use npm-blah(1) in the md, convert appropriately
isaacs authored
47 ./node_modules/.bin/ronn --roff $< \
48 | perl -pi -e 's/npm\\-([^\(]*)\([0-9]\)/npm help \1/g' \
df8c465 @isaacs Link npm(1) to 'npm help npm'
isaacs authored
49 | perl -pi -e 's/npm\([0-9]\)/npm help npm/g' \
ad8bb00 @isaacs Always use npm-blah(1) in the md, convert appropriately
isaacs authored
50 > $@
c638e80 @isaacs Add a makefile to build the man page.
isaacs authored
51
609c930 @isaacs More doc decruftifying
isaacs authored
52 man1/%/: doc/%/
30818ab @isaacs html docs
isaacs authored
53 @[ -d $@ ] || mkdir -p $@
54
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
55
56 html/doc/README.html: README.md html/dochead.html html/docfoot.html
57 @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
58 @[ -d html/doc ] || mkdir -p html/doc
59 (cat html/dochead.html && \
60 ./node_modules/.bin/ronn -f $< && \
61 cat html/docfoot.html )\
62 | sed 's|@NAME@|$*|g' \
63 | sed 's|@DATE@|$(shell date -u +'%Y-%M-%d %H:%m:%S')|g' \
64 | perl -pi -e 's/<h1>npm(-?[^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>npm\1<\/h1> <p>\2<\/p>/g' \
65 | perl -pi -e 's/npm-?([^\)]+)\(1\)/<a href="\1.html">npm \1<\/a>/g' \
66 | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \
67 | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \
68 | perl -pi -e 's/README/<a href="README.html">README<\/a>/g' \
69 > $@
70
30818ab @isaacs html docs
isaacs authored
71 # use `npm install ronn` for this to work.
609c930 @isaacs More doc decruftifying
isaacs authored
72 html/doc/%.html: doc/%.md html/dochead.html html/docfoot.html
30818ab @isaacs html docs
isaacs authored
73 @[ -x ./node_modules/.bin/ronn ] || node cli.js install ronn
609c930 @isaacs More doc decruftifying
isaacs authored
74 @[ -d html/doc ] || mkdir -p html/doc
30818ab @isaacs html docs
isaacs authored
75 (cat html/dochead.html && \
76 ./node_modules/.bin/ronn -f $< && \
77 cat html/docfoot.html )\
78 | sed 's|@NAME@|$*|g' \
79 | sed 's|@DATE@|$(shell date -u +'%Y-%M-%d %H:%m:%S')|g' \
609c930 @isaacs More doc decruftifying
isaacs authored
80 | perl -pi -e 's/<h1>npm(-?[^\(]*\([0-9]\)) -- (.*?)<\/h1>/<h1>npm\1<\/h1> <p>\2<\/p>/g' \
81 | perl -pi -e 's/npm-?([^\)]+)\(1\)/<a href="\1.html">npm \1<\/a>/g' \
89d20d4 @isaacs gubblebum font ftw
isaacs authored
82 | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \
83 | perl -pi -e 's/npm\(1\)/<a href="npm.html">npm<\/a>/g' \
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
84 | perl -pi -e 's/README/<a href="README.html">README<\/a>/g' \
30818ab @isaacs html docs
isaacs authored
85 > $@
86
ec66825 @isaacs Fold the README into the html doc build
isaacs authored
87
30818ab @isaacs html docs
isaacs authored
88 html/doc/%/: doc/%/ html/doc
4f0d334 @isaacs Less warning, better style
isaacs authored
89 @[ -d $@ ] || mkdir -p $@
de338f9 @isaacs Support subfolders in the man/doc files
isaacs authored
90
0e151fc @isaacs build submodules in make process
isaacs authored
91 test: submodules
176f12e @isaacs Move test command into package.json
isaacs authored
92 node cli.js test
90c9ec8 @isaacs Make test (quietly)
isaacs authored
93
5846adf @isaacs version bumper
isaacs authored
94 version: link
4f0d334 @isaacs Less warning, better style
isaacs authored
95 git add package.json &&\
96 git ci -m v$(shell npm -v)
5846adf @isaacs version bumper
isaacs authored
97
98 publish: link
4f0d334 @isaacs Less warning, better style
isaacs authored
99 git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\
100 git push origin master &&\
101 npm publish
2d27e74 @isaacs Add a 'publish' make target
isaacs authored
102
d7d8662 @isaacs Closes GH-609 `make install` installs current, not latest
isaacs authored
103 .PHONY: latest install dev link doc clean uninstall test man
Something went wrong with that request. Please try again.