Skip to content
Snippets Groups Projects
Commit 3ed6ae06 authored by Ralf Jung's avatar Ralf Jung
Browse files

update build system

parent 65bd2aff
No related branches found
No related tags found
No related merge requests found
Pipeline #39032 failed
...@@ -33,6 +33,6 @@ Makefile.coq.conf ...@@ -33,6 +33,6 @@ Makefile.coq.conf
.Makefile.coq.d .Makefile.coq.d
*.crashcoqide *.crashcoqide
.coqdeps.d .coqdeps.d
build-dep builddep
_opam _opam
.lia.cache .lia.cache
# Default target
all: Makefile.coq
+@$(MAKE) -f Makefile.coq all
.PHONY: all
# Permit local customization # Permit local customization
-include Makefile.local -include Makefile.local
# Forward most targets to Coq makefile (with some trick to make this phony) # Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony %: Makefile.coq phony
+@make -f Makefile.coq $@ @#echo "Forwarding $@"
+@$(MAKE) -f Makefile.coq $@
all: Makefile.coq phony: ;
+@make -f Makefile.coq all .PHONY: phony
.PHONY: all
clean: Makefile.coq clean: Makefile.coq
+@make -f Makefile.coq clean +@$(MAKE) -f Makefile.coq clean
find theories tests exercises solutions \( -name "*.d" -o -name "*.vo" -o -name "*.vo[sk]" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete || true @# Make sure not to enter the `_opam` folder.
rm -f Makefile.coq .lia.cache find [a-z]*/ \( -name "*.d" -o -name "*.vo" -o -name "*.vo[sk]" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete || true
rm -f Makefile.coq .lia.cache builddep/*
.PHONY: clean .PHONY: clean
# Create Coq Makefile. # Create Coq Makefile.
...@@ -20,27 +25,31 @@ Makefile.coq: _CoqProject Makefile ...@@ -20,27 +25,31 @@ Makefile.coq: _CoqProject Makefile
"$(COQBIN)coq_makefile" -f _CoqProject -o Makefile.coq $(EXTRA_COQFILES) "$(COQBIN)coq_makefile" -f _CoqProject -o Makefile.coq $(EXTRA_COQFILES)
# Install build-dependencies # Install build-dependencies
build-dep/opam: opam Makefile OPAMFILES=$(wildcard *.opam)
@echo "# Creating build-dep package." BUILDDEPFILES=$(addsuffix -builddep.opam, $(addprefix builddep/,$(basename $(OPAMFILES))))
@mkdir -p build-dep
@sed <opam -E 's/^(build|install|remove):.*/\1: []/; s/^name: *"(.*)" */name: "\1-builddep"/' >build-dep/opam builddep/%-builddep.opam: %.opam Makefile
@fgrep builddep build-dep/opam >/dev/null || (echo "sed failed to fix the package name" && exit 1) # sanity check @echo "# Creating builddep package for $<."
@mkdir -p builddep
build-dep: build-dep/opam phony @sed <$< -E 's/^(build|install|remove):.*/\1: []/; s/"(.*)"(.*= *version.*)$$/"\1-builddep"\2/;' >$@
@# We want opam to not just instal the build-deps now, but to also keep satisfying these
builddep-opamfiles: $(BUILDDEPFILES)
.PHONY: builddep-opamfiles
builddep: builddep-opamfiles
@# We want opam to not just install the build-deps now, but to also keep satisfying these
@# constraints. Otherwise, `opam upgrade` may well update some packages to versions @# constraints. Otherwise, `opam upgrade` may well update some packages to versions
@# that are incompatible with our build requirements. @# that are incompatible with our build requirements.
@# To achieve this, we create a fake opam package that has our build-dependencies as @# To achieve this, we create a fake opam package that has our build-dependencies as
@# dependencies, but does not actually install anything itself. @# dependencies, but does not actually install anything itself.
@echo "# Installing build-dep package." @echo "# Installing builddep packages."
@opam install $(OPAMFLAGS) build-dep/ @opam install $(OPAMFLAGS) $(BUILDDEPFILES)
.PHONY: builddep
# Some files that do *not* need to be forwarded to Makefile.coq # Backwards compatibility target
Makefile: ; build-dep: builddep
_CoqProject: ; .PHONY: build-dep
opam: ;
Makefile.local: ;
# Phony wildcard targets # Some files that do *not* need to be forwarded to Makefile.coq.
phony: ; # ("::" lets Makefile.local overwrite this.)
.PHONY: phony Makefile Makefile.local _CoqProject $(OPAMFILES):: ;
opam-version: "2.0" opam-version: "2.0"
name: "coq-iris-tutorial-popl18"
maintainer: "The Iris Organization" maintainer: "The Iris Organization"
authors: "The Iris Organization" authors: "The Iris Organization"
homepage: "https://gitlab.mpi-sws.org/iris/tutorial-popl18" homepage: "https://gitlab.mpi-sws.org/iris/tutorial-popl18"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment