aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 5d695f24f9a4953d52441de0fde8e3fd88c1dd5a (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
50
start:
	@nix-shell --command "tmuxinator local"

stop:
	@tmux kill-session -t sharedCost

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

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

# Server
# ------

clean-server:
	@cabal clean

install-server:
	@cabal2nix --shell . > sharedCost.nix

build-server:
	@nix-shell sharedCost.nix --command "cabal build"

launch-server:
	@killall sharedCost || :
	@cabal run sharedCost

watch-server:
	@nodemon --watch src/server -e hs,conf --exec '(clear && make build-server && make launch-server) || :'

# Client
# ------

clean-client:
	@rm -rf reflex-platform

install-client:
	@git clone https://github.com/reflex-frp/reflex-platform 2>/dev/null || :
	@cd reflex-platform && ./try-reflex --command exit >/dev/null

build-client-inside:
	@cd src/client && ghcjs -Wall -Werror --make Main && mv Main.jsexe/all.js ../../public/javascript/main.js

build-client:
	@./reflex-platform/try-reflex --command "make build-client-inside"

watch-client:
	@./reflex-platform/try-reflex --command "nodemon --watch src/client -e hs --exec '(clear && make build-client-inside) || true'"