aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJoris2017-03-26 21:10:42 +0200
committerJoris2017-03-26 21:10:42 +0200
commit1e47a7754ca38bd1a6c74765d8378caf68ce4619 (patch)
treed0d9238479dc2529a1b558bbbcde346e7e8c2935 /Makefile
parentc0ac16a713c4e53cf6af8e72a6d5f6b8ac5d6456 (diff)
Separate client and server watch
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile56
1 files changed, 19 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index 72ab852..2717f9b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,50 +1,32 @@
-all: build
+# Server
+# ------
-clean:
+clean-server:
@stack clean > /dev/null
- @rm -r elm-stuff >/dev/null 2>&1 || true
-install:
+install-server:
@stack setup
- @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
+build-server:
+ @stack build || :
launch-server:
- @stack exec sharedCost &
-
-kill-server:
- @killall sharedCost || :
+ @(killall sharedCost || :) && stack exec sharedCost
+watch-server:
+ @nodemon -e hs,conf --exec 'clear && make build-server --silent && make launch-server'
-# Build
-# -----
+# Client
+# ------
-.PHONY: build
-build: build-server build-elm build-js
+clean-client:
+ @rm -r elm-stuff >/dev/null 2>&1 || true
-build-server:
- @stack build || true
+install-client:
+ @elm package install --yes
-build-elm:
- @elm make src/client/elm/Main.elm --output public/javascripts/client.js || true
+build-client:
+ @elm make src/client/Main.elm --output public/javascripts/client.js || true
-build-js:
- @cp src/client/js/main.js public/javascripts/main.js || true
+watch-client:
+ @nodemon -e elm --exec 'clear && make build-client --silent'