From fa774535ebd31d2c315d58b64cc56a868aa20df4 Mon Sep 17 00:00:00 2001 From: sure freeing go Date: Wed, 14 Apr 2021 17:33:51 +0800 Subject: [PATCH] Simplify the repeat lines in build/root/Makefile --- build/root/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/root/Makefile b/build/root/Makefile index b01e85c7918..d0d69ab1602 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -527,12 +527,13 @@ define CMD_HELP_INFO endef #TODO: make EXCLUDE_TARGET auto-generated when there are other files in cmd/ EXCLUDE_TARGET=BUILD OWNERS -.PHONY: $(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))) +CMD_TARGET = $(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))) +.PHONY: $(CMD_TARGET) ifeq ($(PRINT_HELP),y) -$(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))): +$(CMD_TARGET): @echo "$$CMD_HELP_INFO" else -$(filter-out %$(EXCLUDE_TARGET),$(notdir $(abspath $(wildcard cmd/*/)))): generated_files +$(CMD_TARGET): generated_files hack/make-rules/build.sh cmd/$@ endif