From 9f8d9146de3f7acfcb424c84d4a99c6688dac446 Mon Sep 17 00:00:00 2001
From: Ralf Jung <jung@mpi-sws.org>
Date: Tue, 10 Jan 2017 11:02:14 +0100
Subject: [PATCH] update awk.Makefile

---
 awk.Makefile | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/awk.Makefile b/awk.Makefile
index e014962ba..526cf3c4e 100644
--- a/awk.Makefile
+++ b/awk.Makefile
@@ -1,10 +1,19 @@
 # awk program that patches the Makefile generated by Coq.
 
+# Detect the name this project will be installed under.
+/\$\(COQLIBINSTALL\)\/.*\/\$\$i/ {
+# Wow, POSIX awk is really broken.  I mean, isn't it supposed to be a text processing language?
+# And there is not even a way to access the matched groups of a regexp...?!? Lucky enough,
+# we can just split the string at '/' here.
+	split($0, PIECES, /\//);
+	PROJECT=PIECES[2];
+}
+
 # Patch the uninstall target to work properly, and to also uninstall stale files.
 # Also see <https://coq.inria.fr/bugs/show_bug.cgi?id=4907>.
 /^uninstall:/ {
 	print "uninstall:";
-	print "\tif [ -d \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ ]; then find \"$$(DSTROOT)\"$$(COQLIBINSTALL)/iris/ -name \"*.vo\" -print -delete; fi";
+	print "\tif [ -d \"$$(DSTROOT)\"$$(COQLIBINSTALL)/"PROJECT"/ ]; then find \"$$(DSTROOT)\"$$(COQLIBINSTALL)/"PROJECT"/ -name \"*.vo\" -print -delete; fi";
 	getline;
 	next
 }
-- 
GitLab