-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (33 loc) · 978 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Variables
BIN = ./node_modules/.bin
COFFEE = ${BIN}/coffee
BROWSERIFY = ${BIN}/browserify
UGLIFY = ${BIN}/uglifyjs
DAEMON = ./watch.sh
# Targets
default: web
deps:
if test -d "node_modules"; then echo "dependencies installed"; else npm install; fi
clean:
if [ -e "build/equatorie.js" ]; then rm build/equatorie.js; fi
rm -rf build
# compile the NPM library version to JavaScript
build: clean
${COFFEE} -o build -c src/
# Watch a directory then hit web build
watch: clean
${DAEMON} src make
# compiles the NPM version files into a combined minified web .js library
web: build
${BROWSERIFY} build/equatorie.js > build/equatorie_full.js
${UGLIFY} build/equatorie_full.js > build/equatorie.min.js
cp build/equatorie_full.js html/js/equatorie.js
cp build/equatorie.min.js html/js/equatorie.min.js
cp build/physics.js html/js/physics.js
docs:
docco src/*.coffee
test: build
mocha --compilers coffee:coffee-script
dist: deps web
publish: dist
npm publish