aboutsummaryrefslogtreecommitdiff
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2012-01-10 12:01:41 -0700
committerAndrey Konovalov <andrey.konovalov@linaro.org>2013-05-13 21:00:57 +0400
commitb5c100b9517ae793720215d4f9a68138f8c2cf67 (patch)
treee99e05416cf4ecce7adfff1d01d23bd2e7001132 /scripts/Makefile.build
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
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>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index d5d859c80729..de351927a7c0 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -291,13 +291,17 @@ cmd_record_mcount = \
fi;
endif
+ifeq ($(KBUILD_SCRIPTROOT),)
+KBUILD_SCRIPTROOT=.
+endif
+
define rule_cc_o_c
$(call echo-cmd,checksrc) $(cmd_checksrc) \
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
$(cmd_modversions) \
$(call echo-cmd,record_mcount) \
$(cmd_record_mcount) \
- scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
+ $(KBUILD_SCRIPTROOT)/scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' > \
$(dot-target).tmp; \
rm -f $(depfile); \
mv -f $(dot-target).tmp $(dot-target).cmd