-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
51 lines (39 loc) · 1.06 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
default: build
all: build doc
MODULE = Mario
build: dist/$(MODULE).js
deps: bower_components
doc: docs/README.md
SRC = $(shell find src -name '*.purs' -type f | sort)
NPM = $(shell command -v npm || { echo "npm not found."; exit 1; })
NPM_BIN = $(shell npm bin)
BOWER = $(NPM_BIN)/bower
PURS = $(NPM_BIN)/purs
$(PURS): node_modules
$(BOWER): node_modules
dist/$(MODULE).js: bower_components $(PURS) $(SRC)
mkdir -p "$(@D)"
"$(PURS)" compile \
'bower_components/purescript-*/src/**/*.purs' \
$(SRC) \
--verbose-errors
"$(PURS)" bundle \
'output/**/*.js' \
--output dist/$(MODULE).js \
--module $(MODULE).Main \
--main $(MODULE).Main
.PHONY: default all build deps doc clean
docs/README.md: bower_components $(PURS) $(SRC)
mkdir -p '$(@D)'
"$(PURS)" docs \
--docgen $(MODULE) \
'bower_components/purescript-*/src/**/*.purs' \
$(SRC) >'$@'
node_modules:
"$(NPM)" install
touch -cm node_modules
bower_components: $(BOWER)
"$(BOWER)" install
touch -cm bower_components
clean:
rm -rf dist docs bower_components node_modules .psci_modules output