aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: c8bb7ceac1da94104c26317cfa7a74dfc2023a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
start:
	@nix-shell tools.nix --command "tmuxinator local"

stop:
	@tmux kill-session -t sharedCost

dist:
	@nix-shell tools.nix --command "make clean install build"

clean: clean-client clean-server
install: install-client install-server
build: build-client build-server

# Client
# ------

build-client:
	@nix-shell -A shells.ghcjs --run "build-client-inside"

build-client-inside:
	@cabal --project-file=cabal-client.project --builddir=dist-client new-build all && make cp-client

cp-client:
	@cp dist-client/build/x86_64-linux/ghcjs-0.2.1/client-0.0.1/c/client/build/client/client.jsexe/all.js public/javascript/main.js

clean-client:
	@rm -rf dist-client

watch-client:
	@nix-shell -A shells.ghcjs --run "nodemon --watch client --watch common --ext hs --exec '(clear && make build-client-inside) || true'"

# Server
# ------

clean-server:
	@rm -rf dist-server

build-server:
	@nix-shell -A shells.ghc --run "make build-server-inside"

build-server-inside:
	@cabal --project-file=cabal-server.project --builddir=dist-server new-build all

run-server:
	@(killall sharedCost &>/dev/null) || :
	@./dist-server/build/x86_64-linux/ghc-8.0.2/server-0.0.1/c/server/build/server/server

watch-server:
	@nix-shell -A shells.ghc --run "nodemon --watch server --watch common --ext hs --exec '(clear && make build-server-inside && make run-server) || :'"