aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 $@