Hello,
Is there a sensible way of forcing a .c file to be explicitly dependent
on autoconf.h, thus bypassing the CONFIG_ dependency intelligence built
into fixdep?
Here's why I want to do this: In some platform setup code I use a
structure initialiser macro like this:
#include <autoconf.h>
...
struct device_struct {
unsigned baseaddr;
unsigned highaddr;
};
#define INITIALIZER(n) \
{ \
.baseaddr = CONFIG_FOOBAR_##n##_BASEADDR, \
.highaddr = CONFIG_FOOBAR_##n##_HIGHADDR, \
}
struct device_struct my_devices[]={
INITIALIZER(0),
INITIALIZER(1),
..
}
and so on.
fixdep sees that I am including autoconf.h, and attempts its
substitution trick.
The problem is, that the "dependent" config variables, in this case
CONFIG_FOOBAR_0_BASEADDR, CONFIG_FOOBAR_0_HIGHADDR, and so on, are not
explicitly referenced in my source file. They only exist after the
expansion of the initialiser macro, which fixdep never sees.
As a result, if any of these config variables change, my C file is not
rebuilt.
As I see it I have a few ways of fixing or working around this:
1. Tweak my Makefile to force a dependency on include/linux/autoconf.h
for this source file. (I don't care if it is rebuilt more often than
strictly necessary)
2. Do something horrible like reference these CONFIG_FOOBAR_0...
identifiers in a comment, to trick fixdep into giving me the dependency
3. Make fixdep smart enough to look into the macro expansion and
parameter substitution (no thanks!)
I've read the kbuild doco in the kernel tree and still couldn't see how
to achieve (1), which seems by far my simplest approach.
Any comments or suggestions welcomed.
Thanks,
John
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kbuild-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel