-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (37 loc) · 1.21 KB
/
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
44
45
46
47
48
49
# OS Specific
# set default shell to cmd.exe, fixing git-shell issues with gnu-make.
ifeq ($(OS), Windows_NT)
SHELL = C:\Windows\SysWOW64\cmd.exe
endif
LS = node_modules/LiveScript
LSC = node_modules/".bin"/lsc
MOCHA = node_modules/".bin"/mocha
MOCHA2 = node_modules/".bin"/_mocha
BRSIFY = node_modules/".bin"/browserify
UGLIFY = node_modules/'.bin'/uglifyjs
MKDIRP = node_modules/".bin"/mkdirp
ISTNBL = node_modules/".bin"/istanbul
MOCHAF = -u tdd -R spec -t 5000 --compilers ls:$(LS) -r "./test-runner.ls" -c -S -b --recursive --check-leaks --inline-diffs
SRC = $(shell find src -maxdepth 1 -name "*.ls" -type f | sort)
DIST = dist $(SRC:src/%.ls=dist/%.js)
BREL = browser browser/prelude.js browser/prelude.min.js
build: $(DIST) $(BREL)
install:
@npm install .
test: build
@$(MOCHA) $(MOCHAF)
cov: build
@$(ISTNBL) cover $(MOCHA2) -- $(MOCHAF)
clean:
@rm -rf dist
@rm -rf browser
@sleep .1 # wait for editor to refresh the file tree.......
.PHONY: build install test cov clean
%:
@$(MKDIRP) $@
dist/%.js: src/%.ls
$(LSC) --bare -o "$(shell dirname $@)" -c "$<"
browser/%.js: dist/%.js
$(BRSIFY) -r "./$<:prelude" > "$@"
browser/%.min.js: browser/%.js
$(UGLIFY) "./$<" --mangle --comments "none" > "$@"