What about cross-compilation?
Posted Feb 6, 2003 21:02 UTC (Thu) by Peter
In reply to: What about cross-compilation?
Parent article: Driver porting: compiling external modules
The Makefile trickery at the end isn't going to work in cross-compiler enviornments. My company is building a product that
uses Linux as the embedded OS, but builds typically take place on Solaris.
True enough. In fact, there is no automated way for the computer to read your mind and know, for a specific module build, where the matching kernel tree resides. If you don't give the computer any more information, one reasonable guess is "wherever the currently-running kernel was built, assuming it was built on this machine". In fact, I can't think of a better default guess. But if this turns out to be wrong - for various reasons, including cross-compilation - you are going to have to specify the source location.
Putting that location in the Makefile as a special macro like KERNELDIR makes it possible to override on the command line: 'make KERNELDIR=...'. The other option, of course, is to work to get your module integrated into the official kernel tree, at which time you are rid of this headache once and for all.
to post comments)