File: Makefile

package info (click to toggle)
node-prelude-ls 1.1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 208 kB
  • ctags: 27
  • sloc: makefile: 44; sh: 2
file content (56 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
default: all

SRC = $(shell find src -name "*.ls" -type f | sort)
LIB = $(SRC:src/%.ls=lib/%.js)
LS = /usr/lib/nodejs/livescript
LSC = /usr/bin/lsc
BROWSERIFY = node_modules/.bin/browserify
UGLIFYJS = node_modules/.bin/uglifyjs
MOCHA = /usr/bin/mocha
MOCHA2 = node_modules/.bin/_mocha
ISTANBUL = node_modules/.bin/istanbul

lib:
	mkdir -p lib/

lib/%.js: src/%.ls lib package.json
	$(LSC) --output lib --bare --compile "$<"

browser:
	mkdir browser/

prelude-browser.js: $(LIB) browser preroll.ls
	{ $(LSC) ./preroll.ls ; $(BROWSERIFY) -r ./lib/index.js:prelude-ls ; } > browser/prelude-browser.js

prelude-browser-min.js: browser/prelude-browser.js
	$(UGLIFYJS) browser/prelude-browser.js --mangle --comments "all" > browser/prelude-browser-min.js

package.json: package.json.ls
	$(LSC) --compile package.json.ls

.PHONY: build build-browser test coverage dev-install loc clean

all: build

build: $(LIB) package.json

build-browser: prelude-browser.js prelude-browser-min.js

test: build
	$(MOCHA) --reporter dot --ui tdd --compilers ls:$(LS)

coverage: build
	$(ISTANBUL) cover $(MOCHA2) -- --reporter dot --ui tdd --compilers ls:$(LS)

dev-install: package.json
	npm install .

loc:
	wc --lines src/*

clean:
	rm -f ./*.js
	rm -rf lib
	rm -rf browser
	rm -rf coverage
	rm -f package.json