diff --git a/tool/ports/check_hash b/tool/ports/check_hash new file mode 100755 index 000000000..2d863b165 --- /dev/null +++ b/tool/ports/check_hash @@ -0,0 +1,39 @@ +#!/usr/bin/make -f + +# +# \brief Tool for checking the hash file of a port +# \author Christian Helmuth +# \author Norman Feske +# \date 2018-04-23 +# + +# +# Determine Genode base directory based on the known location of the +# 'create_builddir' tool within the Genode source tree +# +GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..) + +include $(GENODE_DIR)/tool/ports/mk/front_end.inc +include $(GENODE_DIR)/tool/ports/mk/check_port_arg.inc + +usage: + @$(ECHO) + @$(ECHO) "--- check hash file of a port ---" + @$(ECHO) "usage: check_hash " + @$(ECHO) + +include $(PORT) + +_DST_HASH_FILE := $(shell mktemp -qt $(firstword tmpXXX.$(TARGET)).hash) + +# XXX remove this line when the tool has stabilized +STRICT_HASH ?= no + +include $(GENODE_DIR)/tool/ports/mk/hash.inc + +check_and_remove: _check_hash + $(VERBOSE)rm -f $(_DST_HASH_FILE) + +.PHONY: $(_DST_HASH_FILE) + +$(TARGET): check_and_remove