Skip to content

Commit ddae606

Browse files
authored
Merge pull request #105 from proux01/compile-make
Enable compilation with rocq makefile
2 parents f1dae92 + ed651fc commit ddae606

File tree

292 files changed

+651
-415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

292 files changed

+651
-415
lines changed

.github/workflows/basic-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@ jobs:
1212
uses: actions/checkout@v4
1313
- name: Check for duplicate files
1414
run: dev/tools/check-duplicate-files.sh
15+
- name: Check that All.v is up to date
16+
run: dev/tools/check-all.sh

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ ide/coqide/index_urls.txt
134134
.lia.cache
135135
.nia.cache
136136
.nra.cache
137+
theories/Makefile.coq
138+
theories/Makefile.coq.conf
137139

138140
# emacs save files
139141
*~

.nix/coq-overlays/stdlib-subcomponents/default.nix

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,12 @@ let
5959
propagatedBuildInputs = stdlib-deps;
6060
useDune = false;
6161
mlPlugin = true;
62-
} // (if component != "all" then {
62+
} // {
6363
buildPhase = ''
6464
make ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} build-${component}
6565
'';
6666
installPhase = ''
6767
make COQLIBINSTALL=$out/lib/coq/${coq.coq-version}/user-contrib install-${component}
6868
'';
69-
} else {
70-
buildPhase = ''
71-
echo "nothing left to build"
72-
'';
73-
installPhase = ''
74-
echo "nothing left to install"
75-
'';
76-
})) stdlib;
69+
}) stdlib;
7770
in stdlib_ "all"

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
DUNE=dev/with-rocq-wrap.sh dune
22

3-
all:
3+
all install:
4+
+$(MAKE) -C theories $@
5+
6+
dune:
47
$(DUNE) build -p rocq-stdlib @install
58

6-
install:
9+
dune-install:
710
$(DUNE) install --root . rocq-stdlib
811

912
build-% install-%:
1013
+$(MAKE) -C theories $@
1114

1215
# Make of individual .vo
1316
theories/%.vo:
14-
$(DUNE) build $@
17+
+$(MAKE) -C theories $*.vo
1518

1619
refman-html:
1720
$(DUNE) build --root . --no-buffer @refman-html

coq-stdlib.opam

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,10 @@ license: "LGPL-2.1-only"
99
homepage: "https://coq.inria.fr/"
1010
doc: "https://coq.github.io/doc/"
1111
bug-reports: "https://github.com/coq/stdlib/issues"
12+
dev-repo: "git+https://github.com/coq/stdlib.git"
1213
depends: [
13-
"dune" {>= "3.8"}
1414
"coq-core"
1515
"rocq-stdlib" {= version}
16-
"odoc" {with-doc}
1716
]
18-
dev-repo: "git+https://github.com/coq/stdlib.git"
1917
build: [
20-
["dune" "subst"] {dev}
21-
[
22-
"dev/with-rocq-wrap.sh"
23-
"dune"
24-
"build"
25-
"-p"
26-
name
27-
"-j"
28-
jobs
29-
"@install"
30-
"@runtest" {with-test}
31-
"@doc" {with-doc}
32-
]
3318
]

coq-stdlib.opam.template

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1+
depends: [
2+
"coq-core"
3+
"rocq-stdlib" {= version}
4+
]
15
build: [
2-
["dune" "subst"] {dev}
3-
[
4-
"dev/with-rocq-wrap.sh"
5-
"dune"
6-
"build"
7-
"-p"
8-
name
9-
"-j"
10-
jobs
11-
"@install"
12-
"@runtest" {with-test}
13-
"@doc" {with-doc}
14-
]
156
]

dev/doc/structure.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ How to Modify the Structure
3636

3737
When adding a file, it is enough to list it in the appropriate
3838
`theories/Make.*` file. Note that, for historical reasons, some
39-
directories are split between different subcomponents. In this case, a
40-
symlink must be added in the appropriate `_SubComponent` subdirectory
41-
and only the symlink must be listed in `theories/Make.*`. Look at
39+
directories are split between different subcomponents. In this case,
40+
the new line in the `theories/Make.*` file must contain the
41+
appropriate `_SubComponent` fake subdirectory. Look at
4242
`theories/Make.lists` for an example.
4343

4444
To add or remove a subcomponent, just add or remove the corresponding

dev/tools/check-all.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
# Check that theories/All/All.v is up to date
4+
5+
ALL_FILES=all_files__
6+
ACTUAL_FILES=actual_files__
7+
8+
rm -f ${ALL_FILES} ${ACTUAL_FILES}
9+
grep "Require" theories/All/All.v | sed -e 's/From.*Require.*Export.*[.]\([a-zA-Z]\)/\1/' | sort > ${ALL_FILES}
10+
(for f in $(find theories -name "*.v" -type f) ; do basename ${f%v} ; done) | grep -v "^All[.]$" | sort > ${ACTUAL_FILES}
11+
12+
if $(diff -q ${ALL_FILES} ${ACTUAL_FILES} > /dev/null) ; then
13+
echo "theories/All/All.v is up to date."
14+
else
15+
echo "Error: theories/All/All.v needs some update:"
16+
diff -u ${ALL_FILES} ${ACTUAL_FILES}
17+
exit 1
18+
fi
19+
20+
rm -f ${ALL_FILES} ${ACTUAL_FILES}

dev/tools/make-depends.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
#!/bin/bash
22

33
# this should be called from root as
4-
# % dune build -p rocq-stdlib
54
# % dev/tools/make-depends.sh
65

7-
THEORIES="_build/default/theories"
8-
if [ ! -d ${THEORIES} ] ; then
9-
echo "Error: ${THEORIES} doesn't exist, run first"
10-
echo "% dune build -p rocq-stdlib"
11-
exit 1
12-
fi
6+
THEORIES="theories"
137

148
declare -A FILE_PKG
159

@@ -42,10 +36,10 @@ done
4236
echo "node [shape=rectangle, style=filled, color=\"#ff540a\", URL=\"#\\N\"];";
4337
rocq dep -Q ${THEORIES} Stdlib ${THEORIES} | sed -n -e 's,/,.,g;s/[.]vo.*: [^ ]*v//p' | \
4438
while read src dst; do
45-
src=${src#_build.default.theories.}
39+
src=${src#theories.}
4640
srcf="$(echo ${src%.vo} | tr '.' '/').v"
4741
for d in $dst; do
48-
d=${d#_build.default.theories.}
42+
d=${d#theories.}
4943
df="$(echo ${d%.vo} | tr '.' '/').v"
5044
if [ -z ${FILE_PKG[${df}]:-""} ] ; then continue ; fi
5145
# File dependencies

doc/stdlib/index-list.html.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,4 +694,11 @@ through the <tt>From Stdlib Require Import</tt> command.</p>
694694
theories/Compat/AdmitAxiom.v
695695
theories/Compat/Stdlib818.v
696696
</dd>
697+
698+
<dt> <a name="all"></a><b>All</b>:
699+
Require the whole Stdlib
700+
</dt>
701+
<dd>
702+
(theories/All/All.v)
703+
</dd>
697704
</dl>

0 commit comments

Comments
 (0)