diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2024-04-27 23:55:01 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2024-05-10 04:33:45 +0900 |
commit | 9a0ebe5011f49e932bb0a2cea2034fd65e6e567e (patch) | |
tree | c7c8b711a61233a0d918adb4a1182ecb8c501171 /scripts/Makefile.lib | |
parent | 9dcb47a616d552306a01c2032b81c0c920b06847 (diff) |
kbuild: use $(obj)/ instead of $(src)/ for common pattern rules
Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for
checked-in source files. It is merely a convention without any functional
difference. In fact, $(obj) and $(src) are exactly the same, as defined
in scripts/Makefile.build:
src := $(obj)
Before changing the semantics of $(src) in the next commit, this commit
replaces $(obj)/ with $(src)/ in pattern rules where the prerequisite
might be a generated file.
C, assembly, Rust, and DTS files are sometimes generated by tools, so
they could be either generated files or real sources. The $(obj)/ prefix
works for both cases with the help of VPATH.
As mentioned above, $(obj) and $(src) are the same at this point, hence
this commit has no functional change.
I did not modify scripts/Makefile.userprogs because there is no use
case where userspace C files are generated.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to 'scripts/Makefile.lib')
-rw-r--r-- | scripts/Makefile.lib | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e67f066c0cea..42d3c772c8e0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -423,7 +423,7 @@ quiet_cmd_dtb = $(quiet_cmd_dtc) cmd_dtb = $(cmd_dtc) endif -$(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE +$(obj)/%.dtb: $(obj)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE $(call if_changed_dep,dtb) $(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE |