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