Skip to content

Commit e600087

Browse files
committed
Makefile: remove dead target 'lexer', use '.PHONY' systematically
The `lexer` target was removed in #8980
1 parent c209a82 commit e600087

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

.github/workflows/quick-jobs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ jobs:
4343
# ghcup set ghc recommended
4444
- name: Update Hackage index
4545
run: cabal v2-update
46-
- name: Install alex
47-
run: cabal v2-install alex --constraint='alex >=3.2.7.3'
48-
- run: alex --version
4946
- uses: actions/checkout@v4
5047
- name: Regenerate files
5148
run: |
52-
make -B lexer
5349
make -B spdx
5450
make -B templates
5551
- name: Check that diff is clean

Makefile

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
.PHONY : all lexer sdpx lib exe doctest
2-
.PHONY : phony
1+
.PHONY: phony
2+
# Adding dependency "phony" is like declaring a target as ".PHONY":
3+
# See https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
34

45
CABALBUILD := cabal build
56
CABALRUN := cabal run
@@ -13,25 +14,32 @@ DOCTEST := cabal repl --with-ghc=doctest --repl-options="-w" --ghc-options="-Wwa
1314

1415
# default rules
1516

17+
.PHONY: all
1618
all : exe lib
1719

18-
lib : $(LEXER_HS)
20+
.PHONY: lib
21+
lib :
1922
$(CABALBUILD) Cabal:libs
2023

21-
exe : $(LEXER_HS)
24+
.PHONY: exe
25+
exe :
2226
$(CABALBUILD) cabal-install:exes
2327

28+
.PHONY: init
2429
init: ## Set up git hooks and ignored revisions
2530
@git config core.hooksPath .githooks
2631
## TODO
2732

33+
.PHONY: style
2834
style: ## Run the code styler
2935
@fourmolu -q -i Cabal Cabal-syntax cabal-install
3036

37+
.PHONY: style-modified
3138
style-modified: ## Run the code styler on modified files
3239
@git ls-files --modified Cabal Cabal-syntax cabal-install \
3340
| grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
3441

42+
.PHONY: style-commit
3543
style-commit: ## Run the code styler on the previous commit
3644
@git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install \
3745
| grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {}
@@ -41,6 +49,7 @@ style-commit: ## Run the code styler on the previous commit
4149
SPDX_LICENSE_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseId.hs
4250
SPDX_EXCEPTION_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs
4351

52+
.PHONY: spdx
4453
spdx : $(SPDX_LICENSE_HS) $(SPDX_EXCEPTION_HS)
4554

4655
SPDX_LICENSE_VERSIONS:=3.0 3.2 3.6 3.9 3.10 3.16
@@ -56,7 +65,8 @@ $(SPDX_EXCEPTION_HS) : templates/SPDX.LicenseExceptionId.template.hs cabal-dev-s
5665
TEMPLATE_MACROS:=Cabal/src/Distribution/Simple/Build/Macros/Z.hs
5766
TEMPLATE_PATHS:=Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
5867

59-
templates : phony $(TEMPLATE_MACROS) $(TEMPLATE_PATHS)
68+
.PHONY: templates
69+
templates : $(TEMPLATE_MACROS) $(TEMPLATE_PATHS)
6070

6171
$(TEMPLATE_MACROS) : templates/cabal_macros.template.h cabal-dev-scripts/src/GenCabalMacros.hs
6272
cabal run --builddir=dist-newstyle-meta --project-file=cabal.project.meta gen-cabal-macros -- $< $@
@@ -75,18 +85,21 @@ doc/buildinfo-fields-reference.rst : \
7585
cabal run buildinfo-reference-generator buildinfo-reference-generator/template.zinza | tee $@
7686
git diff --exit-code $@
7787

78-
# analyse-imports
79-
analyse-imports : phony
88+
.PHONY: analyse-imports
89+
analyse-imports :
8090
find Cabal-syntax/src Cabal/src cabal-install/src -type f -name '*.hs' | xargs cabal run --builddir=dist-newstyle-meta --project-file=cabal.project.meta analyse-imports --
8191

8292
# ghcid
8393

94+
.PHONY: ghcid-lib
8495
ghcid-lib :
8596
ghcid -c 'cabal repl Cabal'
8697

98+
.PHONY: ghcid-cli
8799
ghcid-cli :
88100
ghcid -c 'cabal repl cabal-install'
89101

102+
.PHONY: doctest
90103
doctest :
91104
$(DOCTEST) Cabal-syntax
92105
$(DOCTEST) Cabal-described
@@ -95,46 +108,57 @@ doctest :
95108
$(DOCTEST) cabal-install
96109

97110
# This is not run as part of validate.sh (we need hackage-security, which is tricky to get).
111+
.PHONY: doctest-cli
98112
doctest-cli :
99113
doctest -D__DOCTEST__ --fast cabal-install/src cabal-install-solver/src cabal-install-solver/src-assertion
100114

115+
.PHONY: doctest-install
101116
doctest-install:
102117
cabal install doctest --overwrite-policy=always --ignore-project
103118

104119
# tests
105120

121+
.PHONY: check-tests
106122
check-tests :
107123
$(CABALRUN) check-tests -- --cwd Cabal-tests ${TEST}
108124

125+
.PHONY: parser-tests
109126
parser-tests :
110127
$(CABALRUN) parser-tests -- --cwd Cabal-tests ${TEST}
111128

129+
.PHONY: parser-tests-accept
112130
parser-tests-accept :
113131
$(CABALRUN) parser-tests -- --cwd Cabal-tests --accept ${TEST}
114132

133+
.PHONY: custom-setup-tests
115134
custom-setup-tests :
116135
$(CABALRUN) custom-setup-tests --
117136

137+
.PHONY: hackage-parsec-tests
118138
hackage-parsec-tests :
119139
$(CABALRUN) hackage-tests -- parsec +RTS -s -qg -I0 -A64M -N${THREADS} -RTS ${TEST}
120140

141+
.PHONY: hackage-rountrip-tests
121142
hackage-roundtrip-tests :
122143
$(CABALRUN) hackage-tests -- roundtrip +RTS -s -qg -I0 -A64M -N${THREADS} -RTS ${TEST}
123144

145+
.PHONY: cabal-install-test
124146
cabal-install-test:
125147
$(CABALBUILD) -j3 cabal-tests cabal
126148
rm -rf .ghc.environment.*
127149
cd cabal-testsuite && `cabal list-bin cabal-tests` --with-cabal=`cabal list-bin cabal` --hide-successes -j3 ${TEST}
128150

129151
# hackage-benchmarks (solver)
130152

153+
.PHONY: hackage-benchmarks-run
131154
hackage-benchmarks-run:
132155
$(CABALBUILD) -j3 hackage-benchmark cabal
133156
rm -rf .ghc.environment.*
134157
$$(cabal list-bin hackage-benchmark) --cabal1=cabal --cabal2=$$(cabal list-bin cabal) --packages="hakyll servant-auth-server" --print-trials --concurrently
135158

136159

137160
# This doesn't run build, as you first need to test with cabal-install-test :)
161+
.PHONY: cabal-install-test-accept
138162
cabal-install-test-accept:
139163
rm -rf .ghc.environment.*
140164
cd cabal-testsuite && `cabal list-bin cabal-tests` --with-cabal=`cabal list-bin cabal` --hide-successes -j3 --accept ${TEST}
@@ -145,12 +169,14 @@ cabal-install-test-accept:
145169
#
146170
# make validate-via-docker-all -j4 -O
147171
#
172+
.PHONY: validate-via-docker-all
148173
validate-via-docker-all : validate-via-docker-8.2.2
149174
validate-via-docker-all : validate-via-docker-8.4.4
150175
validate-via-docker-all : validate-via-docker-8.6.5
151176
validate-via-docker-all : validate-via-docker-8.8.4
152177
validate-via-docker-all : validate-via-docker-8.10.4
153178

179+
.PHONY: validate-dockerfiles
154180
validate-dockerfiles : .docker/validate-8.10.4.dockerfile
155181
validate-dockerfiles : .docker/validate-8.8.4.dockerfile
156182
validate-dockerfiles : .docker/validate-8.6.5.dockerfile
@@ -164,21 +190,27 @@ validate-dockerfiles : .docker/validate-8.2.2.dockerfile
164190
# and we have a test relying on this limit being sufficiently small
165191
DOCKERARGS:=--ulimit nofile=1024:1024
166192

193+
.PHONY: validate-via-docker-8.2.2
167194
validate-via-docker-8.2.2:
168195
docker build $(DOCKERARGS) -t cabal-validate:8.2.2 -f .docker/validate-8.2.2.dockerfile .
169196

197+
.PHONY: validate-via-docker-8.4.4
170198
validate-via-docker-8.4.4:
171199
docker build $(DOCKERARGS) -t cabal-validate:8.4.4 -f .docker/validate-8.4.4.dockerfile .
172200

201+
.PHONY: validate-via-docker-8.6.5
173202
validate-via-docker-8.6.5:
174203
docker build $(DOCKERARGS) -t cabal-validate:8.6.5 -f .docker/validate-8.6.5.dockerfile .
175204

205+
.PHONY: validate-via-docker-8.8.4
176206
validate-via-docker-8.8.4:
177207
docker build $(DOCKERARGS) -t cabal-validate:8.8.4 -f .docker/validate-8.8.4.dockerfile .
178208

209+
.PHONY: validate-via-docker-8.10.4
179210
validate-via-docker-8.10.4:
180211
docker build $(DOCKERARGS) -t cabal-validate:8.10.4 -f .docker/validate-8.10.4.dockerfile .
181212

213+
.PHONY: validate-via-docker-old
182214
validate-via-docker-old:
183215
docker build $(DOCKERARGS) -t cabal-validate:older -f .docker/validate-old.dockerfile .
184216

@@ -199,6 +231,7 @@ bootstrap-json-%: phony
199231

200232
BOOTSTRAP_GHC_VERSIONS := 8.10.7 9.0.2 9.2.7 9.4.4
201233

234+
.PHONY: bootstrap-jsons
202235
bootstrap-jsons: $(BOOTSTRAP_GHC_VERSIONS:%=bootstrap-json-%)
203236

204237
# documentation

0 commit comments

Comments
 (0)