summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-17 16:21:36 +0900
committerTom Rini <trini@konsulko.com>2020-04-24 16:40:09 -0400
commitb5a2046376e7f18f796f641a51fdc66a5a52306a (patch)
treefb5cdf6ac1c5301734ea4e1db00810ceda276c1e /scripts/Makefile.build
parentc3da3f58086b30d0d435a002781121c1e820c7da (diff)
downloadu-boot-b5a2046376e7f18f796f641a51fdc66a5a52306a.tar.gz
u-boot-b5a2046376e7f18f796f641a51fdc66a5a52306a.tar.xz
u-boot-b5a2046376e7f18f796f641a51fdc66a5a52306a.zip
kbuild: cherry-pick kbuild changes from Linux
b42841b7bb62 kbuild: Get rid of KBUILD_STR 2aedcd098a94 kbuild: suppress annoying "... is up to date." message 9c8fa9bc08f6 kbuild: fix if_change and friends to consider argument order ebf003f0cfb3 kbuild: Consolidate header generation from ASM offset information 2982c953570b kbuild: remove redundant $(wildcard ...) for cmd_files calculation 8a78756eb545 kbuild: create object directories simpler and faster 4d4b5c2e3b6e treewide: remove explicit rules for *offsets.s 01d509a48b46 kbuild: remove unimportant comments from ./Kbuild Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build18
1 files changed, 5 insertions, 13 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5e5f1682c9..705a886cb9 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -75,17 +75,6 @@ ifneq ($(hostprogs-y)$(hostprogs-m)$(hostlibs-y)$(hostlibs-m)$(hostcxxlibs-y)$(h
include scripts/Makefile.host
endif
-# Uncommented for U-Boot
-# We need to create output dicrectory for SPL and TPL even for in-tree build
-#ifneq ($(KBUILD_SRC),)
-# Create output directory if not already present
-_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
-
-# Create directories for object files if directory does not exist
-# Needed when obj-y := dir/file.o syntax is used
-_dummy := $(foreach d,$(obj-dirs), $(shell [ -d $(d) ] || mkdir -p $(d)))
-#endif
-
ifndef obj
$(warning kbuild: Makefile.build is included improperly)
endif
@@ -441,11 +430,14 @@ FORCE:
# optimization, we don't need to read them if the target does not
# exist, we will rebuild anyway in that case.
-targets := $(wildcard $(sort $(targets)))
-cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
+cmd_files := $(wildcard $(foreach f,$(sort $(targets)),$(dir $(f)).$(notdir $(f)).cmd))
ifneq ($(cmd_files),)
include $(cmd_files)
endif
+# Create directories for object files if they do not exist
+obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets))))
+$(shell mkdir -p $(obj-dirs))
+
.PHONY: $(PHONY)