Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Commit

Permalink
Add Makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
reid committed Nov 18, 2011
1 parent 830fd7c commit fb372f1
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
help:
@echo "Type \`make all\` first to get started."
@echo "\`make test\` for unit tests."
@echo "\`make lint\` to run JSLint."
@echo "\`make html\` to build HTML documentation."

all: install

install: sanity
npm i

sanity:
sh script/sanity.sh

test:
sh script/test.sh test/*.js

spec:
sh script/test.sh --spec test/*.js

smoke:
sh script/test.sh test/smoke/*.js

smoke-spec:
sh script/test.sh --spec test/smoke/*.js

lint:
# Problem? Try `make install-dev`
find lib test -name "*.js" -print0 | xargs -0 ./node_modules/.bin/jslint --forin

DOC:=doc
DOCS:=$(addprefix $(DOC)/, README.html HISTORY.html)

html: $(DOCS)

$(DOC):
mkdir $@

$(DOCS): | $(DOC)

RONN = ./node_modules/.bin/ronn

$(DOC)/README.html: README.md
# Problem? Try `make install`
$(RONN) -5 $< > $@

$(DOC)/HISTORY.html: HISTORY.md
# Problem? Try `make install`
$(RONN) -5 $< > $@

preview: $(DOCS)
sh script/open.sh $?
touch preview

clean:
rm -rf $(DOC) node_modules npm-*.log

.PHONY: help sanity install test spec lint smoke smoke-spec html preview clean

0 comments on commit fb372f1

Please sign in to comment.