]> git.karo-electronics.de Git - linux-beck.git/commitdiff
kbuild: collect shorthands into scripts/Kbuild.include
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Wed, 26 Nov 2014 10:31:13 +0000 (19:31 +0900)
committerMichal Marek <mmarek@suse.cz>
Wed, 26 Nov 2014 13:36:52 +0000 (14:36 +0100)
The shorthand "clean" is defined in both the top Makefile and
scripts/Makefile.clean.  Likewise, the "hdr-inst" is defined in
both the top Makefile and scripts/Makefile.headersinst.

To reduce code duplication, this commit collects them into
scripts/Kbuild.include like the "build" and "modbuiltin" shorthands.
It requires scripts/Makefile.clean to include scripts/Kbuild.include,
but its impact on the performance of "make clean" should be
negligible.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Makefile
scripts/Kbuild.include
scripts/Makefile.clean
scripts/Makefile.headersinst

index 05d67af376c5ed73f911deabf130817a8521cdeb..0032d1ca4e49ee213d77e287578d7cc4468b9d4e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1035,8 +1035,6 @@ firmware_install: FORCE
 #Default location for installed headers
 export INSTALL_HDR_PATH = $(objtree)/usr
 
-hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
-
 # If we do an all arch process set dst to asm-$(hdr-arch)
 hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
 
@@ -1580,11 +1578,6 @@ ifneq ($(cmd_files),)
   include $(cmd_files)
 endif
 
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=dir
-# Usage:
-# $(Q)$(MAKE) $(clean)=dir
-clean := -f $(srctree)/scripts/Makefile.clean obj
-
 endif  # skip-makefile
 
 PHONY += FORCE
index 65e7b08bb2cc04db54412c07e72ef16c9fe2344e..0f909814edfc9ceb55c7d2a3baa7992f74e17688 100644 (file)
@@ -179,6 +179,18 @@ build := -f $(srctree)/scripts/Makefile.build obj
 # $(Q)$(MAKE) $(modbuiltin)=dir
 modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
 
+###
+# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=
+# Usage:
+# $(Q)$(MAKE) $(clean)=dir
+clean := -f $(srctree)/scripts/Makefile.clean obj
+
+###
+# Shorthand for $(Q)$(MAKE) -rR -f scripts/Makefile.headersinst obj=
+# Usage:
+# $(Q)$(MAKE) $(hdr-inst)=dir
+hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+
 # Prefix -I with $(srctree) if it is not an absolute path.
 # skip if -I has no parameter
 addtree = $(if $(patsubst -I%,%,$(1)), \
index b1c668dc68150b4780d0c5ff0c69cec5278c2daf..0aa91a07d9681a47adb9cb08a4a63e001ae08f57 100644 (file)
@@ -7,10 +7,7 @@ src := $(obj)
 PHONY := __clean
 __clean:
 
-# Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir
-# Usage:
-# $(Q)$(MAKE) $(clean)=dir
-clean := -f $(srctree)/scripts/Makefile.clean obj
+include scripts/Kbuild.include
 
 # The filename Kbuild has precedence over Makefile
 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
index 8ccf83056a7ab6b260a028a9ee9a422e6949525e..1106d6ca3a384baa81b077b599d83b8e9941108e 100644 (file)
@@ -122,7 +122,6 @@ $(check-file): scripts/headers_check.pl $(output-files) FORCE
 endif
 
 # Recursion
-hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
 .PHONY: $(subdirs)
 $(subdirs):
        $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(_dst)/$@