From 6f100ad87c56b0d93436f439628dd076aced2ae9 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 30 Oct 2023 21:31:26 +0000 Subject: Fix multicall symlink installation Signed-off-by: Laurent Bercot --- Makefile | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index b82361b..f158e82 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ SHARED_LIBS := INTERNAL_LIBS := EXTRA_TARGETS := LIB_DEFS := +BIN_SYMLINKS := define library_definition LIB$(firstword $(subst =, ,$(1))) := lib$(lastword $(subst =, ,$(1))).$(if $(DO_ALLSTATIC),a,so).xyzzy @@ -30,6 +31,19 @@ STATIC_LIBS += lib$(lastword $(subst =, ,$(1))).a.xyzzy endif endef +define binary_installation_rule +$(DESTDIR)$(1)/$(2): $(2) package/modes + exec $(INSTALL) -D -m 600 $$< $$@ + grep -- ^$$(@F) < package/modes | { read name mode owner && \ + if [ x$$$$owner != x ] ; then chown -- $$$$owner $$@ ; fi && \ + chmod $$$$mode $$@ ; } +endef + +define symlink_installation_rule +$(DESTDIR)$(1)/$(2): $(DESTDIR)$(1)/$(SYMLINK_TARGET_$(2)) + exec $(INSTALL) -l $$(