Reputation: 7318
make ARCH=arm msm_defconfig
make ARCH=arm CROSS_COMPILE=$SOURCE_FOLDER/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- zImage -j4
I would like to build android kernel, and I did find some tutorial on that. and I found the command above, I want to know how this command work? So if someone can explain it or give me some references on this, that will be better.
Thanks in advance !
Upvotes: 0
Views: 11785
Reputation: 79921
make ARCH=arm
will specify that this is an intended build for the ARM architecture since you are cross-compiling on a non-ARM system. CROSS_COMPILE
is specifying the name to append to tools so that the correct tools are used to generate your resulting object files and binaries.
ARCH=arm
is actually a local environment variable (for lack of the official term) - you could have set it as an environment variable. Same thing with CROSS_COMPILE
export ARCH=arm
export CROSS_COMPILE="..."
make -j4 zImage
Though if you did that, you might affect your environment for all make
commands executed.
edit The only resource that seemed useful in explaining those two flags to any extent, as everyone else basically says to copy what they do without fully explaining it: http://book.opensourceproject.org.cn/embedded/oreillybuildembed/opensource/belinuxsys-chp-5-sect-3.html
Upvotes: 2
Reputation: 798686
Parameters to make
with a =
are converted to variables within the makefile. -j
tells make to run multiple parallel processes to handle the build. The remaining argument is the build target. See both Makefile
in the current directory as well as the GNU make documentation for more details.
Upvotes: 1