Easily cross-compiling a kernel
To avoid having to export the CROSS_COMPILE variable every time you recompile your cross-compile kernel, a suggestion I found is to define the variable in the Makefile itself. Like so:
This is nice, but then I get conflicts when I pull in the new kernel updates with git. Or even worse, my kernel version gets tagged as "-dirty" to reflect the modified source tree, as opposed to a pristine git checkout. So, a workaround is to put these in a GNUmakefile (checked first by GNU make, and not managed in the kernel repo).
ARCH = arm
CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi-
This is nice, but then I get conflicts when I pull in the new kernel updates with git. Or even worse, my kernel version gets tagged as "-dirty" to reflect the modified source tree, as opposed to a pristine git checkout. So, a workaround is to put these in a GNUmakefile (checked first by GNU make, and not managed in the kernel repo).
$ cat <<EOF >GNUmakefile
ARCH = arm
CROSS_COMPILE = armv5tel-softfloat-linux-gnueabi-
include Makefile
EOF
Comments
Post a Comment