Makefile 1.17 KB
Newer Older
Ralf Jung's avatar
Ralf Jung committed
1 2 3 4 5 6
# Process flags
ifeq ($(Y), 1)
	YFLAG=-y
endif

# Forward most targets to Coq makefile (with some trick to make this phony)
7
%: Makefile.coq phony
8
	+@make -f Makefile.coq $@
9

10
all: Makefile.coq
11
	+@make -f Makefile.coq all
12 13

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

Ralf Jung's avatar
Ralf Jung committed
18
# Create Coq Makefile. POSIX awk can't do in-place editing, but coq_makefile wants the real filename, so we do some file gymnastics.
19
Makefile.coq: _CoqProject Makefile awk.Makefile
Ralf Jung's avatar
Ralf Jung committed
20
	coq_makefile -f _CoqProject -o Makefile.coq
Ralf Jung's avatar
Ralf Jung committed
21
	mv Makefile.coq Makefile.coq.tmp && awk -f awk.Makefile Makefile.coq.tmp > Makefile.coq && rm Makefile.coq.tmp
22

Ralf Jung's avatar
Ralf Jung committed
23 24
# Install build-dependencies
build-dep:
25
	opam pin add opam-builddep-temp "$$(pwd)" -k path -n -y
Ralf Jung's avatar
Ralf Jung committed
26 27
	opam install opam-builddep-temp --deps-only $(YFLAG)
	opam pin remove opam-builddep-temp
28

Ralf Jung's avatar
typo  
Ralf Jung committed
29
# Some files that do *not* need to be forwarded to Makefile.coq
30
Makefile: ;
Ralf Jung's avatar
Ralf Jung committed
31
_CoqProject: ;
32
awk.Makefile: ;
33

Ralf Jung's avatar
Ralf Jung committed
34
# Phony targets (i.e. targets that should be run no matter the timestamps of the involved files)
35
phony: ;
36
.PHONY: all clean phony