-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
66 lines (43 loc) · 1.28 KB
/
Makefile
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package = badgers
stack_yaml = STACK_YAML="stack.yaml"
stack = $(stack_yaml) stack
build:
$(stack) build $(package)
build-fast:
$(stack) build -j2 --fast --no-terminal
build-dirty:
$(stack) build --force-dirty $(package)
build-profile:
$(stack) --work-dir .stack-work-profiling --profile build
run:
$(stack) build --fast && $(stack) exec -- $(package)
install:
$(stack) install
ghci:
$(stack) ghci $(package):lib --ghci-options='-j4 +RTS -A128m'
test:
$(stack) test $(package)
test-ghci:
$(stack) ghci $(package):test:$(package)-tests
bench:
$(stack) bench $(package)
ghcid:
$(stack) exec -- ghcid -c "stack ghci $(package):lib --test --ghci-options='-fobject-code -fno-warn-unused-do-bind' --main-is $(package):$(package)"
dev-deps:
stack install ghcid
psql:
sudo -u postgres psql badgers_dev
reset-database: destroy-create-db migration fixtures
reset-data: truncate-tables fixtures
create-db-user:
sudo -u postgres createuser badgers --password badgers --superuser
destroy-create-db:
-sudo -u postgres dropdb badgers_dev
sudo -u postgres createdb -O badgers badgers_dev
migration: build
stack exec -- migration
fixtures: build
stack exec -- fixtures
truncate-tables: build
stack exec -- truncate
.PHONY : build build-dirty run install ghci test test-ghci ghcid dev-deps