-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
70 lines (49 loc) · 1.37 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
.PHONY: test
SRC = $(shell find src -name "*.ls" -type f | sort)
LIB = $(patsubst src/%.ls, lib/%.js, $(SRC))
MOCHA = ./node_modules/.bin/mocha
LSC = ./node_modules/.bin/lsc
PARCEL = ./node_modules/.bin/parcel
DOCKER = docker run -v ${PWD}:/usr/src/app -w /usr/src/app -it --rm node:4.0.0
NAME = $(shell node -e "console.log(require('./package.json').name)")
REPORTER ?= spec
GREP ?= ".*"
MOCHA_ARGS = --grep $(GREP)
MOCHA_WATCH = $(MOCHA) $(MOCHA_ARGS) --reporter min --watch
default: all
lib:
mkdir -p lib/
lib/%.js: src/%.ls lib
$(LSC) -c -o "$(@D)" "$<"
all: compile build-web
compile: $(LIB) package.json
build-web: clean-web
NODE_ENV=production $(PARCEL) build --no-source-maps --out-dir web-dist web/index.html
install: clean all
npm install -g .
reinstall: clean
$(MAKE) uninstall
$(MAKE) install
uninstall:
npm uninstall -g ${NAME}
dev-install: package.json
npm install .
clean:
rm -rf lib
clean-web:
rm -rf web-dist
publish: all test
git push --tags origin HEAD:master
npm publish
test:
@$(MOCHA) $(MOCHA_ARGS) --reporter $(REPORTER) test/unit/*.ls
test-w:
@$(MOCHA_WATCH) test/unit/*.ls
test-func: compile
@$(MOCHA) $(MOCHA_ARGS) --reporter $(REPORTER) test/functional/*.ls --timeout 30000
test-func-w: compile
@$(MOCHA_WATCH) test/functional/*.ls --timeout 10000
docker-test-func:
@$(DOCKER) make test-func
docker-test-func-w:
@$(DOCKER) make test-func-w