X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=rules.mk;h=de24778614214ebd62796fcd3cc2de7b68fd7f70;hp=12a79ba30c21daecd321ed6f23ad26d6d50ddb06;hb=1bc68e13792c793fc8c0f5bb214532552aa0c5e1;hpb=54fbe8afdd28d0619d8ccede9fcf183d745584a4 diff --git a/rules.mk b/rules.mk index 12a79ba30c..de24778614 100644 --- a/rules.mk +++ b/rules.mk @@ -371,6 +371,13 @@ define file_copy $(CP) $(1) $(2) endef +# Calculate sha256sum of any plain file within a given directory +# $(1) => Input directory +define sha256sums + (cd $(1); find . -maxdepth 1 -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ + xargs openssl dgst -sha256 | sed -ne 's!^SHA256(\(.*\))= \(.*\)$$!\2 *\1!p' > sha256sums) +endef + # file extension ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))