aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 70c007ac4608450498f1fbff761ef9c7c054dccd (plain)
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
all: build

clean:
	@cabal clean > /dev/null
	@rm -r elm-stuff >/dev/null 2>&1 || true

install:
	@elm package install --yes

# Watch
# -----

watch: watch-server watch-elm watch-js

watch-server:
	@nodemon -e hs,conf --exec 'clear && make build-and-launch-server --silent' &

watch-elm:
	@nodemon -e elm --exec 'clear && make build-elm --silent' &

watch-js:
	@nodemon --watch src/client/js  --exec 'make build-js --silent'

# Build and launch
# ----------------

build-and-launch-server: build-server kill-server launch-server

launch-server:
	@./dist/build/sharedCost/sharedCost &

kill-server:
	@pkill sharedCost || true

# Build
# -----

.PHONY: build
build: build-server build-elm build-js

build-server:
	@cabal build || true

build-elm:
	@elm make src/client/elm/Main.elm --output public/javascripts/client.js || true

build-js:
	@cp src/client/js/main.js public/javascripts/main.js || true