@@ -12,55 +12,55 @@ DOCTEST := cabal doctest --allow-newer=False
12
12
# default rules
13
13
14
14
.PHONY : all
15
- all : exe lib
15
+ all : help-banner exe lib # # Build the Cabal libraries and cabal-install executables.
16
16
17
17
.PHONY : lib
18
- lib :
18
+ lib : # # Builds the Cabal libraries.
19
19
$(CABALBUILD ) Cabal:libs
20
20
21
21
.PHONY : exe
22
- exe :
22
+ exe : # # Builds the cabal-install executables.
23
23
$(CABALBUILD ) cabal-install:exes
24
24
25
25
.PHONY : init
26
- init : # # Set up git hooks and ignored revisions
26
+ init : # # Set up git hooks and ignored revisions.
27
27
@git config core.hooksPath .githooks
28
28
# # TODO
29
29
30
30
.PHONY : style
31
- style : # # Run the code styler
31
+ style : # # Run the code styler.
32
32
@fourmolu -q -i Cabal Cabal-syntax cabal-install cabal-validate
33
33
34
34
.PHONY : style-modified
35
- style-modified : # # Run the code styler on modified files
35
+ style-modified : # # Run the code styler on modified files.
36
36
@git ls-files --modified Cabal Cabal-syntax cabal-install cabal-validate \
37
37
| grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
38
38
39
39
.PHONY : style-commit
40
- style-commit : # # Run the code styler on the previous commit
40
+ style-commit : # # Run the code styler on the previous commit.
41
41
@git diff --name-only HEAD $(COMMIT ) Cabal Cabal-syntax cabal-install cabal-validate \
42
42
| grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
43
43
44
44
.PHONY : whitespace
45
- whitespace : # # Run fix-whitespace in check mode
45
+ whitespace : # # Run fix-whitespace in check mode.
46
46
fix-whitespace --check --verbose
47
47
48
48
.PHONY : fix-whitespace
49
- fix-whitespace : # # Run fix-whitespace in fix mode
49
+ fix-whitespace : # # Run fix-whitespace in fix mode.
50
50
fix-whitespace --verbose
51
51
52
52
.PHONY : lint
53
- lint : # # Run HLint
53
+ lint : # # Run HLint.
54
54
hlint -j .
55
55
56
56
.PHONY : lint-json
57
- lint-json : # # Run HLint in JSON mode
57
+ lint-json : # # Run HLint in JSON mode.
58
58
hlint -j --json -- .
59
59
60
60
# local checks
61
61
62
62
.PHONY : checks
63
- checks : whitespace users-guide-typos markdown-typos style lint-json
63
+ checks : whitespace users-guide-typos markdown-typos style lint-json # # Run all local checks; whitespace, typos, style, and lint.
64
64
65
65
# source generation: SPDX
66
66
@@ -116,15 +116,15 @@ analyse-imports :
116
116
# ghcid
117
117
118
118
.PHONY : ghcid-lib
119
- ghcid-lib :
119
+ ghcid-lib : # # Run ghcid for the Cabal library.
120
120
ghcid -c ' cabal repl Cabal'
121
121
122
122
.PHONY : ghcid-cli
123
- ghcid-cli :
123
+ ghcid-cli : # # Run ghcid for the cabal-install executable.
124
124
ghcid -c ' cabal repl cabal-install'
125
125
126
126
.PHONY : doctest
127
- doctest :
127
+ doctest : # # Run doctests.
128
128
cd Cabal-syntax && $(DOCTEST )
129
129
cd Cabal-described && $(DOCTEST )
130
130
cd Cabal && $(DOCTEST )
@@ -137,7 +137,7 @@ doctest-cli :
137
137
doctest -D__DOCTEST__ --fast cabal-install/src cabal-install-solver/src cabal-install-solver/src-assertion
138
138
139
139
.PHONY : doctest-install
140
- doctest-install :
140
+ doctest-install : # # Install doctest tool needed for running doctests.
141
141
cabal install doctest --overwrite-policy=always --ignore-project --flag cabal-doctest
142
142
143
143
# tests
@@ -234,7 +234,7 @@ validate-via-docker-old:
234
234
235
235
# tags
236
236
.PHONY : tags
237
- tags :
237
+ tags : # # Generate editor tags, vim ctags and emacs etags.
238
238
hasktags -b Cabal-syntax/src Cabal/src Cabal-described/src cabal-install/src cabal-testsuite/src
239
239
240
240
# bootstrapping
@@ -256,11 +256,11 @@ bootstrap-jsons: $(BOOTSTRAP_GHC_VERSIONS:%=bootstrap-json-%)
256
256
# #############################################################################
257
257
258
258
.PHONY : users-guide
259
- users-guide :
259
+ users-guide : # # Build the users guide.
260
260
$(MAKE ) -C doc users-guide
261
261
262
262
.PHONY : users-guide-requirements
263
- users-guide-requirements :
263
+ users-guide-requirements : # # Install the requirements for building the users guide.
264
264
$(MAKE ) -C doc users-guide-requirements
265
265
266
266
ifeq ($(shell uname) , Darwin)
@@ -269,6 +269,18 @@ else
269
269
PROCS := $(shell nproc)
270
270
endif
271
271
272
+ PHONY : help
273
+ help : # # Show the commented targets.
274
+ @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | \
275
+ sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
276
+
277
+ PHONY : help-banner
278
+ help-banner : # # Show the help banner.
279
+ @echo " ===================================================================="
280
+ @echo " § all make with no arguments also shows this banner"
281
+ @echo " § help make help will list targets with descriptions"
282
+ @echo " ===================================================================="
283
+
272
284
.PHONY : typos-install
273
285
typos-install : # # Install typos-cli for typos target using cargo
274
286
cargo install typos-cli
0 commit comments