Hardware Reference
In-Depth Information
However, this is tedious and error prone. You could use an alias or some other
workaround, but the best approach is probably just to edit these parameters in the
top-level
Makefile
.
Using an editor of your choice, look for a line in the top-level
Makefile
that starts
with
ARCH=
, as shown here:
ARCH ?= $ (SUBARCH)
CROSS_COMPILE ?= $ (CONFIG_CROSS_COMPILE:"%"=%)
The safest thing to do is to duplicate these pair of lines and comment out the first
pair, keeping them around in their original form. Then modify the second pair as shown:
#ARCH ?= $ (SUBARCH)
#CROSS_COMPILE ?= $ (CONFIG_CROSS_COMPILE:"%"=%)
ARCH ?= arm
CROSS_COMPILE ?= \
/opt/x−tools/arm−unknown−linux−gnueabi/bin/arm−unknown−linux−gnueabi−
The
CROSS_COMPILE
prefix should match everything up to but not including the
command name
gcc
shown next (edited to fit). If you've not already done so, edit the
PATH
variable so that the cross-compiler tools are searched first:
PATH="/opt/x-tools/arm-unknown-linux-gnueabi/bin:$PATH"
Now verify that your compiler is being located:
$ type arm−unknown−linux−gnueabi−gcc
arm−unknown−linux−gnueabi−gcc is hashed \
(/opt/x−tools/arm−unknown−linux−gnueabi/bin/arm−unknown−linux−gnueabi−gcc)
make mrproper
In theory, this step shouldn't be necessary. But the kernel developers want you to do it
anyway, in case something was accidentally left out of place. Keep in mind that this step
also removes the
.config
file. So if you need to keep it, make a copy of it.
$ make mrproper
■
the command
make mrproper
cleans up everything, including your
kernel
.config
file. You may want to copy
.config
to
.config.bak
.
Caution