| 1 |
dune_wrap = $(shell command -v coqc > /dev/null || echo "etc/with-rocq-wrap.sh") |
| 2 |
dune = $(dune_wrap) dune $(1) $(DUNE_$(1)_FLAGS) --stop-on-first-error |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
.NOTPARALLEL: |
| 7 |
|
| 8 |
all: |
| 9 |
$(call dune,build) |
| 10 |
$(call dune,build) builtin-doc |
| 11 |
.PHONY: all |
| 12 |
|
| 13 |
build-core: |
| 14 |
$(call dune,build) theories |
| 15 |
$(call dune,build) builtin-doc |
| 16 |
.PHONY: build-core |
| 17 |
|
| 18 |
build-apps: |
| 19 |
$(call dune,build) $$(find apps -type d -name theories) |
| 20 |
.PHONY: build-apps |
| 21 |
|
| 22 |
build: |
| 23 |
$(call dune,build) -p rocq-elpi @install |
| 24 |
$(call dune,build) builtin-doc |
| 25 |
.PHONY: build |
| 26 |
|
| 27 |
all-tests-no-plugins: test-core test-repro test-stdlib test-apps test-apps-stdlib |
| 28 |
.PHONY: all-tests-no-plugins |
| 29 |
|
| 30 |
all-tests: all-tests-no-plugins test-plugins |
| 31 |
.PHONY: all-tests |
| 32 |
|
| 33 |
test-core: |
| 34 |
$(call dune,runtest) tests |
| 35 |
$(call dune,build) tests |
| 36 |
|
| 37 |
|
| 38 |
test-repro: test-core |
| 39 |
$(dune_wrap) dune coq top --toplevel coqc tests/accumulate1.v -- tests/accumulate1.v |
| 40 |
md5sum tests/accumulate1.vo > md5sum_accumulate1vo_1 |
| 41 |
rm -f tests/accumulate1.vo tests/accumulate1.glob |
| 42 |
$(dune_wrap) dune coq top --toplevel coqc tests/accumulate1.v -- tests/accumulate1.v |
| 43 |
md5sum tests/accumulate1.vo > md5sum_accumulate1vo_2 |
| 44 |
rm -f tests/accumulate1.vo tests/accumulate1.glob |
| 45 |
diff md5sum_accumulate1vo_1 md5sum_accumulate1vo_2 |
| 46 |
rm md5sum_accumulate1vo_1 md5sum_accumulate1vo_2 |
| 47 |
|
| 48 |
.PHONY: test-core test-repro |
| 49 |
|
| 50 |
test-apps: |
| 51 |
$(call dune,build) $$(find apps -type d -name tests) |
| 52 |
.PHONY: test-apps |
| 53 |
|
| 54 |
test-plugins: |
| 55 |
$(call dune,build) $$(find apps -type d -name tests-plugin) |
| 56 |
.PHONY: test-plugins |
| 57 |
|
| 58 |
test-apps-stdlib: |
| 59 |
$(call dune,build) $$(find apps -type d -name tests-stdlib) |
| 60 |
.PHONY: test-apps-stdlib |
| 61 |
|
| 62 |
test-stdlib: |
| 63 |
$(call dune,build) tests-stdlib |
| 64 |
.PHONY: test-stdlib |
| 65 |
|
| 66 |
all-examples: examples examples-stdlib |
| 67 |
.PHONY: all-examples |
| 68 |
|
| 69 |
examples: |
| 70 |
$(call dune,build) examples |
| 71 |
.PHONY: examples |
| 72 |
|
| 73 |
examples-stdlib: |
| 74 |
$(call dune,build) examples-stdlib |
| 75 |
.PHONY: examples-stdlib |
| 76 |
|
| 77 |
doc: |
| 78 |
@echo "########################## generating doc ##########################" |
| 79 |
@python3 -m venv alectryon |
| 80 |
@alectryon/bin/pip3 install git+https://github.com/gares/alectryon.git@4509235b1b83b256fd15d8dff92ac71666f419a1 |
| 81 |
@mkdir -p doc |
| 82 |
@$(foreach tut,$(wildcard examples/tutorial*$(ONLY)*.v),\ |
| 83 |
echo ALECTRYON $(tut) && alectryon/bin/python3 etc/alectryon_elpi.py \ |
| 84 |
--frontend coq+rst \ |
| 85 |
--output-directory doc \ |
| 86 |
--pygments-style vs \ |
| 87 |
--coq-driver vsrocq \ |
| 88 |
$(tut) &&) true |
| 89 |
@cp etc/tracer.png doc/ |
| 90 |
|
| 91 |
clean: |
| 92 |
$(call dune,clean) |
| 93 |
.PHONY: clean |
| 94 |
|
| 95 |
install: |
| 96 |
$(call dune,install) rocq-elpi |
| 97 |
.PHONY: install |
| 98 |
|
| 99 |
nix: |
| 100 |
nix-shell --arg do-nothing true --run "updateNixToolBox && genNixActions" |
| 101 |
.PHONY: nix |