Makefile to install locally, with clean and variable targets.

This commit is contained in:
Elf M. Sternberg 2015-05-13 20:00:56 -07:00
parent 8f353fce29
commit 75a22f87ea
2 changed files with 12 additions and 1 deletions

View File

@ -2,6 +2,13 @@
# docs: $(patsubst %.md,%.html,$(wildcard *.md)) # docs: $(patsubst %.md,%.html,$(wildcard *.md))
targets = lists.js reduce.js
all: $(targets)
%.js: src/%.coffee
coffee -c -o . $<
%.html: %.md header.html footer.html %.html: %.md header.html footer.html
cat header.html > $@ cat header.html > $@
pandoc $< >> $@ pandoc $< >> $@
@ -14,3 +21,5 @@ node_modules: package.json
test: node_modules test: node_modules
@node_modules/.bin/mocha --compilers coffee:coffee-script/register @node_modules/.bin/mocha --compilers coffee:coffee-script/register
clean:
rm -f $(targets)

View File

@ -5,6 +5,7 @@
"main": "lists.js", "main": "lists.js",
"directories": { "directories": {
"test": "test" "test": "test"
}, },
"dependencies": { "dependencies": {
}, },
@ -13,7 +14,8 @@
"mocha": "^2.1.0" "mocha": "^2.1.0"
}, },
"scripts": { "scripts": {
"test": "mocha" "test": "mocha",
"install": "make all"
}, },
"repository": { "repository": {
"type": "git", "type": "git",