From 75a22f87ea370313073c7e78c00bc493d85f7b83 Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Wed, 13 May 2015 20:00:56 -0700 Subject: [PATCH] Makefile to install locally, with clean and variable targets. --- Makefile | 9 +++++++++ package.json | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 10e189d..ac60f45 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,13 @@ # 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 cat header.html > $@ pandoc $< >> $@ @@ -14,3 +21,5 @@ node_modules: package.json test: node_modules @node_modules/.bin/mocha --compilers coffee:coffee-script/register +clean: + rm -f $(targets) diff --git a/package.json b/package.json index ee05643..07dfc1c 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "lists.js", "directories": { "test": "test" + }, "dependencies": { }, @@ -13,7 +14,8 @@ "mocha": "^2.1.0" }, "scripts": { - "test": "mocha" + "test": "mocha", + "install": "make all" }, "repository": { "type": "git",