]> git.sur5r.net Git - u-boot/blobdiff - scripts/Makefile.build
zynqmp: zcu102: Add qspi driver support for ZynqMP zcu102 boards
[u-boot] / scripts / Makefile.build
index 06e5c203c1f13bd4428ef16c2151e9345e07c0ef..482ed0c8d80482c8bbf81e7a46adbfd2c96c9e9a 100644 (file)
@@ -1,9 +1,7 @@
+# SPDX-License-Identifier: GPL-2.0
 # ==========================================================================
 # Building
 # ==========================================================================
-#
-# SPDX-License-Identifier:     GPL-2.0
-#
 
 # Modified for U-Boot
 prefix := tpl
@@ -417,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
 # ---------------------------------------------------------------------------