X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=scripts%2FMakefile.build;h=482ed0c8d80482c8bbf81e7a46adbfd2c96c9e9a;hb=56c0e646c4f6aeb263d9bff01b3619d81a0b062e;hp=ac0554eeae170bd78ff9187ea54ad0f66ec88e52;hpb=b9cb64825b5e6efeb715abd8b48d9b12f98973e9;p=u-boot diff --git a/scripts/Makefile.build b/scripts/Makefile.build index ac0554eeae..482ed0c8d8 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 # ========================================================================== # Building # ========================================================================== @@ -253,8 +254,9 @@ sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH "$(if $(part-of-module),1,0)" "$(@)"; recordmcount_source := $(srctree)/scripts/recordmcount.pl endif -cmd_record_mcount = \ - if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then \ +cmd_record_mcount = \ + if [ "$(findstring $(CC_FLAGS_FTRACE),$(_c_flags))" = \ + "$(CC_FLAGS_FTRACE)" ]; then \ $(sub_cmd_record_mcount) \ fi; endif @@ -413,6 +415,17 @@ $(call multi_depend, $(multi-used-m), .o, -objs -y) targets += $(multi-used-y) $(multi-used-m) +# Add intermediate targets: +# When building objects with specific suffix patterns, add intermediate +# targets that the final targets are derived from. +intermediate_targets = $(foreach sfx, $(2), \ + $(patsubst %$(strip $(1)),%$(sfx), \ + $(filter %$(strip $(1)), $(targets)))) +# %.lex.o <- %.lex.c <- %.l +# %.tab.o <- %.tab.[ch] <- %.y +targets += $(call intermediate_targets, .lex.o, .lex.c) \ + $(call intermediate_targets, .tab.o, .tab.c .tab.h) + # Descending # ---------------------------------------------------------------------------