Skip to contentSkip to conversation

without board level config.mk How to add CPPFLAGS

U-Boot zzs 2 participants 9 messages Mar 28, 2011 – Mar 30, 2011

lore
Share & tools
lore

zzs

author
#0 lore raw

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)?

Signature · 2 lines
Best Regards,
zzs
#1 lore raw

Dear zzs,

Quoted 4 lines · In message <[email protected]> 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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If a train station is a place where a train stops,
                                           then what's a workstation?
author
#2 lore raw
Quoted 8 lines
Quoted 4 lines · In message <[email protected]> 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?

Signature · 2 lines
Best Regards,
zzs
#3 lore raw

Dear zzs,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 1 line

So I want add "-iquote my/header/dir" to CPPFLAGS

This will not be accepted.

Quoted 1 line

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

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
C++ was an interesting and valuable experiment, but we've learned its
lessons and it's time to move on.
                            - Peter Curran in <[email protected]>
author
#4 lore raw
Quoted 5 lines
Quoted 2 lines

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 ?

Signature · 2 lines
Best Regards,
zzs
#5 lore raw

Dear zzs,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Quoted 2 lines

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Research is what I'm doing when I don't know what I'm doing.
                                                 -- Wernher von Braun
author
#6 lore raw
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

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 ?

Signature · 2 lines
Best Regards,
zzs
#7 lore raw

Dear zzs,

Quoted 7 lines · In message <[email protected]> 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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many aligators will be slain, but the swamp will remain.
author
#8 lore raw
Quoted 5 lines

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.

Thanks !

Signature · 2 lines
Best Regards,
zzs