aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEnrico Tassi2020-05-27 22:00:00 +0200
committerEnrico Tassi2020-05-27 22:00:00 +0200
commita102a80d886bafc75991a446d1c1ae4c04494666 (patch)
treecb1070f44e52a101c68f6f33179fcb95812e6610 /tools
parent35e175710795974a4a38c8a7d6da6a5ccaf8de74 (diff)
parent4bdfeb3c6d3a90fe2980a6d9063bb00136c53eeb (diff)
Merge PR #12389: Small coq_makefile improvement.
Reviewed-by: gares
Diffstat (limited to 'tools')
-rw-r--r--tools/CoqMakefile.in28
1 files changed, 16 insertions, 12 deletions
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in
index a26eb9dfbe..e2ed2db728 100644
--- a/tools/CoqMakefile.in
+++ b/tools/CoqMakefile.in
@@ -146,6 +146,21 @@ TIME_OF_PRETTY_BUILD_EXTRA_FILES ?= - # also output to the command line
TGTS ?=
+# Retro compatibility (DESTDIR is standard on Unix, DSTROOT is not)
+ifdef DSTROOT
+DESTDIR := $(DSTROOT)
+endif
+
+# Substitution of the path by appending $(DESTDIR) if needed.
+# The variable $(COQMF_WINDRIVE) can be needed for Cygwin environments.
+windrive_path = $(if $(COQMF_WINDRIVE),$(subst $(COQMF_WINDRIVE),/,$(1)),$(1))
+destination_path = $(if $(DESTDIR),$(DESTDIR)/$(call windrive_path,$(1)),$(1))
+
+# Installation paths of libraries and documentation.
+COQLIBINSTALL ?= $(call destination_path,$(COQLIB)/user-contrib)
+COQDOCINSTALL ?= $(call destination_path,$(DOCDIR)/user-contrib)
+COQTOPINSTALL ?= $(call destination_path,$(COQLIB)/toploop) # FIXME: Unused variable?
+
########## End of parameters ##################################################
# What follows may be relevant to you only if you need to
# extend this Makefile. If so, look for 'Extension point' here and
@@ -227,17 +242,6 @@ else
TIMING_ARG=
endif
-# Retro compatibility (DESTDIR is standard on Unix, DSTROOT is not)
-ifdef DSTROOT
-DESTDIR := $(DSTROOT)
-endif
-
-concat_path = $(if $(1),$(1)/$(if $(COQMF_WINDRIVE),$(subst $(COQMF_WINDRIVE),/,$(2)),$(2)),$(2))
-
-COQLIBINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)/user-contrib)
-COQDOCINSTALL = $(call concat_path,$(DESTDIR),$(DOCDIR)/user-contrib)
-COQTOPINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)/toploop)
-
# Files #######################################################################
#
# We here define a bunch of variables about the files being part of the
@@ -577,7 +581,7 @@ uninstall::
instf="$(COQLIBINSTALL)/$$df/`basename $$f`" &&\
rm -f "$$instf" &&\
echo RM "$$instf" &&\
- (rmdir "$(call concat_path,,$(COQLIBINSTALL)/$$df/)" 2>/dev/null || true); \
+ (rmdir "$(COQLIBINSTALL)/$$df/" 2>/dev/null || true); \
done
.PHONY: uninstall