-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (37 loc) · 1.4 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
default: build
BIN := ./node_modules/.bin
STYLUS_SRC_FILE := $(wildcard src/styles/*.styl)
STYLUS_DEST := $(STYLUS_SRC_FILE:src/%.styl=public/%.css)
public/%.css: src/%.styl
@echo "stylus: $< ➜ $@"
@$(BIN)/stylus < $< > $@
src/scripts/pianoRollTemplate.html: node_modules/ src/scripts/pianoRollTemplate.pug
@node ./pug.js src/scripts/pianoRollTemplate.pug
src/scripts/pianoRollTemplate.ts: node_modules/ src/scripts/pianoRollTemplate.pug
@node ./pug.js src/scripts/pianoRollTemplate.pug --client -E ts
public/scripts/script.js: rollup.config.js tsconfig.json src/scripts/pianoRollTemplate.ts $(wildcard src/scripts/*.ts)
@$(BIN)/rollup --config
install: node_modules/
node_modules/:
npm install
clear:
@rm -fv \
src/scripts/pianoRollTemplate.ts \
public/scripts/script.js \
public/scripts/script.js.map \
$(STYLUS_DEST)
build: node_modules/ public/scripts/script.js $(STYLUS_DEST)
rebuild: clear build
watch: node_modules/
@node ./pug.js src/scripts/pianoRollTemplate.pug --client -E ts -w \
& $(BIN)/rollup --config -w --no-watch.clearScreen \
& $(BIN)/stylus src/styles/ --out public/styles/ -w \
watch-strict:
@echo 'watching for change'
@echo 'press ctrl+C to stop'
while true; do ${MAKE} --silent ; sleep 0.5; done
serve: node_modules/
@$(BIN)/http-server -o -s -c-1
dev: node_modules/
${MAKE} watch & ${MAKE} serve
.PHONY: default install clear build rebuild watch watch-strict serve