diff --git a/Makefile b/Makefile index 04ed3bc59a15..faf9dd5f24fa 100644 --- a/Makefile +++ b/Makefile @@ -1105,8 +1105,8 @@ endif autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) quiet_cmd_autoksyms_h = GEN $@ - cmd_autoksyms_h = mkdir -p $(dir $@); $(CONFIG_SHELL) \ - $(srctree)/scripts/gen_autoksyms.sh $@ + cmd_autoksyms_h = mkdir -p $(dir $@); \ + $(CONFIG_SHELL) $(srctree)/scripts/gen_autoksyms.sh $@ $(autoksyms_h): $(call cmd,autoksyms_h) diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh index 3c88af58092b..846dde7accca 100755 --- a/scripts/gen_autoksyms.sh +++ b/scripts/gen_autoksyms.sh @@ -24,7 +24,7 @@ if [ -n "$CONFIG_UNUSED_KSYMS_WHITELIST" ]; then # Use 'eval' to expand the whitelist path and check if it is relative eval ksym_wl="$CONFIG_UNUSED_KSYMS_WHITELIST" [ "${ksym_wl}" != "${ksym_wl#/}" ] || ksym_wl="$abs_srctree/$ksym_wl" - if [ ! -f "$ksym_wl" ]; then + if [ ! -f "$ksym_wl" ] || [ ! -r "$ksym_wl" ]; then echo "ERROR: '$ksym_wl' whitelist file not found" >&2 exit 1 fi