aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-08-03 17:26:45 +0200
committerJasper Van der Jeugt2020-08-03 17:26:45 +0200
commit7e646e1676e08331598ae2b9518f2b1b5f999ba2 (patch)
treef2d25239230cfb711fbd26828e5698b94b876988 /Makefile
parent9ce21e70492ca82c5554e3fa523108755fa721e8 (diff)
Make it deployable
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0f7a475..bca08c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+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
@@ -9,8 +11,13 @@ build: server/assets/client.js \
server/assets/black.txt \
server/assets/white.txt
+.PHONY: server
server: build
- cd server && stack exec cafp-server
+ (cd server && \
+ CAFP_HOSTNAME=$(CAFP_HOSTNAME) \
+ CAFP_PORT=$(CAFP_PORT) \
+ CAFP_BASE=$(CAFP_BASE) \
+ stack exec cafp-server)
.PHONY: stack_build
stack_build: $(HS_SOURCES)
@@ -23,8 +30,8 @@ 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
- cp client/index.html $@
+server/assets/client.html: client/index.html config.mk
+ sed "s@\$$CAFP_BASE@$(CAFP_BASE)@" $< >$@
server/assets/style.css: client/style.css
cp $< $@