Skip to content

Commit

Permalink
Merge pull request #21 from JasonGross/fix-native-compiler
Browse files Browse the repository at this point in the history
Support coq-native by passing through `COQEXTRAFLAGS`
  • Loading branch information
andrew-appel authored Sep 8, 2023
2 parents 75d8756 + abec7ad commit b427da8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions coq-vcfloat.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ bug-reports: "https://github.com/VeriNum/vcfloat/issues"
license: "LGPL-3.0-or-later"

build: [
[ make "-C" "vcfloat" "-j%{jobs}%" "vcfloat2"]
[ make "-C" "vcfloat" "-j%{jobs}%" "vcfloat2" "COQEXTRAFLAGS=-native-compiler ondemand" {coq-native:installed & coq-compcert:version < "3.13~"}]
]
install: [
[make "-C" "vcfloat" "-j%{jobs}%" "install" "INSTALLDIR=%{lib}%/coq/user-contrib/vcfloat"]
[make "-C" "vcfloat" "-j%{jobs}%" "install" "INSTALLDIR=%{lib}%/coq/user-contrib/vcfloat" "COQEXTRAFLAGS=-native-compiler ondemand" {coq-native:installed & coq-compcert:version < "3.13~"}]
]
run-test: [
[make "-C" "vcfloat" "-j%{jobs}%" "tests"]
[make "-C" "vcfloat" "-j%{jobs}%" "tests" "COQEXTRAFLAGS=-native-compiler ondemand" {coq-native:installed & coq-compcert:version < "3.13~"}]
]
depends: [
"coq" {>= "8.16" & < "8.18~"}
Expand Down
7 changes: 4 additions & 3 deletions vcfloat/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# This Makefile assumes that coq already has access to
# Flocq, Interval, CompCert, etc.,
# which will be true if coq was installed through opam
# which will be true if coq was installed through opam
# or as a "Coq Platform" package.

COQC=coqc
COQDEP=coqdep
COQFLAGS := $(shell cat _CoqProject)
COQEXTRAFLAGS?=

target: vcfloat2 tests

Expand All @@ -16,7 +17,7 @@ tests: ../Test/Test.vo ../Test/TestFunc.vo ../Test/TestPaper.vo ../Test/Test2.vo
vcfloat2: VCFloat.vo FPCompCert.vo Version.vo FPLib.vo

%.vo: %.v
$(COQC) $(COQFLAGS) $*.v
$(COQC) $(COQFLAGS) $(COQEXTRAFLAGS) $*.v

ifdef INSTALLDIR
INSTALLFILES=$(shell make -Bn vcfloat2 2>/dev/null | awk '/^coqc.*v$$/{print $$NF"o"}')
Expand All @@ -31,7 +32,7 @@ endif
install -d $(INSTALLDIR)
install -m 0644 $(INSTALLFILES) $(INSTALLDIR)

depend:
depend:
$(COQDEP) $(COQFLAGS) *.v ../Test/*.v > .depend

ifneq ($(MAKECMDGOALS),depend)
Expand Down

0 comments on commit b427da8

Please sign in to comment.