Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (59 sloc) 2.268 kB
37d4886 @michaelficarra Makefile: parser is just as much part of LIB as other libs
authored
1 default: all
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
2
3 SRC = $(shell find src -name "*.coffee" -type f | sort)
37d4886 @michaelficarra Makefile: parser is just as much part of LIB as other libs
authored
4 LIB = $(SRC:src/%.coffee=lib/coffee-script/%.js) lib/coffee-script/parser.js
bd588de @michaelficarra include the parser in the bootstrapping process
authored
5 BOOTSTRAPS = $(SRC:src/%.coffee=lib/coffee-script/bootstrap/%.js) lib/coffee-script/bootstrap/parser.js
0be34bc @michaelficarra added minification target to Makefile
authored
6 LIBMIN = $(LIB:lib/coffee-script/%.js=lib/coffee-script/%.min.js)
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
7 TESTS = $(shell find test -name "*.coffee" -type f | sort)
b737c5e @abedra Adding deps target to Makefile to support easier developer setup
abedra authored
8 ROOT = $(shell pwd)
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
9
abbb255 @michaelficarra node modules should be compiled with --bare
authored
10 COFFEE = bin/coffee --js --bare
2b3a068 @michaelficarra finally moved away from git submodules
authored
11 PEGJS = node_modules/.bin/pegjs --track-line-and-column --cache
12 MOCHA = node_modules/.bin/mocha --compilers coffee:. -u tdd
13 MINIFIER = node_modules/.bin/uglifyjs --no-copyright --mangle-toplevel --reserved-names require,module,exports,global,window
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
14
37d4886 @michaelficarra Makefile: parser is just as much part of LIB as other libs
authored
15 all: $(LIB)
16 build: all
0be34bc @michaelficarra added minification target to Makefile
authored
17 parser: lib/coffee-script/parser.js
18 minify: $(LIBMIN)
19 # TODO: build-browser
20 # TODO: test-browser
21 # TODO: doc
22 # TODO: bench
23
7d35911 @michaelficarra changes to Makefile to prepare for self-hosting
authored
24 lib:
25 mkdir lib/
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
26
7d35911 @michaelficarra changes to Makefile to prepare for self-hosting
authored
27 lib/coffee-script: lib
5962d8a @michaelficarra self-host
authored
28 mkdir -p lib/coffee-script/
29
30 lib/coffee-script/bootstrap: lib/coffee-script
31 mkdir -p lib/coffee-script/bootstrap
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
32
2b3a068 @michaelficarra finally moved away from git submodules
authored
33 lib/coffee-script/parser.js: src/grammar.pegjs bootstraps lib/coffee-script
34 printf %s "module.exports = " >"$(@:%=%.tmp)"
35 $(PEGJS) <"$<" >>"$(@:%=%.tmp)"
36 mv "$(@:%=%.tmp)" "$@"
bd588de @michaelficarra include the parser in the bootstrapping process
authored
37 lib/coffee-script/bootstrap/parser.js: src/grammar.pegjs lib/coffee-script/bootstrap
38 printf %s "module.exports = " >"$@"
39 $(PEGJS) <"$<" >>"$@"
4d71edd @michaelficarra serious business Makefiles
authored
40
0be34bc @michaelficarra added minification target to Makefile
authored
41 lib/coffee-script/%.min.js: lib/coffee-script/%.js lib/coffee-script
7d35911 @michaelficarra changes to Makefile to prepare for self-hosting
authored
42 $(MINIFIER) <"$<" >"$@"
43
5962d8a @michaelficarra self-host
authored
44 lib/coffee-script/bootstrap/%.js: src/%.coffee lib/coffee-script/bootstrap
7d35911 @michaelficarra changes to Makefile to prepare for self-hosting
authored
45 $(COFFEE) <"$<" >"$@"
46
5962d8a @michaelficarra self-host
authored
47 bootstraps: $(BOOTSTRAPS) lib/coffee-script/bootstrap
19d7694 @michaelficarra some changes to the bootstrapping process
authored
48 mv lib/coffee-script/bootstrap/* lib/coffee-script
49 rmdir lib/coffee-script/bootstrap
5962d8a @michaelficarra self-host
authored
50
7d35911 @michaelficarra changes to Makefile to prepare for self-hosting
authored
51
5962d8a @michaelficarra self-host
authored
52 lib/coffee-script/%.js: src/%.coffee lib/coffee-script/bootstrap/%.js bootstraps lib/coffee-script
53 $(COFFEE) <"$<" >"$(@:%=%.tmp)" && mv "$(@:%=%.tmp)" "$@"
0be34bc @michaelficarra added minification target to Makefile
authored
54
55
56 .PHONY: test coverage install loc clean
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
57
4d71edd @michaelficarra serious business Makefiles
authored
58 test: $(LIB) $(TESTS)
5650684 @michaelficarra switch to simple dot test reporter
authored
59 $(MOCHA) -R dot
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
60
4d71edd @michaelficarra serious business Makefiles
authored
61 coverage: $(LIB)
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
62 @which jscoverage || (echo "install node-jscoverage"; exit 1)
63 rm -rf instrumented
64 jscoverage -v lib instrumented
65 $(MOCHA) -R dot
8b25b50 @michaelficarra fixed coverage task
authored
66 $(MOCHA) -r instrumented/coffee-script/compiler -R html-cov > coverage.html
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
67 @xdg-open coverage.html &> /dev/null
68
0be34bc @michaelficarra added minification target to Makefile
authored
69 install: $(LIB)
70 npm install -g .
71
72 loc:
73 wc -l src/*
74
323cdeb @michaelficarra started using mocha; fixed an instanceof bug; added some shitty tests
authored
75 clean:
76 rm -rf instrumented
16428d1 @michaelficarra more refactoring
authored
77 rm -f coverage.html
5962d8a @michaelficarra self-host
authored
78 rm -rf lib
Something went wrong with that request. Please try again.