Skip to content
Snippets Groups Projects
Makefile 1.17 KiB
Newer Older
Ralf Jung's avatar
Ralf Jung committed
# Process flags
ifeq ($(Y), 1)
	YFLAG=-y
endif

# 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

clean: Makefile.coq
	+@make -f Makefile.coq clean
	find theories \( -name "*.v.d" -o -name "*.vo" -o -name "*.aux" -o -name "*.cache" -o -name "*.glob" -o -name "*.vio" \) -print -delete
	rm -f Makefile.coq

# Create Coq Makefile. POSIX awk can't do in-place editing, but coq_makefile wants the real filename, so we do some file gymnastics.
Makefile.coq: _CoqProject Makefile awk.Makefile
Ralf Jung's avatar
Ralf Jung committed
	coq_makefile -f _CoqProject -o Makefile.coq
	mv Makefile.coq Makefile.coq.tmp && awk -f awk.Makefile Makefile.coq.tmp > Makefile.coq && rm Makefile.coq.tmp
Ralf Jung's avatar
Ralf Jung committed
# Install build-dependencies
build-dep:
	opam pin add opam-builddep-temp "$$(pwd)" -k path -n -y
Ralf Jung's avatar
Ralf Jung committed
	opam install opam-builddep-temp --deps-only $(YFLAG)
	opam pin remove opam-builddep-temp
Ralf Jung's avatar
Ralf Jung committed
# Some files that do *not* need to be forwarded to Makefile.coq
Makefile: ;
Ralf Jung's avatar
Ralf Jung committed
_CoqProject: ;
Ralf Jung's avatar
Ralf Jung committed
# Phony targets (i.e. targets that should be run no matter the timestamps of the involved files)