11dune_wrap = $(shell command -v coqc > /dev/null || echo "etc/with-rocq-wrap.sh")
22dune = $(dune_wrap ) dune $(1 ) $(DUNE_$(1 ) _FLAGS ) --stop-on-first-error
3- DUNE_IN_FILES = $(shell find . -name "dune.in" | sed -e 's/.in$$//')
43
54# This makefile is mostly calling dune and dune doesn't like
65# being called in parralel, so we enforce -j1
76.NOTPARALLEL :
87
9- all : $( DUNE_IN_FILES )
8+ all :
109 $(call dune,build)
1110 $(call dune,build) builtin-doc
1211.PHONY : all
1312
14- # simplify this and get rid of the dune.in files once we require Rocq >= 9.0
15- % dune : % dune.in
16- @rm -f $@
17- @echo " ; generated by make, do not edit\n" > $@
18- @if test -e .coq-dune-files || \
19- (command -v coqc > /dev/null && (coqc --version | grep -q ' 8.20' )) ; then \
20- sed -e ' s/@@STDLIB_THEORY@@//' $< | \
21- sed -e ' s/@@STDLIB@@//' | \
22- sed -e ' s/@@ROCQ_RUNTIME@@/coq-core/g' >> $@ ; \
23- else \
24- sed -e ' s/@@STDLIB_THEORY@@/(theories Stdlib)/' $< | \
25- sed -e ' s/@@STDLIB@@/Stdlib/' | \
26- sed -e ' s/@@ROCQ_RUNTIME@@/rocq-runtime/g' >> $@ ; \
27- fi
28- @chmod a-w $@
29-
30- dune-files : $(DUNE_IN_FILES )
13+ dune-files :
14+ echo " no longer doing anything"
3115.PHONE : dune-files
3216
33- coq-dune-files :
34- touch .coq-dune-files
35- $(MAKE ) dune-files
36- $(RM ) .coq-dune-files
37- .PHONE : coq-dune-files
38-
39- build-core : $(DUNE_IN_FILES )
17+ build-core :
4018 $(call dune,build) theories
4119 $(call dune,build) builtin-doc
4220.PHONY : build-core
4321
44- build-apps : $( DUNE_IN_FILES )
22+ build-apps :
4523 $(call dune,build) $$(find apps -type d -name theories )
4624.PHONY : build-apps
4725
48- build : $( DUNE_IN_FILES )
26+ build :
4927 $(call dune,build) -p rocq-elpi @install
5028 $(call dune,build) builtin-doc
5129.PHONY : build
5230
5331all-tests : test-core test-stdlib test-apps test-apps-stdlib
5432.PHONY : all-tests
5533
56- test-core : $( DUNE_IN_FILES )
34+ test-core :
5735 $(call dune,runtest) tests
5836 $(call dune,build) tests
5937 # Check for build reproducibility
@@ -65,22 +43,22 @@ test-core: $(DUNE_IN_FILES)
6543 rm md5sum_accumulate1vo_1 md5sum_accumulate1vo_2
6644.PHONY : test-core
6745
68- test-apps : $( DUNE_IN_FILES )
46+ test-apps :
6947 $(call dune,build) $$(find apps -type d -name tests )
7048.PHONY : test-apps
7149
72- test-apps-stdlib : $( DUNE_IN_FILES )
50+ test-apps-stdlib :
7351 $(call dune,build) $$(find apps -type d -name tests-stdlib )
7452.PHONY : test-apps-stdlib
7553
76- test-stdlib : $( DUNE_IN_FILES )
54+ test-stdlib :
7755 $(call dune,build) tests-stdlib
7856.PHONY : test-stdlib
7957
8058all-examples : examples examples-stdlib
8159.PHONY : all-examples
8260
83- examples : $( DUNE_IN_FILES )
61+ examples :
8462 $(call dune,build) examples
8563.PHONY : examples
8664
@@ -108,7 +86,7 @@ clean:
10886 $(call dune,clean)
10987.PHONY : clean
11088
111- install : $( DUNE_IN_FILES )
89+ install :
11290 $(call dune,install) rocq-elpi
11391.PHONY : install
11492
0 commit comments