-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (68 loc) · 1.8 KB
/
Makefile
File metadata and controls
95 lines (68 loc) · 1.8 KB
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
HS_FILES := $(shell git ls-files '*.hs')
# BUILD_TOOL selects the Haskell build tool: cabal (default) or stack.
BUILD_TOOL ?= cabal
# --- Shared ---
.PHONY: format
format:
@test -n "$(HS_FILES)" || { echo "No tracked .hs files found"; exit 0; }
fourmolu -i $(HS_FILES)
.PHONY: format-check
format-check:
@test -n "$(HS_FILES)" || { echo "No tracked .hs files found"; exit 0; }
fourmolu -m check $(HS_FILES)
# --- Cabal ---
.PHONY: cabal-check
cabal-check:
cabal check
.PHONY: cabal-update
cabal-update:
cabal update
.PHONY: cabal-configure
cabal-configure:
cabal configure --enable-tests --enable-benchmarks --disable-documentation $(CABAL_CONFIGURE_FLAGS)
cabal build --dry-run
.PHONY: cabal-deps
cabal-deps:
cabal build --only-dependencies
.PHONY: cabal-build
cabal-build:
cabal build all
.PHONY: cabal-test
cabal-test:
cabal test all
.PHONY: cabal-docs
cabal-docs:
cabal haddock all --disable-documentation
.PHONY: cabal-ci
cabal-ci: format-check cabal-check cabal-update cabal-configure cabal-deps cabal-build cabal-test cabal-docs
# --- Stack ---
.PHONY: stack-update
stack-update:
stack update
.PHONY: stack-deps
stack-deps:
stack build --only-dependencies --test --no-run-tests
.PHONY: stack-build
stack-build:
stack build
.PHONY: stack-test
stack-test:
stack test
.PHONY: stack-docs
stack-docs:
stack haddock --no-haddock-deps
.PHONY: stack-ci
stack-ci: format-check stack-update stack-deps stack-build stack-test stack-docs
# ── Generic (delegates to BUILD_TOOL) ────────────────────────────────
.PHONY: update
update: $(BUILD_TOOL)-update
.PHONY: deps
deps: $(BUILD_TOOL)-deps
.PHONY: build
build: $(BUILD_TOOL)-build
.PHONY: test
test: $(BUILD_TOOL)-test
.PHONY: docs
docs: $(BUILD_TOOL)-docs
.PHONY: ci
ci: $(BUILD_TOOL)-ci