1 .PHONY
: all lexer sdpx lib exe doctest
4 CABALBUILD
:= cabal v2-build
5 CABALRUN
:= cabal v2-run
12 $(CABALBUILD
) Cabal
:libs
15 $(CABALBUILD
) cabal-install
:exes
17 # Build library with oldest supported GHC
19 $(CABALBUILD
) --project-file
=cabal.project.libonly
--with-compiler
=ghc-7.6
.3 Cabal
:libs
22 $(CABALBUILD
) --project-file
=cabal.project.libonly
--with-compiler
=ghc-7.8
.4 Cabal
:libs
24 # source generation: Lexer
26 LEXER_HS
:=Cabal
/src
/Distribution
/Fields
/Lexer.hs
30 $(LEXER_HS
) : templates
/Lexer.x
31 alex
--latin1
--ghc
-o
$@
$^
35 # source generation: SPDX
37 SPDX_LICENSE_HS
:=Cabal
/src
/Distribution
/SPDX
/LicenseId.hs
38 SPDX_EXCEPTION_HS
:=Cabal
/src
/Distribution
/SPDX
/LicenseExceptionId.hs
40 spdx
: $(SPDX_LICENSE_HS
) $(SPDX_EXCEPTION_HS
)
42 SPDX_LICENSE_VERSIONS
:=3.0 3.2 3.6 3.9 3.10
44 $(SPDX_LICENSE_HS
) : templates
/SPDX.LicenseId.template.hs cabal-dev-scripts
/src
/GenUtils.hs cabal-dev-scripts
/src
/GenSPDX.hs license-list-data
/licenses-3.0.json license-list-data
/licenses-3.2.json
45 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-spdx
-- templates
/SPDX.LicenseId.template.hs
$(SPDX_LICENSE_VERSIONS
:%=license-list-data
/licenses-
%.json
) $(SPDX_LICENSE_HS
)
47 $(SPDX_EXCEPTION_HS
) : templates
/SPDX.LicenseExceptionId.template.hs cabal-dev-scripts
/src
/GenUtils.hs cabal-dev-scripts
/src
/GenSPDXExc.hs license-list-data
/exceptions-3.0.json license-list-data
/exceptions-3.2.json
48 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-spdx-exc
-- templates
/SPDX.LicenseExceptionId.template.hs
$(SPDX_LICENSE_VERSIONS
:%=license-list-data
/exceptions-
%.json
) $(SPDX_EXCEPTION_HS
)
50 # source generation: templates
52 TEMPLATE_MACROS
:=Cabal
/src
/Distribution
/Simple
/Build
/Macros
/Z.hs
53 TEMPLATE_PATHS
:=Cabal
/src
/Distribution
/Simple
/Build
/PathsModule
/Z.hs
55 templates
: phony
$(TEMPLATE_MACROS
) $(TEMPLATE_PATHS
)
57 $(TEMPLATE_MACROS
) : templates
/cabal_macros.template.h cabal-dev-scripts
/src
/GenCabalMacros.hs
58 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-cabal-macros
-- $< $@
60 $(TEMPLATE_PATHS
) : templates
/Paths_pkg.template.hs cabal-dev-scripts
/src
/GenPathsModule.hs
61 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-paths-module
-- $< $@
65 buildinfo-fields-reference
: phony
66 cabal build
--builddir
=dist-newstyle-bi
--project-file
=cabal.project.buildinfo buildinfo-reference-generator
67 $$(cabal list-bin
--builddir
=dist-newstyle-bi buildinfo-reference-generator
) buildinfo-reference-generator
/template.zinza | tee
$@
70 analyse-imports
: phony
71 find Cabal
/src cabal-install
/src
-type f
-name
'*.hs' | xargs cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta analyse-imports
--
74 github-actions
: .github
/workflows
/artifacts.yml
75 github-actions
: .github
/workflows
/quick-jobs.yml
76 github-actions
: .github
/workflows
/bootstrap.yml
77 github-actions
: .github
/workflows
/linux.yml
78 github-actions
: .github
/workflows
/macos.yml
79 github-actions
: .github
/workflows
/windows.yml
81 .github
/workflows
/%.yml
: templates
/ci-
%.template.yml cabal-dev-scripts
/src
/GenValidate.hs
82 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-validate
-- $< $@
87 ghcid
-c
'cabal v2-repl Cabal'
90 ghcid
-c
'cabal v2-repl cabal-install'
92 # doctests (relies on .ghc.environment files)
95 doctest
--fast Cabal
/src
97 # This is not run as part of validate.sh (we need hackage-security, which is tricky to get).
99 doctest
-D__DOCTEST__
--fast cabal-install
/src cabal-install-solver
/src cabal-install-solver
/src-assertion
104 $(CABALRUN
) check-tests
-- --cwd Cabal-tests
${TEST}
107 $(CABALRUN
) parser-tests
-- --cwd Cabal-tests
${TEST}
109 parser-tests-accept
:
110 $(CABALRUN
) parser-tests
-- --cwd Cabal-tests
--accept
${TEST}
113 $(CABALRUN
) custom-setup-tests
--
115 hackage-parsec-tests
:
116 $(CABALRUN
) hackage-tests
-- parsec
+RTS
-s
-qg
-I0
-A64M
-N
${THREADS} -RTS
${TEST}
118 hackage-roundtrip-tests
:
119 $(CABALRUN
) hackage-tests
-- roundtrip
+RTS
-s
-qg
-I0
-A64M
-N
${THREADS} -RTS
${TEST}
122 $(CABALBUILD
) -j3 cabal-tests cabal
123 rm -rf .ghc.environment.
*
124 cd cabal-testsuite
&& `cabal list-bin cabal-tests` --with-cabal
=`cabal list-bin cabal` --hide-successes
-j3
${TEST}
126 # hackage-benchmarks (solver)
128 hackage-benchmarks-run
:
129 $(CABALBUILD
) -j3 hackage-benchmark cabal
130 rm -rf .ghc.environment.
*
131 $$(cabal list-bin hackage-benchmark
) --cabal1
=cabal
--cabal2
=$$(cabal list-bin cabal
) --packages
="hakyll servant-auth-server" --print-trials
--concurrently
134 # This doesn't run build, as you first need to test with cabal-install-test :)
135 cabal-install-test-accept
:
136 rm -rf .ghc.environment.
*
137 cd cabal-testsuite
&& `cabal list-bin cabal-tests` --with-cabal
=`cabal list-bin cabal` --hide-successes
-j3
--accept
${TEST}
141 # Use this carefully, on big machine you can say
143 # make validate-via-docker-all -j4 -O
145 validate-via-docker-all
: validate-via-docker-7.6
.3
146 validate-via-docker-all
: validate-via-docker-7.8
.4
147 validate-via-docker-all
: validate-via-docker-7.10
.3
148 validate-via-docker-all
: validate-via-docker-8.0
.2
149 validate-via-docker-all
: validate-via-docker-8.2
.2
150 validate-via-docker-all
: validate-via-docker-8.4
.4
151 validate-via-docker-all
: validate-via-docker-8.6
.5
152 validate-via-docker-all
: validate-via-docker-8.8
.4
153 validate-via-docker-all
: validate-via-docker-8.10
.4
155 validate-dockerfiles
: .docker
/validate-8.10
.4.dockerfile
156 validate-dockerfiles
: .docker
/validate-8.8
.4.dockerfile
157 validate-dockerfiles
: .docker
/validate-8.6
.5.dockerfile
158 validate-dockerfiles
: .docker
/validate-8.4
.4.dockerfile
159 validate-dockerfiles
: .docker
/validate-8.2
.2.dockerfile
160 validate-dockerfiles
: .docker
/validate-8.6
.5.dockerfile
161 validate-dockerfiles
: .docker
/validate-7.10
.3.dockerfile
162 validate-dockerfiles
: .docker
/validate-7.8
.4.dockerfile
163 validate-dockerfiles
: .docker
/validate-7.6
.3.dockerfile
165 .docker
/validate-
%.dockerfile
: .docker
/validate.dockerfile.zinza cabal-dev-scripts
/src
/GenValidateDockerfile.hs
166 cabal v2-run
--builddir
=dist-newstyle-meta
--project-file
=cabal.project.meta gen-validate-dockerfile
-- $* $< $@
168 # This is good idea anyway
169 # and we have a test relying on this limit being sufficiently small
170 DOCKERARGS
:=--ulimit nofile
=1024:1024
172 validate-via-docker-7.6
.3:
173 docker build
$(DOCKERARGS
) -t cabal-validate
:7.6.3 -f .docker
/validate-7.6
.3.dockerfile .
175 validate-via-docker-7.8
.4:
176 docker build
$(DOCKERARGS
) -t cabal-validate
:7.8.4 -f .docker
/validate-7.8
.4.dockerfile .
178 validate-via-docker-7.10
.3:
179 docker build
$(DOCKERARGS
) -t cabal-validate
:7.10.3 -f .docker
/validate-7.10
.3.dockerfile .
181 validate-via-docker-8.0
.2:
182 docker build
$(DOCKERARGS
) -t cabal-validate
:8.0.2 -f .docker
/validate-8.0
.2.dockerfile .
184 validate-via-docker-8.2
.2:
185 docker build
$(DOCKERARGS
) -t cabal-validate
:8.2.2 -f .docker
/validate-8.2
.2.dockerfile .
187 validate-via-docker-8.4
.4:
188 docker build
$(DOCKERARGS
) -t cabal-validate
:8.4.4 -f .docker
/validate-8.4
.4.dockerfile .
190 validate-via-docker-8.6
.5:
191 docker build
$(DOCKERARGS
) -t cabal-validate
:8.6.5 -f .docker
/validate-8.6
.5.dockerfile .
193 validate-via-docker-8.8
.4:
194 docker build
$(DOCKERARGS
) -t cabal-validate
:8.8.4 -f .docker
/validate-8.8
.4.dockerfile .
196 validate-via-docker-8.10
.4:
197 docker build
$(DOCKERARGS
) -t cabal-validate
:8.10.4 -f .docker
/validate-8.10
.4.dockerfile .
199 validate-via-docker-old
:
200 docker build
$(DOCKERARGS
) -t cabal-validate
:older
-f .docker
/validate-old.dockerfile .
204 cabal build
all --project-file
=cabal.project.weeder
210 hasktags
-b Cabal
/src Cabal-described
/src cabal-install
/src cabal-testsuite
/src
213 ##############################################################################
215 bootstrap-plans-linux
: phony
216 @if
[ $$(uname
) != "Linux" ]; then echo
"Not Linux"; false
; fi
217 cabal v2-build
--project
=cabal.project.release
--with-compiler ghc-8.6
.5 --dry-run cabal-install
:exe
:cabal
218 cp dist-newstyle
/cache
/plan.json bootstrap
/linux-8.6
.5.plan.json
219 cabal v2-build
--project
=cabal.project.release
--with-compiler ghc-8.8
.4 --dry-run cabal-install
:exe
:cabal
220 cp dist-newstyle
/cache
/plan.json bootstrap
/linux-8.8
.4.plan.json
221 cabal v2-build
--project
=cabal.project.release
--with-compiler ghc-8.10
.4 --dry-run cabal-install
:exe
:cabal
222 cp dist-newstyle
/cache
/plan.json bootstrap
/linux-8.10
.4.plan.json
224 bootstrap-jsons-linux
: phony
225 @if
[ $$(uname
) != "Linux" ]; then echo
"Not Linux"; false
; fi
226 cabal v2-build
--builddir
=dist-newstyle-bootstrap
--project
=cabal.project.bootstrap cabal-bootstrap-gen
227 cabal v2-run
-vnormal
+stderr
--builddir
=dist-newstyle-bootstrap
--project
=cabal.project.bootstrap cabal-bootstrap-gen
-- bootstrap
/linux-8.6
.5.plan.json | python3
-m json.tool | tee bootstrap
/linux-8.6
.5.json
228 cabal v2-run
-vnormal
+stderr
--builddir
=dist-newstyle-bootstrap
--project
=cabal.project.bootstrap cabal-bootstrap-gen
-- bootstrap
/linux-8.8
.4.plan.json | python3
-m json.tool | tee bootstrap
/linux-8.8
.4.json
229 cabal v2-run
-vnormal
+stderr
--builddir
=dist-newstyle-bootstrap
--project
=cabal.project.bootstrap cabal-bootstrap-gen
-- bootstrap
/linux-8.10
.4.plan.json | python3
-m json.tool | tee bootstrap
/linux-8.10
.4.json
232 ##############################################################################
234 # TODO: when we have sphinx-build2 ?
235 SPHINXCMD
:=sphinx-build
236 # Flag -n ("nitpick") warns about broken references
237 # Flag -W turns warnings into errors
238 # Flag --keep-going continues after errors
239 SPHINX_FLAGS
:=-n
-W
--keep-going
-E
240 SPHINX_HTML_OUTDIR
:=dist-newstyle
/doc
/users-guide
241 USERGUIDE_STAMP
:=$(SPHINX_HTML_OUTDIR
)/index.html
243 # do pip install everytime so we have up to date requirements when we build
244 users-guide
: .python-sphinx-virtualenv
$(USERGUIDE_STAMP
)
245 $(USERGUIDE_STAMP
) : doc
/*.rst
246 mkdir
-p
$(SPHINX_HTML_OUTDIR
)
247 (. .
/.python-sphinx-virtualenv
/bin
/activate
&& pip
install -r doc
/requirements.txt
&& $(SPHINXCMD
) $(SPHINX_FLAGS
) doc
$(SPHINX_HTML_OUTDIR
))
249 .python-sphinx-virtualenv
:
250 python3
-m venv .python-sphinx-virtualenv
251 (. .
/.python-sphinx-virtualenv
/bin
/activate
)