Skip to content

Commit

Permalink
kbuild: simplify build, clean, modbuiltin shorthands
Browse files Browse the repository at this point in the history
$(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]>
  • Loading branch information
masahir0y authored and michal42 committed Oct 2, 2014
1 parent 226422d commit 5b2389b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ endif
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
clean := -f $(srctree)/scripts/Makefile.clean obj

endif # skip-makefile

Expand Down
4 changes: 2 additions & 2 deletions scripts/Kbuild.include
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ ld-ifversion = $(shell [ $(call ld-version) $(1) $(2) ] && echo $(3))
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
# $(Q)$(MAKE) $(build)=dir
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
build := -f $(srctree)/scripts/Makefile.build obj

###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
# Usage:
# $(Q)$(MAKE) $(modbuiltin)=dir
modbuiltin := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.modbuiltin obj
modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj

# Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.clean
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __clean:
# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
# Usage:
# $(Q)$(MAKE) $(clean)=dir
clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj
clean := -f $(srctree)/scripts/Makefile.clean obj

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

0 comments on commit 5b2389b

Please sign in to comment.