From 19b6f88c33456c590002db4521971c1909c45d5d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 17 May 2022 13:44:29 +0200 Subject: [PATCH] tool/ports: customization hooks The hooks added by this patch allow for the reuse of the hash.inc and install.mk by Goa as is. --- tool/ports/mk/hash.inc | 4 +++- tool/ports/mk/install.mk | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tool/ports/mk/hash.inc b/tool/ports/mk/hash.inc index d26ffca048..f3e2838e12 100644 --- a/tool/ports/mk/hash.inc +++ b/tool/ports/mk/hash.inc @@ -17,6 +17,8 @@ $(call check_tool,sha1sum) +REDIR ?= > $@ + _PATCHES_IN_REP_DIR := $(foreach P,$(PATCHES),\ $(wildcard $(REP_DIR)/$(subst $(REP_DIR)/,,$(P)))) @@ -27,7 +29,7 @@ endif $(_DST_HASH_FILE): $(HASH_INPUT) $(MAKEFILE_LIST) @$(MSG_GENERATE)$(notdir $@) - $(VERBOSE)cat $(HASH_INPUT) | sha1sum | sed "s/ .*//" > $@ + $(VERBOSE)cat $(HASH_INPUT) | sha1sum | sed "s/ .*//" $(REDIR) _check_hash: $(_DST_HASH_FILE) ifneq ($(CHECK_HASH),no) diff --git a/tool/ports/mk/install.mk b/tool/ports/mk/install.mk index 69dc6cb25e..77d9e24fe5 100644 --- a/tool/ports/mk/install.mk +++ b/tool/ports/mk/install.mk @@ -20,6 +20,8 @@ # XXX remove this line when the tool has stabilized STRICT_HASH ?= no +PORTS_TOOL_DIR ?= $(GENODE_DIR)/tool/ports + # # Utility to check if a python module is installed # @@ -45,7 +47,7 @@ _prefer = $(if $1,$1,$2) # # Include common definitions # -include $(GENODE_DIR)/tool/ports/mk/common.inc +include $(PORTS_TOOL_DIR)/mk/common.inc # # Include definitions provided by the port description file @@ -87,7 +89,7 @@ _dirs: $(DOWNLOADS) ## Generate the HASH file ## -include $(GENODE_DIR)/tool/ports/mk/hash.inc +include $(PORTS_TOOL_DIR)/mk/hash.inc ##