[coreboot] Broken include paths

Myles Watson mylesgw at gmail.com
Mon Jul 26 21:17:03 CEST 2010


On Mon, Jul 26, 2010 at 12:01 PM, Peter Stuge <peter at stuge.se> wrote:
> Myles Watson wrote:
>> >> 3. 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 at gmail.com>

Thanks,
Myles
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_path.diff
Type: text/x-diff
Size: 2331 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100726/7efd9f95/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_path2.diff
Type: text/x-diff
Size: 8227 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100726/7efd9f95/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_path3.diff
Type: text/x-diff
Size: 5190 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20100726/7efd9f95/attachment-0002.bin>


More information about the coreboot mailing list