]> git.ipfire.org Git - thirdparty/git.git/commit
Makefile: reduce repetitive library paths
authorJunio C Hamano <gitster@pobox.com>
Wed, 31 Jan 2024 17:42:19 +0000 (09:42 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 31 Jan 2024 18:01:56 +0000 (10:01 -0800)
commit354dbf7d649ef75c2f83d0f1d7cc03d1e84279dc
tree41754a1857bf5e10f7da1a19f438c607b5032566
parent564d0252ca632e0264ed670534a51d18a689ef5d
Makefile: reduce repetitive library paths

When we take a library package we depend on (e.g., LIBPCRE) from a
directory other than the default location of the system, we add the
same directory twice on the linker command like, like so:

  EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)

Introduce a template "libpath_template" that takes the path to the
directory, which can be used like so:

  EXTLIBS += $(call libpath_template,$(LIBPCREDIR)/$(lib))

and expand it into the "-L$(DIR) $(CC_LD_DYNPATH)$(DIR)" form.
Hopefully we can reduce the chance of typoes this way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
shared.mak