Skip to contentSkip to conversation

arm64: clean up tools Makefile

PATCH Applied Masahiro Yamada 2 participants 2 messages Feb 27, 2022 – Mar 8, 2022 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: clean up tools Makefile

Remove unused gen-y.

Remove redundant $(shell ...) because 'mkdir' is done in cmd_gen_cpucaps.

Replace $(filter-out $(PHONY), $^) with the $(real-prereqs) shorthand.

The '&&' in cmd_gen_cpucaps should be replaced with ';' because it is run under 'set -e' environment.

---

 arch/arm64/tools/Makefile | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
arch/arm64/tools/Makefile +3 -7
index 932b4fe5c768..cf1307188150 100644
@@ -5,18 +5,14 @@ kapi := $(gen)/asm
 
 kapi-hdrs-y := $(kapi)/cpucaps.h
 
-targets += $(addprefix ../../../,$(gen-y) $(kapi-hdrs-y))
+targets += $(addprefix ../../../, $(kapi-hdrs-y))
 
 PHONY += kapi
 
-kapi:   $(kapi-hdrs-y) $(gen-y)
-
-# Create output directory if not already present
-_dummy := $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
+kapi:   $(kapi-hdrs-y)
 
 quiet_cmd_gen_cpucaps = GEN     $@
-      cmd_gen_cpucaps = mkdir -p $(dir $@) && \
-                     $(AWK) -f $(filter-out $(PHONY),$^) > $@
+      cmd_gen_cpucaps = mkdir -p $(dir $@); $(AWK) -f $(real-prereqs) > $@
 
 $(kapi)/cpucaps.h: $(src)/gen-cpucaps.awk $(src)/cpucaps FORCE
 	$(call if_changed,gen_cpucaps)
Signature · 1 line
2.32.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Masahiro Yamada

Remove unused gen-y.

Remove redundant $(shell ...) because 'mkdir' is done in cmd_gen_cpucaps.

Replace $(filter-out $(PHONY), $^) with the $(real-prereqs) shorthand.

The '&&' in cmd_gen_cpucaps should be replaced with ';' because it is run under 'set -e' environment.

[...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: clean up tools Makefile

      https://git.kernel.org/arm64/c/819a47d24b61

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev