Skip to contentSkip to conversation

Makefile: Include vendor common library in include search path

PATCH New Nishanth Menon 5 participants 22 messages Nov 5, 2015 – Nov 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
Makefile +1 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
#1 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 14 lines
Makefile +1 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Signature · 2 lines
Regards,
Nishanth Menon
#2 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Regards,
Simon

#3 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 34 lines · Simon Glass

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 7 lines

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Hmmm... Are folks ok if I create a softlink?

Signature · 3 lines
---
Regards,
Nishanth Menon
#4 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

2015-11-06 12:30 GMT+09:00 Nishanth Menon <[email protected]>:

Quoted 38 lines · Simon Glass
Quoted 37 lines

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

Quoted 6 lines
Quoted 4 lines

#include <board-common/...>

and it would find the file?

Hmmm... Are folks ok if I create a softlink?

Or, you can maybe add the following into board/ti/am57xx/Makefile.

subdir-ccflags-y := -I$(src)/../common

then, you can use #include <xyz.h> from your board/ti/am57xx/board.c

But, I personally wouldn't do this in this case
for the reason Simon mentioned.

How many vender-common do we have
and is it worth supporting #include <board-common/...>?

Signature · 2 lines
Best Regards
Masahiro Yamada
#5 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 44 lines · Masahiro Yamada

2015-11-06 12:30 GMT+09:00 Nishanth Menon <[email protected]>:

Quoted 43 lines · Simon Glass
Quoted 41 lines

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Quoted 8 lines
Quoted 1 line

Hmmm... Are folks ok if I create a softlink?

Or, you can maybe add the following into board/ti/am57xx/Makefile.

subdir-ccflags-y := -I$(src)/../common

then, you can use #include <xyz.h> from your board/ti/am57xx/board.c

I could, OR i could even do ../common/xyz.h (which is what current board files do)

Quoted 6 lines

But, I personally wouldn't do this in this case
for the reason Simon mentioned.

I agree as well. but the files are built without explicit board level Makefile rules, but the root Makefile(which makes this happen) does not ensure the headers are made available - that sounds contradictory.

Quoted 3 lines

How many vender-common do we have
and is it worth supporting #include <board-common/...>?

Surprisingly larger set that what I expected:

$ git branch -v|grep "^*"
* master c3c016cf7536 sf: Add SPI NOR protection mechanism
$ find board/ -iname "common"|wc -l
19
$ git grep "#include \"../common" board/|wc -l
141
Signature · 2 lines
Regards,
Nishanth Menon
#6 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 72 lines · Nishanth Menon
Quoted 44 lines · Masahiro Yamada

2015-11-06 12:30 GMT+09:00 Nishanth Menon <[email protected]>:

Quoted 43 lines · Simon Glass
Quoted 41 lines

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Quoted 8 lines
Quoted 1 line

Hmmm... Are folks ok if I create a softlink?

Or, you can maybe add the following into board/ti/am57xx/Makefile.

subdir-ccflags-y := -I$(src)/../common

then, you can use #include <xyz.h> from your board/ti/am57xx/board.c

I could, OR i could even do ../common/xyz.h (which is what current board files do)

Quoted 6 lines

But, I personally wouldn't do this in this case
for the reason Simon mentioned.

I agree as well. but the files are built without explicit board level Makefile rules, but the root Makefile(which makes this happen) does not ensure the headers are made available - that sounds contradictory.

Quoted 3 lines

How many vender-common do we have
and is it worth supporting #include <board-common/...>?

Quoted 8 lines

Surprisingly larger set that what I expected:

$ git branch -v|grep "^*"
* master c3c016cf7536 sf: Add SPI NOR protection mechanism
$ find board/ -iname "common"|wc -l
19
$ git grep "#include \"../common" board/|wc -l
141

Illustration Purposes only: example of how a
#include <board-common/xyz.h" could be done - is this what folks want me to do?

Kconfig +2 -0
index 821b464db207..6e825be0545e 100644
@@ -224,6 +224,8 @@ endmenu		# Boot images
 
 source "common/Kconfig"
 
+source "board/Kconfig"
+
 source "dts/Kconfig"
 
 source "net/Kconfig"
arch/arm/Kconfig +1 -0
index 0d756cbc55a2..62c9b90eac79 100644
@@ -356,6 +356,7 @@ config TARGET_AM335X_EVM
 	select DM
 	select DM_SERIAL
 	select DM_GPIO
+	select CREATE_BOARD_SYMLINK
 
 config TARGET_AM335X_SL50
 	bool "Support am335x_sl50"
scripts/Makefile.autoconf +17 -0
index d668982cc1dd..3f9b969c2271 100644
@@ -125,6 +125,23 @@ else
 	ln -fsn $$dest arch/$(ARCH)/include/asm/arch
 endif
 endif
+ifdef CONFIG_CREATE_BOARD_SYMLINK
+ifneq ($(KBUILD_SRC),)
+	if [ -d $(KBUILD_SRC)/board/$(VENDOR)/common/include ]; then \
+		dest=board/$(VENDOR)/common/include;			\
+	else								\
+		dest=board/$(VENDOR)/common;				\
+	fi;								\
+	ln -fsn $(KBUILD_SRC)/$$dest include/board-common
+else
+	if [ -d board/$(VENDOR)/common/include ]; then \
+		dest=board/$(VENDOR)/common/include;			\
+	else								\
+		dest=board/$(VENDOR)/common;				\
+	fi;								\
+	ln -fsn ../$$dest include/board-common
+endif
+endif
 
 PHONY += FORCE
 FORCE:
Signature · 2 lines
Regards,
Nishanth Menon
#7 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Hi,

Quoted 128 lines · Nishanth Menon
Quoted 72 lines · Nishanth Menon
Quoted 44 lines · Masahiro Yamada

2015-11-06 12:30 GMT+09:00 Nishanth Menon <[email protected]>:

Quoted 43 lines · Simon Glass
Quoted 41 lines

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Quoted 8 lines
Quoted 1 line

Hmmm... Are folks ok if I create a softlink?

Or, you can maybe add the following into board/ti/am57xx/Makefile.

subdir-ccflags-y := -I$(src)/../common

then, you can use #include <xyz.h> from your board/ti/am57xx/board.c

I could, OR i could even do ../common/xyz.h (which is what current board files do)

Quoted 6 lines

But, I personally wouldn't do this in this case
for the reason Simon mentioned.

I agree as well. but the files are built without explicit board level Makefile rules, but the root Makefile(which makes this happen) does not ensure the headers are made available - that sounds contradictory.

Quoted 3 lines

How many vender-common do we have
and is it worth supporting #include <board-common/...>?

Quoted 8 lines

Surprisingly larger set that what I expected:

$ git branch -v|grep "^*"
* master c3c016cf7536 sf: Add SPI NOR protection mechanism
$ find board/ -iname "common"|wc -l
19
$ git grep "#include \"../common" board/|wc -l
141

Illustration Purposes only: example of how a
#include <board-common/xyz.h" could be done - is this what folks want me to do?

Kconfig +2 -0
index 821b464db207..6e825be0545e 100644
@@ -224,6 +224,8 @@ endmenu             # Boot images
 
 source "common/Kconfig"
 
+source "board/Kconfig"
+
 source "dts/Kconfig"
 
 source "net/Kconfig"
arch/arm/Kconfig +1 -0
index 0d756cbc55a2..62c9b90eac79 100644
@@ -356,6 +356,7 @@ config TARGET_AM335X_EVM
        select DM
        select DM_SERIAL
        select DM_GPIO
+       select CREATE_BOARD_SYMLINK
 
 config TARGET_AM335X_SL50
        bool "Support am335x_sl50"
scripts/Makefile.autoconf +11 -0
index d668982cc1dd..3f9b969c2271 100644
@@ -125,6 +125,23 @@ else
        ln -fsn $$dest arch/$(ARCH)/include/asm/arch
 endif
 endif
+ifdef CONFIG_CREATE_BOARD_SYMLINK
+ifneq ($(KBUILD_SRC),)
+       if [ -d $(KBUILD_SRC)/board/$(VENDOR)/common/include ]; then \
+               dest=board/$(VENDOR)/common/include;                    \
+       else                                                            \
+               dest=board/$(VENDOR)/common;                            \
+       fi;                                                             \
+       ln -fsn $(KBUILD_SRC)/$$dest include/board-common
+else
+       if [ -d board/$(VENDOR)/common/include ]; then \
+               dest=board/$(VENDOR)/common/include;                    \

scripts/Makefile.autoconf else

Quoted 10 lines
scripts/Makefile.autoconf +6 -1
+       else                                                            \
+               dest=board/$(VENDOR)/common;                            \
+       fi;                                                             \
+       ln -fsn ../$$dest include/board-common
+endif
+endif
 
 PHONY += FORCE
 FORCE:
--

It looks reasonable to me. Tom and Masahiro may have opinions on this too.

Regards,
Simon

#8 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 138 lines · Simon Glass

Hi,

Quoted 135 lines · Nishanth Menon
Quoted 72 lines · Nishanth Menon
Quoted 44 lines · Masahiro Yamada

2015-11-06 12:30 GMT+09:00 Nishanth Menon <[email protected]>:

Quoted 43 lines · Simon Glass
Quoted 41 lines

Hi,

Quoted 23 lines · Nishanth Menon
Quoted 10 lines · Nishanth Menon

When the vendor common libraries exists, then board should be able to reference headers located there, rather than having to do weird logic such as '#include "../common/xyz.h"'.

---

 Makefile                | 1 +
 board/ti/am57xx/board.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Arrgh.. Apologies on the diffstat messup, but anyways, the patch does apply, and will wait to repost in case of further comments.

Quoted 8 lines
Makefile +0 -0
index 3c21f8ddf9e9..75d5ea802dfd 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
Quoted 7 lines

Makefile c_flags := $(KBUILD_CFLAGS) $(cpp_flags) · line 626

Quoted 6 lines
Makefile +1 -0
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

I suppose this is OK. But it might be hard to figure out where a header file is coming from. I wonder if we could make it support:

#include <board-common/...>

and it would find the file?

Quoted 8 lines
Quoted 1 line

Hmmm... Are folks ok if I create a softlink?

Or, you can maybe add the following into board/ti/am57xx/Makefile.

subdir-ccflags-y := -I$(src)/../common

then, you can use #include <xyz.h> from your board/ti/am57xx/board.c

I could, OR i could even do ../common/xyz.h (which is what current board files do)

Quoted 6 lines

But, I personally wouldn't do this in this case
for the reason Simon mentioned.

I agree as well. but the files are built without explicit board level Makefile rules, but the root Makefile(which makes this happen) does not ensure the headers are made available - that sounds contradictory.

Quoted 3 lines

How many vender-common do we have
and is it worth supporting #include <board-common/...>?

Quoted 8 lines

Surprisingly larger set that what I expected:

$ git branch -v|grep "^*"
* master c3c016cf7536 sf: Add SPI NOR protection mechanism
$ find board/ -iname "common"|wc -l
19
$ git grep "#include \"../common" board/|wc -l
141

Illustration Purposes only: example of how a
#include <board-common/xyz.h" could be done - is this what folks want me to do?

Kconfig +2 -0
index 821b464db207..6e825be0545e 100644
@@ -224,6 +224,8 @@ endmenu             # Boot images
 
 source "common/Kconfig"
 
+source "board/Kconfig"
+
 source "dts/Kconfig"
 
 source "net/Kconfig"
arch/arm/Kconfig +1 -0
index 0d756cbc55a2..62c9b90eac79 100644
@@ -356,6 +356,7 @@ config TARGET_AM335X_EVM
        select DM
        select DM_SERIAL
        select DM_GPIO
+       select CREATE_BOARD_SYMLINK
 
 config TARGET_AM335X_SL50
        bool "Support am335x_sl50"
scripts/Makefile.autoconf +17 -0
index d668982cc1dd..3f9b969c2271 100644
@@ -125,6 +125,23 @@ else
        ln -fsn $$dest arch/$(ARCH)/include/asm/arch
 endif
 endif
+ifdef CONFIG_CREATE_BOARD_SYMLINK
+ifneq ($(KBUILD_SRC),)
+       if [ -d $(KBUILD_SRC)/board/$(VENDOR)/common/include ]; then \
+               dest=board/$(VENDOR)/common/include;                    \
+       else                                                            \
+               dest=board/$(VENDOR)/common;                            \
+       fi;                                                             \
+       ln -fsn $(KBUILD_SRC)/$$dest include/board-common
+else
+       if [ -d board/$(VENDOR)/common/include ]; then \
+               dest=board/$(VENDOR)/common/include;                    \
+       else                                                            \
+               dest=board/$(VENDOR)/common;                            \
+       fi;                                                             \
+       ln -fsn ../$$dest include/board-common
+endif
+endif
 
Quoted 5 lines

scripts/Makefile.autoconf else

Quoted 3 lines
scripts/Makefile.autoconf +0 -1
 PHONY += FORCE
 FORCE:
--

It looks reasonable to me. Tom and Masahiro may have opinions on this too.

Conceptually fine with me. Do we really need a config option for it tho?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151107/aa952467/attachment.sig>
#9 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 2 lines · Tom Rini

Conceptually fine with me. Do we really need a config option for it tho?

I was following the lines of CONFIG_CREATE_ARCH_SYMLINK here. Is there some reason why you'd not want it so?

Regards,
Nishanth Menon

#10 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 7 lines · menon.nishanth at gmail.com
Quoted 2 lines · Tom Rini

Conceptually fine with me. Do we really need a config option for it tho?

I was following the lines of CONFIG_CREATE_ARCH_SYMLINK here. Is there some reason why you'd not want it so?

Masahiro?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151108/9021c525/attachment.sig>
#11 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

2015-11-09 1:38 GMT+09:00 Tom Rini <[email protected]>:

Quoted 11 lines · menon.nishanth at gmail.com
Quoted 7 lines · Tom Rini
Quoted 3 lines

Conceptually fine with me. Do we really need a config option for it tho?

I was following the lines of CONFIG_CREATE_ARCH_SYMLINK here. Is there some reason why you'd not want it so?

Masahiro?

Is this an improvement?

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

Signature · 2 lines
Best Regards
Masahiro Yamada
#12 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 13 lines · Masahiro Yamada

2015-11-09 1:38 GMT+09:00 Tom Rini <[email protected]>:

Quoted 11 lines · menon.nishanth at gmail.com
Quoted 7 lines · Tom Rini
Quoted 3 lines

Conceptually fine with me. Do we really need a config option for it tho?

I was following the lines of CONFIG_CREATE_ARCH_SYMLINK here. Is there some reason why you'd not want it so?

Masahiro?

Quoted 6 lines

Is this an improvement?

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

OK. what do we do?
option 1:
#include "..common/xyz.h"
141 something usage in board files do this for now..

option 2:
-I...common (auto generated - original patch) #include "xyz.h"
we dont like that since it does not tell us that xyz.h is a board-common header.

option 3:
#include <board-common/xyz.h>

this needs a soft link which we dont like either.

are there any other ways to do this?

Signature · 2 lines
Regards,
Nishanth Menon
#13 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Hi Masahiro,

Quoted 14 lines · Nishanth Menon
Quoted 13 lines · Masahiro Yamada

2015-11-09 1:38 GMT+09:00 Tom Rini <[email protected]>:

Quoted 11 lines · menon.nishanth at gmail.com
Quoted 7 lines · Tom Rini
Quoted 3 lines

Conceptually fine with me. Do we really need a config option for it tho?

I was following the lines of CONFIG_CREATE_ARCH_SYMLINK here. Is there some reason why you'd not want it so?

Masahiro?

Quoted 6 lines
Quoted 6 lines

Is this an improvement?

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

Quoted 12 lines

OK. what do we do?
option 1:
#include "..common/xyz.h"
141 something usage in board files do this for now..

option 2:
-I...common (auto generated - original patch) #include "xyz.h"
we dont like that since it does not tell us that xyz.h is a board-common header.

Quoted 4 lines

option 3:
#include <board-common/xyz.h>

this needs a soft link which we dont like either.

Well, I like it :-)

Quoted 10 lines

are there any other ways to do this?

--
Regards,
Nishanth Menon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
Simon

#14 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

Quoted 37 lines
Quoted 12 lines

OK. what do we do?
option 1:
#include "..common/xyz.h"
141 something usage in board files do this for now..

option 2:
-I...common (auto generated - original patch) #include "xyz.h"
we dont like that since it does not tell us that xyz.h is a board-common header.

Quoted 4 lines

option 3:
#include <board-common/xyz.h>

this needs a soft link which we dont like either.

Well, I like it :-)

Quoted 10 lines

are there any other ways to do this?

--
Regards,
Nishanth Menon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Regards,
Simon
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 2 lines
Best Regards
Masahiro Yamada
#15 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/

How does this sound?

Signature · 2 lines
Regards,
Nishanth Menon
#16 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

OK, i am out of ideas at least for now... Any other suggestions / opinions?

Signature · 2 lines
Regards,
Nishanth Menon
#17 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Hi,

Quoted 64 lines · Nishanth Menon
Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

Quoted 8 lines

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

OK, i am out of ideas at least for now... Any other suggestions / opinions?

If we don't want a symlink then option 5 seems good to me. Thanks very much for looking into this in so much detail, Nishanth.

Thoughts - Masahiro? Tom?

Regards,
Simon

#18 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 74 lines · Simon Glass

Hi,

Quoted 71 lines · Nishanth Menon
Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

Quoted 6 lines
Quoted 1 line

OK, i am out of ideas at least for now... Any other suggestions / opinions?

If we don't want a symlink then option 5 seems good to me. Thanks very much for looking into this in so much detail, Nishanth.

Thoughts - Masahiro? Tom?

No symlink should mean Masahiro is happy, so if you're fine with #5 then that works for me too, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/8e9e90fe/attachment.sig>
#19 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 77 lines · Tom Rini
Quoted 76 lines · Simon Glass

Hi,

Quoted 72 lines · Nishanth Menon
Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

OK, i am out of ideas at least for now... Any other suggestions / opinions?

Quoted 8 lines
Quoted 4 lines

If we don't want a symlink then option 5 seems good to me. Thanks very much for looking into this in so much detail, Nishanth.

Thoughts - Masahiro? Tom?

No symlink should mean Masahiro is happy, so if you're fine with #5 then that works for me too, thanks!

I just have yet another option 6 variation -> looking at the mach strategy:

UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common/include)

vendors should create common headers in
board/$(VENDOR)/include/board-common/xyz.h

the users then can do:
#include <board-common/xyz.h>

How does that sound? ofcourse, similar to mach, it requires some discipline..

Signature · 2 lines
Regards,
Nishanth Menon
#20 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Hi Nishanth,

Quoted 93 lines · Nishanth Menon
Quoted 77 lines · Tom Rini
Quoted 76 lines · Simon Glass

Hi,

Quoted 72 lines · Nishanth Menon
Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

OK, i am out of ideas at least for now... Any other suggestions / opinions?

Quoted 8 lines
Quoted 4 lines

If we don't want a symlink then option 5 seems good to me. Thanks very much for looking into this in so much detail, Nishanth.

Thoughts - Masahiro? Tom?

No symlink should mean Masahiro is happy, so if you're fine with #5 then that works for me too, thanks!

I just have yet another option 6 variation -> looking at the mach strategy:

UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common/include)

Quoted 8 lines

vendors should create common headers in
board/$(VENDOR)/include/board-common/xyz.h

the users then can do:
#include <board-common/xyz.h>

How does that sound? ofcourse, similar to mach, it requires some discipline..

Looks good, and it's nice that the files are in board/

Regards,
Simon

#21 lore raw

PATCH 1/1 Makefile: Include vendor common library in include search path

Quoted 99 lines · Simon Glass

Hi Nishanth,

Quoted 96 lines · Nishanth Menon
Quoted 77 lines · Tom Rini
Quoted 76 lines · Simon Glass

Hi,

Quoted 72 lines · Nishanth Menon
Quoted 54 lines · Nishanth Menon
Quoted 21 lines · Masahiro Yamada

2015-11-10 5:24 GMT+09:00 Simon Glass <[email protected]>:

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

I am unhappy because I was hoping
we could stop creating symbolic links during building in a long run.

But how? I don't see that it is possible if we want to have a sensible prefix for each include.

[step 1] move SoC-specific headers to arch/<arch>/mach-<soc>/include/mach

[step 2] change #include <asm/arch/foo.h> to #include <mach/foo.h>

[step 3] Drop CONFIG_CREATE_ARCH_SYMLINK

For example, mach-uniphier finished [1] and [2],
so it does not require the symbolic link.
(several ARM SoCs finished [1])

Quoted 5 lines

I think this is the way ARM should do, at least.

The topic of debate is PowerPC. Should we introduce mach-<soc> directories or not?

OK: Option 4:

How about this guys? include/board-common is an actual directory and instead of headers being located in board/$(VENDOR)/common or board/$(VENDOR)/common/include, we move the common headers to include/board/$(VENDOR)/ Directory. This will make the usage as follows:

#include <$(VENDOR)/xyz.h>

I know this does not exactly meet Simon's suggestion here of being identifiably board-common/xyz.h -> but at least knowing the prefix as vendor name implies a board common header.

Makefile +1 -0
index 3c21f8ddf9e9..2bd684199512 100644
@@ -620,6 +620,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
 # U-Boot objects....order is important (i.e. start must be first)
 
 HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
+UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/include/board-common)
 
 libs-y += lib/
 libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
Quoted 2 lines

How does this sound?

Spin off from option 4 is option 5 -> where we dont have the Makefile change. the board includes are located in include/board-common/$(VENDOR)/ directory.

Usage will be:

#include <board-common/$(VENDOR)/xyz.h>

Almost meets Simon's needs(identifiable as board common header) and I think matches what Masahiro-san wants as well(no symlinks).

OK, i am out of ideas at least for now... Any other suggestions / opinions?

Quoted 8 lines
Quoted 4 lines

If we don't want a symlink then option 5 seems good to me. Thanks very much for looking into this in so much detail, Nishanth.

Thoughts - Masahiro? Tom?

No symlink should mean Masahiro is happy, so if you're fine with #5 then that works for me too, thanks!

I just have yet another option 6 variation -> looking at the mach strategy:

UBOOTINCLUDE += $(if $(HAVE_VENDOR_COMMON_LIB:y=1), -I$(srctree)/board/$(VENDOR)/common/include)

vendors should create common headers in
board/$(VENDOR)/include/board-common/xyz.h

Quoted 7 lines
Quoted 5 lines

the users then can do:
#include <board-common/xyz.h>

How does that sound? ofcourse, similar to mach, it requires some discipline..

Looks good, and it's nice that the files are in board/

#6 it is, thanks again Nishanth!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151112/5e33227f/attachment.sig>