Commit 31f9b7bd authored by Jacques-Henri Jourdan's avatar Jacques-Henri Jourdan
Browse files

Use Iris's build system.

parent b5f04f02
*.v gitlab-language=coq
......@@ -9,5 +9,11 @@ Makefile.coq
# Makefile originally taken from coq-club
# Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony
+make -f Makefile.coq $@
+@make -f Makefile.coq $@
all: Makefile.coq
+make -f Makefile.coq all
+@make -f Makefile.coq all
.PHONY: all
clean: Makefile.coq
+make -f Makefile.coq clean
+@make -f Makefile.coq clean
find theories tests \( -name "*.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete || true
rm -f Makefile.coq
.PHONY: clean
# Create Coq Makefile.
Makefile.coq: _CoqProject Makefile
coq_makefile -f _CoqProject -o Makefile.coq
_CoqProject: ;
"$(COQBIN)coq_makefile" -f _CoqProject -o Makefile.coq
# Install build-dependencies
build-dep/opam: opam Makefile
@echo "# Creating build-dep package."
@mkdir -p build-dep
@sed <opam -E 's/^(build|install|remove):.*/\1: []/; s/^name: *"(.*)" */name: "\1-builddep"/' >build-dep/opam
@fgrep builddep build-dep/opam >/dev/null || (echo "sed failed to fix the package name" && exit 1) # sanity check
build-dep: build-dep/opam phony
@# We want opam to not just instal the build-deps now, but to also keep satisfying these
@# constraints. Otherwise, `opam upgrade` may well update some packages to versions
@# that are incompatible with our build requirements.
@# To achieve this, we create a fake opam package that has our build-dependencies as
@# dependencies, but does not actually install anything itself.
@echo "# Pinning build-dep package." && \
if opam --version | grep "^1\." -q; then \
BUILD_DEP_PACKAGE="$$(egrep "^name:" build-dep/opam | sed 's/^name: *"\(.*\)" */\1/')" && \
opam pin add -k path $(OPAMFLAGS) "$$BUILD_DEP_PACKAGE".dev build-dep && \
opam reinstall $(OPAMFLAGS) "$$BUILD_DEP_PACKAGE"; \
else \
opam install $(OPAMFLAGS) build-dep/; \
# Some files that do *not* need to be forwarded to Makefile.coq
Makefile: ;
_CoqProject: ;
opam: ;
# Phony wildcard targets
phony: ;
.PHONY: all clean phony
.PHONY: phony
......@@ -36,29 +36,10 @@ it as well:
# NOTE: this version of CoqIDE is only available if using opam 2.x
opam install coqide.8.9.1
### Step 3: Install a development version of Iris
### Step 3: Install Iris and TLC at the required versions
opam repo add iris-dev
opam update
opam pin add coq-iris -k version dev.2019-09-20.0.b958d569
(This will also install `coq-stdpp`, another Coq library made available through
the same repo.)
More info on the Coq development of Iris: [there][coq-iris].
### Step 4: Install TLC
The TLC library is required by the proof of the union-find algorithm. It is
available through an opam package in the Coq repository (added earlier).
opam pin add coq-tlc -k version 20181116
Alternatively, TLC can be installed from source:
git clone ''
( cd tlc && git checkout 4d7f23ce )
opam pin add coq-tlc -k path ./tlc
make build-dep
## Compiling
......@@ -67,7 +48,7 @@ To compile the Coq scripts:
make -j4
The first time (and each time `_CoqProject` is updated), it also creates the
file `Makefile.coq`.
files `Makefile.coq` and `Makefile.coq.conf`.
Other recipes are available, such as `all`, `clean` and `userinstall` (Makefile
taken from [here][coqproject]).
opam-version: "1.2"
name: "coq-iris-time"
maintainer: "Glen Mével"
authors: "Glen Mével, Jacques-Henri Jourdan, François Pottier, Arthur Charguéraud"
synopsis: "Iris with time credits and time credits"
bug-reports: ""
dev-repo: ""
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/" ]
depends: [
"coq-iris" { (= "dev.2019-09-20.0.b958d569") | (= "dev") }
"coq-tlc" { (= "20181116") | (= "dev") }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment