Patchwork Broken include paths

login
register
about
Submitter Myles Watson
Date 2010-07-26 19:17:03
Message ID <AANLkTinCw7mtjoqHUjV37qaNQBdWa+dyXFKACvE_ZD1P@mail.gmail.com>
Download mbox | patch
Permalink /patch/1682/
State Accepted
Headers show

Comments

Myles Watson - 2010-07-26 19:17:03
On Mon, Jul 26, 2010 at 12:01 PM, Peter Stuge <peter@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@gmail.com>

Thanks,
Myles

Patch

Index: svn/src/mainboard/amd/dbm690t/fadt.c
===================================================================
--- svn.orig/src/mainboard/amd/dbm690t/fadt.c
+++ svn/src/mainboard/amd/dbm690t/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/amd/mahogany/fadt.c
===================================================================
--- svn.orig/src/mainboard/amd/mahogany/fadt.c
+++ svn/src/mainboard/amd/mahogany/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb700/sb700.h>
+#include "../../../southbridge/amd/sb700/sb700.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/amd/mahogany_fam10/fadt.c
===================================================================
--- svn.orig/src/mainboard/amd/mahogany_fam10/fadt.c
+++ svn/src/mainboard/amd/mahogany_fam10/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb700/sb700.h>
+#include "../../../southbridge/amd/sb700/sb700.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/amd/pistachio/fadt.c
===================================================================
--- svn.orig/src/mainboard/amd/pistachio/fadt.c
+++ svn/src/mainboard/amd/pistachio/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/amd/tilapia_fam10/fadt.c
===================================================================
--- svn.orig/src/mainboard/amd/tilapia_fam10/fadt.c
+++ svn/src/mainboard/amd/tilapia_fam10/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb700/sb700.h>
+#include "../../../southbridge/amd/sb700/sb700.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/asrock/939a785gmh/fadt.c
===================================================================
--- svn.orig/src/mainboard/asrock/939a785gmh/fadt.c
+++ svn/src/mainboard/asrock/939a785gmh/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb700/sb700.h>
+#include "../../../southbridge/amd/sb700/sb700.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/kontron/kt690/fadt.c
===================================================================
--- svn.orig/src/mainboard/kontron/kt690/fadt.c
+++ svn/src/mainboard/kontron/kt690/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/technexion/tim5690/fadt.c
===================================================================
--- svn.orig/src/mainboard/technexion/tim5690/fadt.c
+++ svn/src/mainboard/technexion/tim5690/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/mainboard/technexion/tim5690/speaker.c
===================================================================
--- svn.orig/src/mainboard/technexion/tim5690/speaker.c
+++ svn/src/mainboard/technexion/tim5690/speaker.c
@@ -29,7 +29,7 @@ 
 #include <arch/io.h>
 #include <device/pci.h>
 #include <device/pci_ids.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 #include <delay.h>
 
 #endif /* __PRE_RAM__ */
Index: svn/src/mainboard/technexion/tim8690/fadt.c
===================================================================
--- svn.orig/src/mainboard/technexion/tim8690/fadt.c
+++ svn/src/mainboard/technexion/tim8690/fadt.c
@@ -26,7 +26,7 @@ 
 #include <arch/acpi.h>
 #include <arch/io.h>
 #include <device/device.h>
-#include <../southbridge/amd/sb600/sb600.h>
+#include "../../../southbridge/amd/sb600/sb600.h"
 
 /*extern*/ u16 pm_base = 0x800;
 /* pm_base should be set in sb acpi */
Index: svn/src/northbridge/via/vx800/examples/chipset_init.c
===================================================================
--- svn.orig/src/northbridge/via/vx800/examples/chipset_init.c
+++ svn/src/northbridge/via/vx800/examples/chipset_init.c
@@ -21,7 +21,7 @@ 
 #if CONFIG_HAVE_ACPI_RESUME == 1
 #include <arch/acpi.h>
 #endif
-#include <../northbridge/via/vx800/vx800.h>
+#include "../vx800.h"
 
 #include <arch/io.h>
 #include "pci_rawops.h"