Makefile 1.16 KB
Newer Older
Ralf Jung's avatar
Ralf Jung committed
1 2 3 4 5 6 7
# Determine Coq version
COQ_VERSION=$(shell coqc --version | egrep -o 'version 8.[0-9]' | egrep -o '8.[0-9]')
COQ_MAKEFILE_FLAGS ?=

ifeq ($(COQ_VERSION), 8.6)
	COQ_MAKEFILE_FLAGS += -arg -w -arg -notation-overridden,-redundant-canonical-projection
endif
8

9
%: Makefile.coq phony
10
	+@make -f Makefile.coq $@
11

12
all: Makefile.coq
13
	+@make -f Makefile.coq all
14 15

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

20
Makefile.coq: _CoqProject Makefile
21 22 23
	@# we want to pass the correct name to coq_makefile or it will be confused
	coq_makefile $(COQ_MAKEFILE_FLAGS) -f _CoqProject -o Makefile.coq
	mv Makefile.coq Makefile.coq.tmp
24
	sed 's/$$(COQCHK) $$(COQCHKFLAGS) $$(COQLIBS)/$$(COQCHK) $$(COQCHKFLAGS) $$(subst -Q,-R,$$(COQLIBS))/' < Makefile.coq.tmp \
25
	  | awk '/^uninstall:/{print "uninstall:";print "\tif [ -d \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ ]; then find \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ -name \"*.vo\" -print -delete; fi";getline;next}1' > Makefile.coq
26
	rm Makefile.coq.tmp
27

28 29 30
_CoqProject: ;

Makefile: ;
31

32 33
phony: ;

34
.PHONY: all clean phony