From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>,
Michal Marek <mmarek@suse.cz>,
"H. Peter Anvin" <hpa@linux.intel.com>,
Andi Kleen <ak@linux.intel.com>, Sam Ravnborg <sam@ravnborg.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: collect shorthands into the top Makefile
Date: Wed, 29 Oct 2014 16:27:31 +0900 [thread overview]
Message-ID: <1414567651-2503-1-git-send-email-yamada.m@jp.panasonic.com> (raw)
The motivation of this commit is to avoid duplicated definitions
of "clean" and "hdr-inst" shorthands.
The shorthand "clean" is defined in both the top Makefile and
scripts/Makefile.clean.
Likewise, "hdr-inst" is defined in both the top Makefile and
scripts/Makefile.headersinst.
The idea here is define and export them in the top Makefile
because $(srctree) is constant during the build process.
For consistency, "build" and "modbuiltin" should be also moved.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
Makefile | 13 ++++++-------
scripts/Kbuild.include | 12 ------------
scripts/Makefile.clean | 5 -----
| 1 -
4 files changed, 6 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index 52c1297..cb29318 100644
--- a/Makefile
+++ b/Makefile
@@ -440,6 +440,12 @@ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o \
export RCS_TAR_IGNORE := --exclude SCCS --exclude BitKeeper --exclude .svn \
--exclude CVS --exclude .pc --exclude .hg --exclude .git
+# Shorthands
+export build := -f $(srctree)/scripts/Makefile.build obj
+export modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
+export clean := -f $(srctree)/scripts/Makefile.clean obj
+export hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
+
# ===========================================================================
# Rules shared between *config targets and build targets
@@ -1035,8 +1041,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 +1584,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
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 65e7b08..98f081b 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -167,18 +167,6 @@ 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 $(srctree)/scripts/Makefile.build obj
-
-###
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
-# Usage:
-# $(Q)$(MAKE) $(modbuiltin)=dir
-modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
-
# Prefix -I with $(srctree) if it is not an absolute path.
# skip if -I has no parameter
addtree = $(if $(patsubst -I%,%,$(1)), \
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index b1c668d..2acaabd 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -7,11 +7,6 @@ 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
-
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
include $(if $(wildcard $(kbuild-dir)/Kbuild), $(kbuild-dir)/Kbuild, $(kbuild-dir)/Makefile)
--git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst
index 8ccf830..1106d6c 100644
--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -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)/$@
--
1.9.1
next reply other threads:[~2014-10-29 7:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 7:27 Masahiro Yamada [this message]
2014-10-29 18:59 ` Sam Ravnborg
2014-10-31 2:12 ` Masahiro Yamada
2014-11-25 21:23 ` Michal Marek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1414567651-2503-1-git-send-email-yamada.m@jp.panasonic.com \
--to=yamada.m@jp.panasonic.com \
--cc=ak@linux.intel.com \
--cc=hpa@linux.intel.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®