Fetching contributors…
Cannot retrieve contributors at this time
131 lines (97 sloc) 3.64 KB
SHELL = bash
markdowns = $(shell find doc -name '*.md' | grep -v 'index')
cli_mandocs = $(shell find doc/cli -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/cli/|man/man1/|g' ) \
man/man1/README.1 \
api_mandocs = $(shell find doc/api -name '*.md' \
|sed 's|.md|.3|g' \
|sed 's|doc/api/|man/man3/|g' )
cli_htmldocs = $(shell find doc/cli -name '*.md' \
|grep -v '' \
|sed 's|.md|.html|g' \
|sed 's|doc/cli/|html/doc/|g' ) \
html/doc/README.html \
api_htmldocs = $(shell find doc/api -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/api/|html/api/|g' )
mandocs = $(api_mandocs) $(cli_mandocs)
htmldocs = $(api_htmldocs) $(cli_htmldocs)
all: doc
@echo "Installing latest published npm"
@echo "Use 'make install' or 'make link' to install the code"
@echo "in this folder that you're looking at right now."
node cli.js install -g -f npm
install: all
node cli.js install -g -f
# backwards compat
dev: install
link: uninstall
node cli.js link -f
clean: doc-clean uninstall
rm npmrc
node cli.js cache clean
node cli.js rm npm -g -f
doc: $(mandocs) $(htmldocs)
docclean: doc-clean
rm -rf \
node_modules/ronn \
node_modules/.bin/ronn \
.building_ronn \
doc/cli/ \
doc/api/ \
$(api_mandocs) \
$(cli_mandocs) \
$(api_htmldocs) \
$(cli_htmldocs) \
&>/dev/null || true
# use `npm install ronn` for this to work.
man/man1/README.1: scripts/ package.json
scripts/ $< $@
man/man1/%.1: doc/cli/ scripts/ package.json
@[ -d man/man1 ] || mkdir -p man/man1
scripts/ $< $@
man/man3/%.3: doc/api/ scripts/ package.json
@[ -d man/man3 ] || mkdir -p man/man3
scripts/ $< $@
html/doc/README.html: html/dochead.html html/docfoot.html scripts/ package.json
scripts/ $< $@
html/doc/%.html: doc/cli/ html/dochead.html html/docfoot.html scripts/ package.json
scripts/ $< $@
html/api/%.html: doc/api/ html/dochead.html html/docfoot.html scripts/ package.json
scripts/ $< $@
doc/cli/ $(markdowns) scripts/index-build.js scripts/ package.json
node scripts/index-build.js > $@
node cli.js install
doc: man
man: $(cli_docs) $(api_docs)
node cli.js test
publish: link doc
@git push origin :v$(shell npm -v) || true
@npm unpublish npm@$(shell npm -v) || true
git clean -fd
git push origin --tags &&\
npm publish &&\
npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $$1 "." $$2}') &&\
make doc-publish &&\
make zip-publish
docpublish: doc-publish
doc-publish: doc
rsync -vazu --stats --no-implied-dirs --delete html/doc/
rsync -vazu --stats --no-implied-dirs --delete html/api/
rsync -vazu --stats --no-implied-dirs --delete html/webfonts/
scp html/style.css
zip-publish: release
scp release/*
@bash scripts/
@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || echo "make it yourself" && exit 13
.PHONY: all latest install dev link doc clean uninstall test man doc-publish doc-clean docclean docpublish release zip-publish