diff options
author | John Rigby <john.rigby@linaro.org> | 2012-01-10 12:01:41 -0700 |
---|---|---|
committer | Andrey Konovalov <andrey.konovalov@linaro.org> | 2013-03-11 22:49:50 +0400 |
commit | 5ce4daa4fcbf2084539ebbd6913785b1614f130a (patch) | |
tree | 64da51e376f3e55a4e0fc8beaa8ace13b7a73614 /scripts/mod | |
parent | f6161aa153581da4a3867a2d1a7caf4be19b6ec9 (diff) |
KBuild: Allow scripts/* to be cross compiledtracking-llct-v3.9-misc-fixes-llct-20130404.0tracking-llct-v3.9-misc-fixes-llct-20130402.0tracking-llct-v3.9-misc-fixes-llct-20130324.0tracking-llct-v3.9-misc-fixes-llct-20130321.0tracking-llct-v3.9-misc-fixes-llct-20130318.0tracking-llct-v3.9-misc-fixes-llct-20130315.0tracking-llct-v3.9-misc-fixes-llct-20130314.1tracking-llct-v3.9-misc-fixes-llct-20130314.0
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/mod')
-rw-r--r-- | scripts/mod/Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 9415b5663364..01e783fb93d9 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -1,6 +1,12 @@ hostprogs-y := modpost mk_elfconfig always := $(hostprogs-y) empty.o +ifdef KBUILD_SCRIPTROOT +MKELFCONFIG = $(KBUILD_SCRIPTROOT)/scripts/mod/mk_elfconfig +else +MKELFCONFIG = $(obj)/mk_elfconfig +endif + modpost-objs := modpost.o file2alias.o sumversion.o devicetable-offsets-file := devicetable-offsets.h @@ -43,9 +49,9 @@ $(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h $(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file) quiet_cmd_elfconfig = MKELF $@ - cmd_elfconfig = $(obj)/mk_elfconfig < $< > $@ + cmd_elfconfig = $(MKELFCONFIG) < $< > $@ -$(obj)/elfconfig.h: $(obj)/empty.o $(obj)/mk_elfconfig FORCE +$(obj)/elfconfig.h: $(obj)/empty.o $(MKELFCONFIG) FORCE $(call if_changed,elfconfig) targets += elfconfig.h |