On Mon, Jul 26, 2010 at 12:01 PM, Peter Stuge peter@stuge.se wrote:
Myles Watson wrote:
- Just use the path
I think this is *by far* the cleanest approach!
I agree that it looks the best. I'm worried that it introduces ambiguity.
#include <path/file.h>
Could look in src/path/file.h or src/include/path/file.h and others
Is that what we want? Should we remove -I$(src) from the command line in the long term?
It won't be, but I think it should only be used for including .c files for romcc.
I'm not sure that I feel good about .h files outside include/ being referenced from other parts of the code. They should probably be moved to include/ if they are needed in more than one place..
So I guess option 1 is the best. It makes it obvious (and ugly) when that rule is ignored.
from src/arch/i386/Makefile.bootblock.inc:
$(CC) -MMD -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -I$(obj)/bootblock -include $(obj)/config.h -I. -I$(src) $< -o $@
I forgot about all of our included .c files. That's the reason for -I$(src).
And again, why are there include files in src/arch/i386/include instead of include/arch-i386 or something?
Linux does it that way. It keeps all of the architecture-specific code and includes under arch/
include_path.diff: fix the ones that are broken for me. include_path2.diff: fix the ones that look identical but work anyway. include_path3.diff: fix <../path/file.h> to be "../../../path/file.h" to make it obvious that they're not in src/include
Abuild tested.
Signed-off-by: Myles Watson mylesgw@gmail.com
Thanks, Myles