Commit 8763f83d authored by Hai Dang's avatar Hai Dang

update Makefile and add opam

parent 13a8cb3e
......@@ -27,3 +27,6 @@ _*_.tex
*.v.d
*.vio
Makefile.coq*
*.crashcoqide
.coqdeps.d
build-dep
# Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony
+@make -f Makefile.coq $@
all: Makefile.coq
+@make -f Makefile.coq all
.PHONY: all
clean: Makefile.coq
+@make -f Makefile.coq clean
find theories $$(test -d tests && echo tests) \( -name "*.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete
rm -f Makefile.coq
.PHONY: clean
# Create Coq Makefile.
Makefile.coq: _CoqProject Makefile
"$(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/; \
fi
# Some files that do *not* need to be forwarded to Makefile.coq
Makefile: ;
_CoqProject: ;
opam: ;
# Phony wildcard targets
phony: ;
.PHONY: phony
-Q . tutorial
-arg -w -arg -notation-overridden,-redundant-canonical-projection,-several-object-files
exercises/ex_01_swap.v
exercises/ex_02_sumlist.v
exercises/ex_03_spinlock.v
exercises/ex_04_parallel_add.v
exercises/ex_05_parallel_add_mul.v
solutions/ex_01_swap.v
solutions/ex_02_sumlist.v
solutions/ex_03_spinlock.v
solutions/ex_04_parallel_add.v
solutions/ex_05_parallel_add_mul.v
# Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony
+@make -f Makefile.coq $@
all: Makefile.coq
+@make -f Makefile.coq all
.PHONY: all
clean: Makefile.coq
+@make -f Makefile.coq clean
find ./ \( -name "*.v.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete
rm -f Makefile.coq
.PHONY: clean
Makefile.coq: _CoqProject Makefile
coq_makefile -f _CoqProject -o Makefile.coq
# Some files that do *not* need to be forwarded to Makefile.coq
Makefile: ;
_CoqProject: ;
# Phony wildcard targets
phony: ;
.PHONY: phony
-Q . tutorial
-arg -w -arg -notation-overridden,-redundant-canonical-projection,-several-object-files
ex_01_swap.v
ex_02_sumlist.v
ex_03_spinlock.v
ex_04_parallel_add.v
ex_05_parallel_add_mul.v
opam-version: "1.2"
name: "coq-iris-tutorial-popl18"
maintainer: "The Iris Organization"
authors: "The Iris Organization"
homepage: "https://gitlab.mpi-sws.org/iris/tutorial-popl18"
bug-reports: "https://gitlab.mpi-sws.org/iris/tutorial-popl18/issues"
dev-repo: "https://gitlab.mpi-sws.org/iris/tutorial-popl18.git"
build: [make "-j%{jobs}%"]
install: [] # This repo does not install
remove: []
depends: [
"coq-iris" { (= "3.1.0") }
]
# Forward most targets to Coq makefile (with some trick to make this phony)
%: Makefile.coq phony
+@make -f Makefile.coq $@
all: Makefile.coq
+@make -f Makefile.coq all
.PHONY: all
clean: Makefile.coq
+@make -f Makefile.coq clean
find ./ \( -name "*.v.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete
rm -f Makefile.coq
.PHONY: clean
Makefile.coq: _CoqProject Makefile
coq_makefile -f _CoqProject -o Makefile.coq
# Some files that do *not* need to be forwarded to Makefile.coq
Makefile: ;
_CoqProject: ;
# Phony wildcard targets
phony: ;
.PHONY: phony
-Q . tutorial
-arg -w -arg -notation-overridden,-redundant-canonical-projection,-several-object-files
ex_01_swap.v
ex_02_sumlist.v
ex_03_spinlock.v
ex_04_parallel_add.v
ex_05_parallel_add_mul.v
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