Makefile: fix broken bindir_relative variable

Change the bindir_relative variable to work like the other *_relative variables, which are computed as a function of the absolute path. Before this change, supplying e.g. bindir=/tmp/git/binaries to the Makefile would yield a bindir_relative of just "bin", as opposed to "binaries". This logic was originally added back in 026fa0d5ad ("Move computation of absolute paths from Makefile to runtime (in preparation for RUNTIME_PREFIX)", 2009-01-18), then later in 971f85388f ("Makefile: make mandir, htmldir and infodir absolute", 2013-02-24) when more *_relative variables were added those new variables didn't have this bug, but bindir_relative was never fixed. There is a small change in behavior here, which is that setting bindir_relative as an argument to the Makefile won't work anymore, I think that's fine, since this was always intended as an internal variable (e.g. INSTALL documents bindir=*, not bindir_relative=*). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Mar 13, 2018 at 20:39 UTC 7bc506d038fdb3b55d83f771ea08e595c5b9a8e4
1 file changed +2 -2
Makefile
+2 -2
@@ -468,8 +468,7 @@ ARFLAGS = rcs
468 # This can help installing the suite in a relocatable way.
469
470 prefix = $(HOME)
471 -bindir_relative = bin
472 -bindir = $(prefix)/$(bindir_relative)
471 +bindir = $(prefix)/bin
472 mandir = $(prefix)/share/man
473 infodir = $(prefix)/share/info
474 gitexecdir = libexec/git-core
@@ -486,6 +485,7 @@ lib = lib
485 # DESTDIR =
486 pathsep = :
487
488 +bindir_relative = $(patsubst $(prefix)/%,%,$(bindir))
489 mandir_relative = $(patsubst $(prefix)/%,%,$(mandir))
490 infodir_relative = $(patsubst $(prefix)/%,%,$(infodir))
491 htmldir_relative = $(patsubst $(prefix)/%,%,$(htmldir))