From a04ec905da2c6a8640162a0d397e184ea1a8bc78 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 2 Jul 2016 16:26:12 +0200 Subject: Use nix to fetch dev tools --- Makefile | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0f393fd --- /dev/null +++ b/Makefile @@ -0,0 +1,52 @@ +all: install build + +clean: + @echo "Cleaning…" + @cabal clean > /dev/null + @rm -r elm-stuff >/dev/null 2>&1 || true + @rm -r node_modules >/dev/null 2>&1 || true + +install: + cabal2nix --shell . > sharedCost.nix + nix-shell sharedCost.nix -I ~ --command 'cabal configure' + elm package install + npm install + +# Watch +# ----- + +watch: watch-server watch-elm watch-js + +watch-server: + ./node_modules/nodemon/bin/nodemon.js -e hs,conf --exec 'make build-and-launch-server --silent' + +watch-elm: + ./node_modules/nodemon/bin/nodemon.js -e elm --exec 'make build-elm --silent' + +watch-js: + ./node_modules/nodemon/bin/nodemon.js --watch src/client/js --exec 'make build-js --silent' + +# Build and launch +# ---------------- + +build-and-launch-server: build-server kill-server launch-server + +launch-server: + ./dist/build/sharedCost/sharedCost & + +kill-server: + pkill sharedCost || true + +# Build +# ----- + +build: build-server build-elm build-js + +build-server: + cabal build + +build-elm: + elm make src/client/elm/Main.elm --output public/javascripts/client.js + +build-js: + cp src/client/js/main.js public/javascripts/main.js -- cgit v1.2.3