[U-Boot] without board level config.mk How to add CPPFLAGS

Because the board level config.mk not suggested now(I had seen in some email message). So now how can I add my own CPPFLAGS or PLATFORM_CPPFLAGS direct in board level Makefile (For some header search path)?

Dear zzs,
In message 20110328080338.GB26252@greatfirst.com you wrote:
Because the board level config.mk not suggested now(I had seen in some email message). So now how can I add my own CPPFLAGS or PLATFORM_CPPFLAGS direct in board level Makefile (For some header search path)?
What exactly would you need board specific CPPFLAGS settings for?
Best regards,
Wolfgang Denk

In message 20110328080338.GB26252@greatfirst.com you wrote:
Because the board level config.mk not suggested now(I had seen in some email message). So now how can I add my own CPPFLAGS or PLATFORM_CPPFLAGS direct in board level Makefile (For some header search path)?
What exactly would you need board specific CPPFLAGS settings for?
I just want to add a -iquote flag for searching my header file which in the linux driver dir.
I had wrote a linux driver and has a header file in it. Now I want to write this driver for u-boot. So I think copy that header file to u-boot source tree is not a good idea because I must modify two same file when something wrong.
So I want add "-iquote my/header/dir" to CPPFLAGS
The Makefile like this :
ifeq "$(REPOS_COMMON_DIR)" "" $(error "common repository path must defined in env!") else CPPFLAGS += -iquote $(REPOS_COMMON_DIR)/include -iquote $(REPOS_LINUX_DRIVER_DIR) endif
...
COBJS-$(CONFIG_ALTERA_FPGA) += cfg-altera-fpga.o
But when make it, the arm-linux-gcc command line not have my "-iquote" flags.
Now I add them to both CPPFLAGS and CFLAGS, like this:
ifeq "$(REPOS_COMMON_DIR)" "" $(error "common repository path must defined in env!") else CPPFLAGS += -iquote $(REPOS_COMMON_DIR)/include -iquote $(REPOS_LINUX_DRIVER_DIR) CFLAGS += -iquote $(REPOS_COMMON_DIR)/include -iquote $(REPOS_LINUX_DRIVER_DIR) endif
...
COBJS-$(CONFIG_ALTERA_FPGA) += cfg-altera-fpga.o
It now works! but it's so strange!!
Is there any good methods?

Dear zzs,
In message 20110328091916.GC26252@greatfirst.com you wrote:
What exactly would you need board specific CPPFLAGS settings for?
I just want to add a -iquote flag for searching my header file which in the linux driver dir.
This will not be accepted.
U-Boot is supposed to be self-contained. It must not reference any source (or header) files outside the U-Boot directory.
I had wrote a linux driver and has a header file in it. Now I want to write this driver for u-boot. So I think copy that header file to u-boot source tree is not a good idea because I must modify two same file when something wrong.
You can probably write the file such that both U-Boot and Linux can use the same version.
So I want add "-iquote my/header/dir" to CPPFLAGS
This will not be accepted.
Is there any good methods?
Make sure that U-Boot has all files it needs in it's own source tree.
Best regards,
Wolfgang Denk

Dear zzs,
In message 20110328134932.GA23052@greatfirst.com you wrote:
So I want add "-iquote my/header/dir" to CPPFLAGS
This will not be accepted.
Does this means that there are no way to append custom cpp flags to CPPFLAGS ?
No, it means that your approach to include out-of-tree files has been rejected. Nothing more and not less.
Best regards,
Wolfgang Denk

So I want add "-iquote my/header/dir" to CPPFLAGS
This will not be accepted.
Does this means that there are no way to append custom cpp flags to CPPFLAGS ?
No, it means that your approach to include out-of-tree files has been rejected. Nothing more and not less.
And then how to do that thing : Append custom cpp flags to CPPFLAGS ?
e.g. -Wcomments
And after append them to CPPFLAGS, Does these flags appear in CFLAGS auto automatically ?

Dear zzs,
In message 20110329012444.GA2470@greatfirst.com you wrote:
And then how to do that thing : Append custom cpp flags to CPPFLAGS ?
e.g. -Wcomments
And after append them to CPPFLAGS, Does these flags appear in CFLAGS auto automatically ?
Use CFLAGS_$(BCURDIR) if you want to set this for all files in a specific directory, or CFLAGS_$(BCURDIR)/$(@F) if you want to set this for a single file only.
Best regards,
Wolfgang Denk
participants (2)
-
Wolfgang Denk
-
zzs