-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
112 lines (89 loc) · 3.11 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
PWSH = pwsh
.PHONY: build
build: build-deps
cabal build -j
.PHONY: build-deps
build-deps:
cabal build -j --only-dependencies
.PHONY: test
test: test-doctest test-original test-hdbc-postgresql test-relational-record
.PHONY: build-doctest
build-doctest: build
cabal build -j postgresql-pure:test:doctest
.PHONY: test-doctest
test-doctest: build-doctest
cabal test -j postgresql-pure:test:doctest
.PHONY: build-original
build-original: build
cabal build -j postgresql-pure:test:original
.PHONY: test-original
test-original: build-original
cabal test -j postgresql-pure:test:original
.PHONY: build-hdbc-postgresql
build-hdbc-postgresql: build
cabal build -j postgresql-pure:test:hdbc-postgresql
.PHONY: test-hdbc-postgresql
test-hdbc-postgresql: build-hdbc-postgresql
cabal test -j postgresql-pure:test:hdbc-postgresql
.PHONY: build-relational-record
build-relational-record: build
cabal build -j postgresql-pure:test:relational-record
.PHONY: test-relational-record
test-relational-record: build-relational-record
cabal test -j postgresql-pure:test:relational-record
.PHONY: build-requests-per-second
build-requests-per-second: build
cabal build -j postgresql-pure:bench:requests-per-second
.PHONY: bench-requests-per-second
bench-requests-per-second: build-requests-per-second
cabal bench -j postgresql-pure:bench:requests-per-second
.PHONY: build-requests-per-second-constant
build-requests-per-second-constant: build
cabal build -j postgresql-pure:bench:requests-per-second-constant
.PHONY: bench-requests-per-second-constant
bench-requests-per-second-constant: build-requests-per-second-constant
cabal bench -j postgresql-pure:bench:requests-per-second-constant
.PHONY: init-test-asset
init-test-asset:
psql -Upostgres -f test-asset/create-tables.sql
psql -Upostgres -f test-asset/insert.sql
.PHONY: format
format:
$(PWSH) -Command "& { Get-ChildItem -Filter '*.hs' -Recurse src, test, test-doctest, test-relational-record, benchmark | Where-Object { $$_.Directory -notlike '*\src\Database\PostgreSQL\Simple\Time\Internal' } | ForEach-Object { stack exec -- stylish-haskell -i $$_.FullName } }"
stylish-haskell -i Setup.hs
.PHONY: lint
lint:
hlint\
src/Database/PostgreSQL/Pure.hs\
src/Database/PostgreSQL/Pure\
src/Database/HDBC\
test-original\
test-doctest\
test-relational-record\
benchmark
pages-path=../postgresql-pure-pages
.PHONY: doc
doc:
$(PWSH) -Command "& {\
Remove-Item -Recurse $(pages-path)\*;\
stack --stack-yaml stack-nightly.yaml haddock --haddock-arguments '--odir $(pages-path)';\
$$revision = $$(git rev-parse HEAD);\
Push-Location $(pages-path);\
git add .;\
git commit -m $$revision;\
Pop-Location\
}"
.PHONY: push-doc
push-doc:
$(PWSH) -Command "& {\
Push-Location $(pages-path);\
git push;\
Pop-Location\
}"
.PHONY: targets
targets:
$(PWSH) -Command "& { Get-Content .\Makefile | Where-Object { $$_ -like '.PHONY*' } | ForEach-Object { $$_.Substring(8) } }"
.PHONY: clean
clean:
cabal clean
$(PWSH) -Command "& { Remove-Item src\Database\PostgreSQL\Pure\Internal\Builder.hs, src\Database\PostgreSQL\Pure\Internal\Parser.hs, src\Database\PostgreSQL\Pure\Internal\Length.hs }"