-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (32 loc) · 1.07 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
# 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
BRSIFY = node_modules/".bin"/browserify
UGLIFY = node_modules/'.bin'/uglifyjs
MKDIRP = node_modules/".bin"/mkdirp
SRC = $(shell find src -maxdepth 1 -name "*.ls" -type f | sort)
DIST = dist $(SRC:src/%.ls=dist/%.js)
BREL = browser browser/JSONPrint.js browser/JSONPrint.min.js
build: $(DIST) $(BREL)
install:
@npm install .
test: build
@$(MOCHA) tests -u tdd -R spec -t 5000 --compilers ls:$(LS) -r "./test-runner.js" -c -S -b --recursive --check-leaks --inline-diffs
clean:
@rm -rf dist
@rm -rf browser
@sleep .1 # wait for editor to refresh the file tree.......
.PHONY: build install test clean
%:
@$(MKDIRP) $@
dist/%.js: src/%.ls
$(LSC) --bare -o "$(shell dirname $@)" -c "$<"
browser/%.js: dist/%.js
$(BRSIFY) -r "./$<:JSONPrint" > "$@"
browser/%.min.js: browser/%.js
$(UGLIFY) "./$<" --mangle --comments "none" > "$@"