diff options
| author | John Rigby <john.rigby@linaro.org> | 2011-03-02 20:57:21 -0500 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2012-03-26 05:27:07 -0400 |
| commit | a6b3d7a1815c4a11efacd4ef8141a02eb9805a79 (patch) | |
| tree | 30a5bea756cba9c71ca0d4bc6017d52668e07f86 /scripts/Kbuild.include | |
| parent | d4920420d54c6d433fd7f185341daed4787a2fdd (diff) | |
KBuild: Allow scripts/* to be cross compiled
BugLink: http://bugs.launchpad.net/bugs/963823
Cross compiling the binaries in scripts/* is not possible
because various makefiles assume that $(obj)/whatever is
executable on the build host.
This patch introduces a new variable called KBUILD_SCRIPTROOT
that points to script/binaries to use while cross compiling.
Usage:
Build scripts for the build host:
make O=path/to/buildhost/buildscripts \
silentoldconfig prepare scripts
Then cross build script for target:
make O=path/to/target/buildscripts \
HOSTCC=$CROSS_COMPILE \
KBUILD_SCRIPTROOT=path/to/buildhost/buildscripts
silentoldconfig prepare scripts
This patch does not use KBUILD_SCRIPTROOT for all script invocations
it only redefines the following if KBUILD_SCRIPTROOT is defined.
scripts/Makefile.build
scripts/basic/fixdep --> $(KBUILD_SCRIPTROOT)/scripts/basic/fixdep
scripts/kconfig/Makefile
$(obj)/conf --> $(KBUILD_SCRIPTROOT)/scripts/kconfig/conf
scripts/mod/Makefile
$(obj)mk_elfconfig --> $(KBUILD_SCRIPTROOT)/scripts/mod/mk_elfconfig
Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'scripts/Kbuild.include')
| -rw-r--r-- | scripts/Kbuild.include | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index be39cd1c74c..30103da6e38 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include | |||
| @@ -218,11 +218,15 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ | |||
| 218 | $(echo-cmd) $(cmd_$(1)); \ | 218 | $(echo-cmd) $(cmd_$(1)); \ |
| 219 | echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd) | 219 | echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd) |
| 220 | 220 | ||
| 221 | ifeq ($(KBUILD_SCRIPTROOT),) | ||
| 222 | KBUILD_SCRIPTROOT=. | ||
| 223 | endif | ||
| 224 | |||
| 221 | # Execute the command and also postprocess generated .d dependencies file. | 225 | # Execute the command and also postprocess generated .d dependencies file. |
| 222 | if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ | 226 | if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ), \ |
| 223 | @set -e; \ | 227 | @set -e; \ |
| 224 | $(echo-cmd) $(cmd_$(1)); \ | 228 | $(echo-cmd) $(cmd_$(1)); \ |
| 225 | scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ | 229 | $(KBUILD_SCRIPTROOT)/scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\ |
| 226 | rm -f $(depfile); \ | 230 | rm -f $(depfile); \ |
| 227 | mv -f $(dot-target).tmp $(dot-target).cmd) | 231 | mv -f $(dot-target).tmp $(dot-target).cmd) |
| 228 | 232 | ||
