-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add MathComp-style submakefiles to allow packaging without Dune
- Loading branch information
Showing
8 changed files
with
182 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
all: Makefile.coq | ||
@+$(MAKE) -f Makefile.coq all | ||
# -*- Makefile -*- | ||
|
||
clean: Makefile.coq | ||
@+$(MAKE) -f Makefile.coq cleanall | ||
@rm -f Makefile.coq Makefile.coq.conf | ||
|
||
Makefile.coq: _CoqProject | ||
$(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq | ||
|
||
force _CoqProject Makefile: ; | ||
|
||
%: Makefile.coq force | ||
@+$(MAKE) -f Makefile.coq $@ | ||
|
||
.PHONY: all clean force | ||
# -------------------------------------------------------------------- | ||
include Makefile.common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# -*- Makefile -*- | ||
|
||
###################################################################### | ||
# USAGE: # | ||
# The rules this-config::, this-build::, this-distclean::, # | ||
# pre-makefile::, this-clean:: and __always__:: may be extended # | ||
# Additionally, the following variables may be customized: # | ||
SUBDIRS?= | ||
COQBIN?=$(dir $(shell which coqtop)) | ||
COQMAKEFILE?=$(COQBIN)coq_makefile | ||
COQDEP?=$(COQBIN)coqdep | ||
COQPROJECT?=_CoqProject | ||
COQMAKEOPTIONS?= | ||
COQMAKEFILEOPTIONS?= | ||
V?= | ||
VERBOSE?=V | ||
###################################################################### | ||
|
||
# local context: ----------------------------------------------------- | ||
.PHONY: all config build clean distclean __always__ | ||
.SUFFIXES: | ||
|
||
H:= $(if $(VERBOSE),,@) # not used yet | ||
TOP = $(dir $(lastword $(MAKEFILE_LIST))) | ||
COQMAKE = $(MAKE) -f Makefile.coq $(COQMAKEOPTIONS) | ||
BRANCH_coq:= $(shell $(COQBIN)coqtop -v | head -1 | grep -E '(trunk|master)' \ | ||
| wc -l | sed 's/ *//g') | ||
|
||
# coq version: | ||
ifneq "$(BRANCH_coq)" "0" | ||
COQVVV:= dev | ||
else | ||
COQVVV:=$(shell $(COQBIN)coqtop --print-version | cut -d" " -f1) | ||
endif | ||
|
||
COQV:= $(shell echo $(COQVVV) | cut -d"." -f1) | ||
COQVV:= $(shell echo $(COQVVV) | cut -d"." -f1-2) | ||
|
||
# all: --------------------------------------------------------------- | ||
all: config build | ||
|
||
# Makefile.coq: ------------------------------------------------------ | ||
.PHONY: pre-makefile | ||
|
||
Makefile.coq: pre-makefile $(COQPROJECT) Makefile | ||
$(COQMAKEFILE) $(COQMAKEFILEOPTIONS) -f $(COQPROJECT) -o Makefile.coq | ||
|
||
# Global config, build, clean and distclean -------------------------- | ||
config: sub-config this-config | ||
|
||
build: sub-build this-build | ||
|
||
clean: sub-clean this-clean | ||
|
||
distclean: sub-distclean this-distclean | ||
|
||
# Local config, build, clean and distclean --------------------------- | ||
.PHONY: this-config this-build this-distclean this-clean | ||
|
||
this-config:: __always__ | ||
|
||
this-build:: this-config Makefile.coq | ||
+$(COQMAKE) | ||
|
||
this-distclean:: this-clean | ||
rm -f Makefile.coq Makefile.coq.conf Makefile.coq | ||
|
||
this-clean:: __always__ | ||
@if [ -f Makefile.coq ]; then $(COQMAKE) cleanall; fi | ||
|
||
# Install target ----------------------------------------------------- | ||
.PHONY: install | ||
|
||
install: __always__ Makefile.coq | ||
$(COQMAKE) install | ||
# counting lines of Coq code ----------------------------------------- | ||
.PHONY: count | ||
|
||
COQFILES = $(shell grep '.v$$' $(COQPROJECT)) | ||
|
||
count: | ||
@coqwc $(COQFILES) | tail -1 | \ | ||
awk '{printf ("%d (spec=%d+proof=%d)\n", $$1+$$2, $$1, $$2)}' | ||
# Additionally cleaning backup (*~) files ---------------------------- | ||
this-distclean:: | ||
rm -f $(shell find . -name '*~') | ||
|
||
# Make in SUBDIRS ---------------------------------------------------- | ||
ifdef SUBDIRS | ||
sub-%: __always__ | ||
@set -e; for d in $(SUBDIRS); do +$(MAKE) -C $$d $(@:sub-%=%); done | ||
else | ||
sub-%: __always__ | ||
@true | ||
endif | ||
|
||
# Make of individual .vo --------------------------------------------- | ||
%.vo: __always__ Makefile.coq | ||
+$(COQMAKE) $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
-arg -w -arg -notation-overridden | ||
-arg -w -arg -redundant-canonical-projection | ||
-arg -w -arg -projection-no-head-constant | ||
-arg -w -arg -duplicate-clear | ||
-arg -w -arg -elpi.add-const-for-axiom-or-sectionvar | ||
-arg -w -arg -ambiguous-paths | ||
|
||
-Q . GraphTheory.core | ||
|
||
edone.v | ||
bounded.v | ||
preliminaries.v | ||
setoid_bigop.v | ||
finmap_plus.v | ||
set_tac.v | ||
bij.v | ||
finite_quotient.v | ||
equiv.v | ||
arc.v | ||
digraph.v | ||
sgraph.v | ||
helly.v | ||
connectivity.v | ||
treewidth.v | ||
minor.v | ||
excluded.v | ||
checkpoint.v | ||
cp_minor.v | ||
smerge.v #(ITP 21) | ||
structures.v | ||
mgraph.v | ||
pttdom.v | ||
mgraph2.v | ||
rewriting.v | ||
reduction.v | ||
open_confluence.v | ||
transfer.v | ||
completeness.v | ||
ptt.v | ||
skeleton.v | ||
mgraph2_tw2.v | ||
extraction_def.v | ||
extraction_iso.v | ||
extraction_top.v | ||
dom.v | ||
partition.v | ||
coloring.v | ||
wpgt.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- Makefile -*- | ||
|
||
# setting variables | ||
COQPROJECT?=Make | ||
|
||
# Main Makefile | ||
include ../../Makefile.common |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-arg -w -arg -notation-overridden | ||
-arg -w -arg -redundant-canonical-projection | ||
-arg -w -arg -projection-no-head-constant | ||
-arg -w -arg -duplicate-clear | ||
-arg -w -arg -elpi.add-const-for-axiom-or-sectionvar | ||
-arg -w -arg -ambiguous-paths | ||
|
||
-Q . GraphTheory.planar | ||
|
||
hmap_ops.v | ||
hcycle.v | ||
embedding.v | ||
K4plane.v | ||
wagner.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- Makefile -*- | ||
|
||
# setting variables | ||
COQPROJECT?=Make | ||
|
||
# Main Makefile | ||
include ../../Makefile.common |