public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] without board level config.mk How to add CPPFLAGS
@ 2011-03-28  8:03 zzs
  2011-03-28  8:53 ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: zzs @ 2011-03-28  8:03 UTC (permalink / raw)
  To: u-boot

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

-- 
Best Regards,
zzs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28  8:03 [U-Boot] without board level config.mk How to add CPPFLAGS zzs
@ 2011-03-28  8:53 ` Wolfgang Denk
  2011-03-28  9:19   ` zzs
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-03-28  8:53 UTC (permalink / raw)
  To: u-boot

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

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28  8:53 ` Wolfgang Denk
@ 2011-03-28  9:19   ` zzs
  2011-03-28 10:28     ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: zzs @ 2011-03-28  9:19 UTC (permalink / raw)
  To: u-boot

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

-- 
Best Regards,
zzs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28  9:19   ` zzs
@ 2011-03-28 10:28     ` Wolfgang Denk
  2011-03-28 13:49       ` zzs
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-03-28 10:28 UTC (permalink / raw)
  To: u-boot

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

-- 
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 <DCqM4z.BxB@isgtec.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28 10:28     ` Wolfgang Denk
@ 2011-03-28 13:49       ` zzs
  2011-03-28 18:15         ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: zzs @ 2011-03-28 13:49 UTC (permalink / raw)
  To: u-boot

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

-- 
Best Regards,
zzs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28 13:49       ` zzs
@ 2011-03-28 18:15         ` Wolfgang Denk
  2011-03-29  1:24           ` zzs
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-03-28 18:15 UTC (permalink / raw)
  To: u-boot

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

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-28 18:15         ` Wolfgang Denk
@ 2011-03-29  1:24           ` zzs
  2011-03-29 11:21             ` Wolfgang Denk
  0 siblings, 1 reply; 9+ messages in thread
From: zzs @ 2011-03-29  1:24 UTC (permalink / raw)
  To: u-boot

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

-- 
Best Regards,
zzs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-29  1:24           ` zzs
@ 2011-03-29 11:21             ` Wolfgang Denk
  2011-03-30  1:22               ` zzs
  0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2011-03-29 11:21 UTC (permalink / raw)
  To: u-boot

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

-- 
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] without board level config.mk How to add CPPFLAGS
  2011-03-29 11:21             ` Wolfgang Denk
@ 2011-03-30  1:22               ` zzs
  0 siblings, 0 replies; 9+ messages in thread
From: zzs @ 2011-03-30  1:22 UTC (permalink / raw)
  To: u-boot

>
> 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 !

-- 
Best Regards,
zzs

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-30  1:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-28  8:03 [U-Boot] without board level config.mk How to add CPPFLAGS zzs
2011-03-28  8:53 ` Wolfgang Denk
2011-03-28  9:19   ` zzs
2011-03-28 10:28     ` Wolfgang Denk
2011-03-28 13:49       ` zzs
2011-03-28 18:15         ` Wolfgang Denk
2011-03-29  1:24           ` zzs
2011-03-29 11:21             ` Wolfgang Denk
2011-03-30  1:22               ` zzs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox