aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-07-29 16:17:17 +0200
committerJasper Van der Jeugt2020-07-29 16:17:17 +0200
commit780527946548c68bfcfc4d8a99abf06b66cf23c1 (patch)
tree1479ab0ceb1de8016dff7ff462cd565c452a4243 /Makefile
parent72b1de1a28c23cf694ff5f982f0f637afd4ba5bc (diff)
Stub client
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 17 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 677f1b6..5c05542 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,24 @@
HS_SOURCES=$(shell find server/lib/ server/src -name '*.hs')
-ELM_MESSAGES_MODULE=client/src/Messages.elm
+ELM_SOURCES=$(shell find client/src -name '*.elm')
+ELM_MESSAGES_SOURCE=client/src/Messages.elm
.PHONY: build
-build:
- cd server && stack build
+build: server/assets/client.js server/assets/client.html
server: build
cd server && stack exec cafp-server
-$(ELM_MESSAGES_MODULE): $(HS_SOURCES)
- (cd server && stack exec cafp-generate-elm-types) >$(ELM_MESSAGES_MODULE)
+.PHONY: stack_build
+stack_build: $(HS_SOURCES)
+ (cd server && stack build)
+
+$(ELM_MESSAGES_SOURCE): stack_build
+ (cd server && stack exec cafp-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 --output=../server/assets/client.js
+
+server/assets/client.html: client/index.html
+ mkdir -p server/assets
+ cp client/index.html $@