Skip to content

Commit 5b2389b

Browse files
masahir0ymichal42
authored andcommitted
kbuild: simplify build, clean, modbuiltin shorthands
$(if $(KBUILD_SRC),$(srctree)/) was a useful strategy to omit a long absolute path for in-source-tree build prior to commit 890676c (kbuild: Use relative path when building in the source tree). Now $(srctree) is "." when building in the source tree. It would not be annoying to add "$(srctree)/" all the time. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent 226422d commit 5b2389b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ endif
15681568
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
15691569
# Usage:
15701570
# $(Q)$(MAKE) $(clean)=dir
1571-
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
1571+
clean := -f $(srctree)/scripts/Makefile.clean obj
15721572

15731573
endif # skip-makefile
15741574

scripts/Kbuild.include

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
171171
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
172172
# Usage:
173173
# $(Q)$(MAKE) $(build)=dir
174-
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
174+
build := -f $(srctree)/scripts/Makefile.build obj
175175

176176
###
177177
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
178178
# Usage:
179179
# $(Q)$(MAKE) $(modbuiltin)=dir
180-
modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
180+
modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
181181

182182
# Prefix -I with $(srctree) if it is not an absolute path.
183183
# skip if -I has no parameter

scripts/Makefile.clean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ __clean:
1010
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
1111
# Usage:
1212
# $(Q)$(MAKE) $(clean)=dir
13-
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
13+
clean := -f $(srctree)/scripts/Makefile.clean obj
1414

1515
# The filename Kbuild has precedence over Makefile
1616
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))

0 commit comments

Comments
 (0)