makefile

How do I run this cross-compilation command?


make -C kernel_build_dir M=`pwd` ARCH=arm CROSS_COMPILE=<...> modules

I am trying to run this command but not sure where I could find "kernel_build_dir" and what is "<...>" ?

What do I enter for <...>?


Solution

  • I'm not sure what are you trying to do with that command. I'm not sure if it is a custom makefile, or the one you get with the Linux sources,or something more exotic; but it looks like you are compiling a Linux kernel. Then, kernel_build_dir refers to the directory where your linux sources are stored.

    From the man of make (man is your best ally in linux administration. Type man command to read a brief on what does command do):

    -C dir, --directory=dir

    Change to directory dir before reading the makefiles or doing anything else. If multiple -C options are specified, each is interpreted relative to the previous one: -C / -C etc is equivalent to -C /etc. This is typically used with recursive invocations of make.

    I'm sorry, but I don't know what to enter for "<...>". It looks like some kind of flag you are passing to your build, but I can't tell you anything else if I don't know what do you want to accomplish... Are you getting that command from a tutorial or something? It would help to see a link.

    Anyways, in kernel compilation matters, I found Gentoo distro documentation very useful and instructive, especially this part.