forked from jaspervdj/uplcg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 1 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
include config.mk
HS_SOURCES=$(shell find server/lib/ server/src -name '*.hs')
ELM_SOURCES=$(shell find client/src -name '*.elm')
ELM_MESSAGES_SOURCE=client/src/Messages.elm
STACK_BIN=$(shell cd server && stack path --local-install-root)/bin
.PHONY: build
build: server/assets/client.js \
server/assets/style.css \
server/assets/cards.yaml
.PHONY: docker
docker:
docker build -t jaspervdj/uplcg .
docker push jaspervdj/uplcg
.PHONY: server
server: build
(cd server && stack exec env \
UPLCG_HOSTNAME=$(UPLCG_HOSTNAME) \
UPLCG_PORT=$(UPLCG_PORT) \
uplcg-server)
.PHONY: stack_build
stack_build: $(HS_SOURCES)
(cd server && stack build)
$(ELM_MESSAGES_SOURCE): stack_build
(cd server && stack exec uplcg-generate-elm-types) >$(ELM_MESSAGES_SOURCE)
server/assets/client.js: $(ELM_MESSAGES_SOURCE) $(ELM_SOURCES)
mkdir -p server/assets
cd client && elm make src/Client.elm --optimize --output=../$@
server/assets/style.css: client/style.css
cp $< $@
server/assets/cards.yaml: cards.yaml
cp $< $@