Skip to content

Commit

Permalink
makefiles that are version dependent
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenCyril committed Apr 8, 2015
1 parent abe2354 commit 737f79e
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mathcomp/algebra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
30 changes: 30 additions & 0 deletions mathcomp/all/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
H=@

ifeq "$(COQBIN)" ""
COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*

.PHONY: clean
clean:
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq clean
$(H)rm -f Makefile.coq

30 changes: 30 additions & 0 deletions mathcomp/attic/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
H=@

ifeq "$(COQBIN)" ""
COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*

.PHONY: clean
clean:
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq clean
$(H)rm -f Makefile.coq

7 changes: 7 additions & 0 deletions mathcomp/character/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
7 changes: 7 additions & 0 deletions mathcomp/field/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
7 changes: 7 additions & 0 deletions mathcomp/fingroup/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
30 changes: 30 additions & 0 deletions mathcomp/odd_order/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
H=@

ifeq "$(COQBIN)" ""
COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*

.PHONY: clean
clean:
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq clean
$(H)rm -f Makefile.coq

7 changes: 7 additions & 0 deletions mathcomp/real_closed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
7 changes: 7 additions & 0 deletions mathcomp/solvable/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ COQBIN=$(dir $(shell which coqtop))/
endif


VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

OLD_MAKEFLAGS:=$(MAKEFLAGS)
MAKEFLAGS+=-B

.DEFAULT_GOAL := all

%:
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(H)[ -e Makefile.coq ] || $(COQBIN)/coq_makefile -f Make -o Makefile.coq
$(H)MAKEFLAGS=$(OLD_MAKEFLAGS) $(MAKE) --no-print-directory \
-f Makefile.coq $*
Expand Down
7 changes: 7 additions & 0 deletions mathcomp/ssrtest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ MAKEFLAGS := -r
COQMAKEFILE := Makefile.coq
COQMAKE := +$(MAKE) -f $(COQMAKEFILE)

VERSION_Coq = $(shell $(COQBIN)/coqtop -v | head -1 | sed 's/.*version \([0-9]\.[0-9]\)[^ ]* .*/v\1/')

ifeq "$(VERSION_Coq)" ""
$(error no version number found for coq)
endif

all: $(COQMAKEFILE)
$(COQMAKE) all

Expand All @@ -23,4 +29,5 @@ tags:
install:

%: Makefile.coq
sed -i -e "s/^(\*$(VERSION_Coq) *\(.*\) *\*)/\1/" *.v
$(COQMAKE) $@

0 comments on commit 737f79e

Please sign in to comment.