Skip to content

Commit 135ec8c

Browse files
committed
make: patch all files and only once
1 parent 634703d commit 135ec8c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ _minted-*
5858
*.vtc
5959

6060
*.dot
61+
config.stamp

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,19 @@ distclean: sub-distclean this-distclean
100100
.PHONY: this-config this-build this-only this-test-suite this-test-suite-stdlib this-distclean this-clean
101101

102102
this-config:: __always__
103-
if command -v coqc > /dev/null && (coqc --version | grep -q '8.18\|8.19\|8.20') ; then \
104-
sed -i.bak HB/structures.v -e 's/From Corelib/From Coq/' ; \
103+
@command -v coqc >/dev/null || exit 1
104+
@if [ -e config.stamp -a "`coqc --print-version`" = "`cat config.stamp 2>/dev/null`" ] ; then \
105+
echo 'already configured';\
106+
else\
107+
coqc --print-version > config.stamp;\
108+
echo 'configuring for ' `coqc --print-version`;\
109+
if (coqc --version | grep -q '8.18\|8.19\|8.20') ; then \
110+
echo '*****************************************************************';\
111+
echo 'old coq version detected, double check the diff before committing';\
112+
echo '*****************************************************************';\
113+
sed -i.bak `find . -name \*.v` -e 's/From Corelib/From Coq/' ; \
114+
sed -i.bak `find . -name \*.v` -e 's/IntDef/ZArith/' ; \
115+
fi;\
105116
fi
106117

107118
this-build:: this-config Makefile.coq
@@ -117,6 +128,7 @@ this-test-suite-stdlib:: build Makefile.test-suite-stdlib.coq
117128
+$(COQMAKE_TESTSUITE_STDLIB)
118129

119130
this-distclean:: this-clean
131+
rm -f config.stamp
120132
rm -f Makefile.coq Makefile.coq.conf
121133
rm -f Makefile.test-suite.coq Makefile.test-suite.coq.conf
122134
rm -f Makefile.test-suite-stdlib.coq Makefile.test-suite-stdlib.coq.conf

0 commit comments

Comments
 (0)