public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Makefile problems
@ 2005-05-13 23:48 Detlef Vollmann
  2005-05-16 12:33 ` Simon Poole
  0 siblings, 1 reply; 7+ messages in thread
From: Detlef Vollmann @ 2005-05-13 23:48 UTC (permalink / raw)
  To: u-boot

Hello,

as the command constants in cmd_confdefs.h are long longs,
the programs in tools that include a board configuration file
dont't compile with GCC 2.x.  But on a number of workstations
the 'gcc' command is still 2.95.x, while the 3.x version
is named gcc3, gcc-3 or similar.
One way to solve this is to add a line to tools/Makefile like
HOSTCC=gcc-3
But now I need a different makefile on different machines.
To avoid this, I tried things like
 $ HOSTCC=gcc-3 make
or even
 $ HOSTCC=gcc-3 make -e
but none of these worked.
The most elegant version would be to give the HOSTCC at
configuration time, i.e.
 $ HOSTCC=gcc-3 make xyz_config
But I have no idea whether this is possible and if so how
to implement it.

Any ideas?

 Detlef

-- 
Detlef Vollmann   vollmann engineering gmbh
Linux and C++ for Embedded Systems    http://www.vollmann.ch/

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

* [U-Boot-Users] Makefile problems
  2005-05-13 23:48 [U-Boot-Users] Makefile problems Detlef Vollmann
@ 2005-05-16 12:33 ` Simon Poole
  2005-05-16 18:09   ` Detlef Vollmann
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Poole @ 2005-05-16 12:33 UTC (permalink / raw)
  To: u-boot

Detlef Vollmann wrote:
> Hello,
> 
> as the command constants in cmd_confdefs.h are long longs,
> the programs in tools that include a board configuration file
> dont't compile with GCC 2.x.  But on a number of workstations
> the 'gcc' command is still 2.95.x, while the 3.x version
> is named gcc3, gcc-3 or similar.
> One way to solve this is to add a line to tools/Makefile like
> HOSTCC=gcc-3
> But now I need a different makefile on different machines.
> To avoid this, I tried things like
>  $ HOSTCC=gcc-3 make
> or even
>  $ HOSTCC=gcc-3 make -e
> but none of these worked.
> The most elegant version would be to give the HOSTCC at
> configuration time, i.e.
>  $ HOSTCC=gcc-3 make xyz_config
> But I have no idea whether this is possible and if so how
> to implement it.
> 
> Any ideas?
> 
>  Detlef
> 

I'm not sure why "HOSTCC=gcc-3 make -e" isn't working.  This should 
override the declaration in config.mk.

However, you can always try the alternative (better) syntax:
make HOSTCC=gcc-3

make -e should be avoided because it causes *all* of your environment 
variables to override declarations in the Makefile.  Using the format 
above you can explicity override individual variables.

--
Simon Poole
www.appliancestudio.com

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

* [U-Boot-Users] Makefile problems
  2005-05-16 12:33 ` Simon Poole
@ 2005-05-16 18:09   ` Detlef Vollmann
  2005-05-16 23:04     ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Detlef Vollmann @ 2005-05-16 18:09 UTC (permalink / raw)
  To: u-boot

Simon Poole wrote:
> 
> I'm not sure why "HOSTCC=gcc-3 make -e" isn't working.  This should
> override the declaration in config.mk.
> 
> However, you can always try the alternative (better) syntax:
> make HOSTCC=gcc-3
The problem with this is, that I have to remeber that every time
I issue the command (and my customers as well).
If the first version would work, I could put the variable
in the shell startup file.

> make -e should be avoided because it causes *all* of your environment
> variables to override declarations in the Makefile.
I believe that is what I want.
The problem with it is that it works recursively: the definitions
in the main makefile overide the ones from the sub-makefile.
And that causes the sources in the tools directory to be
compiled with the CC from the main makefile, which is the
cross compiler :-(

> Using the format
> above you can explicity override individual variables.
On each single invocation.  And that is what I want to avoid.

 Detlef

-- 
Detlef Vollmann   vollmann engineering gmbh
Linux and C++ for Embedded Systems    http://www.vollmann.ch/

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

* [U-Boot-Users] Makefile problems
  2005-05-16 18:09   ` Detlef Vollmann
@ 2005-05-16 23:04     ` Wolfgang Denk
  2005-05-17  5:12       ` Detlef Vollmann
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2005-05-16 23:04 UTC (permalink / raw)
  To: u-boot

In message <4288E1F0.52B7590@vollmann.ch> you wrote:
>
> > make HOSTCC=gcc-3
> The problem with this is, that I have to remeber that every time
> I issue the command (and my customers as well).

You better know exactly what you are doing, so having to remember the
correct command is a Good Thing (TM).

> If the first version would work, I could put the variable
> in the shell startup file.

... and run into trouble with other builds failing  in  "interesting"
ways later. No, thanks.

> > make -e should be avoided because it causes *all* of your environment
> > variables to override declarations in the Makefile.
> I believe that is what I want.

You think you want it, but you don't. Really. You DO NOT.

> > Using the format
> > above you can explicity override individual variables.
> On each single invocation.  And that is what I want to avoid.

But each single invocation produces results. Maybe different  results
if you want. Or if you think you want ;-)

"UNIX was not designed to stop you from doing stupid things,  because
that would also stop you from doing clever things."       - Doug Gwyn


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A verbal contract isn't worth the paper it's written on.
                                                    -- Samuel Goldwyn

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

* [U-Boot-Users] Makefile problems
  2005-05-16 23:04     ` Wolfgang Denk
@ 2005-05-17  5:12       ` Detlef Vollmann
  2005-05-17  7:17         ` Wolfgang Denk
  0 siblings, 1 reply; 7+ messages in thread
From: Detlef Vollmann @ 2005-05-17  5:12 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> In message <4288E1F0.52B7590@vollmann.ch> you wrote:
> > > make HOSTCC=gcc-3
> > The problem with this is, that I have to remeber that every time
> > I issue the command (and my customers as well).
> 
> You better know exactly what you are doing, so having to remember the
> correct command is a Good Thing (TM).
Hmm, so if my host's C compiler happens to be named gcc, I don't
have to remember, but if it happens to be named differently
(ncc, como, gcc-3, acc, ...) I need to remember?
Strange policy...

> > If the first version would work, I could put the variable
> > in the shell startup file.
> 
> ... and run into trouble with other builds failing  in  "interesting"
> ways later. No, thanks.
Well, that's the way all the packages using 'configure' work.
They pick up whatever is defined in your environment at
configure time.

And as I wrote, my most preferred solution would be something
like 'HOSTCC=gcc-3 make xyz_config'.  To achieve this, a simple
line like '[ $HOSTCC ] && echo "HOSTCC = $HOSTCC" >> config.mk'
in mkconfig would probably suffice.  But maybe there's another
(better) way.

 Detlef

-- 
Detlef Vollmann   vollmann engineering gmbh
Linux and C++ for Embedded Systems    http://www.vollmann.ch/

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

* [U-Boot-Users] Makefile problems
  2005-05-17  5:12       ` Detlef Vollmann
@ 2005-05-17  7:17         ` Wolfgang Denk
  2005-05-17 14:56           ` Simon Poole
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2005-05-17  7:17 UTC (permalink / raw)
  To: u-boot

In message <42897D34.1D5EDE7@vollmann.ch> you wrote:
>
> > You better know exactly what you are doing, so having to remember the
> > correct command is a Good Thing (TM).
> Hmm, so if my host's C compiler happens to be named gcc, I don't
> have to remember, but if it happens to be named differently
> (ncc, como, gcc-3, acc, ...) I need to remember?
> Strange policy...

What is strange about this? You will have to do the same whith  about
any Makefile I know.

> Well, that's the way all the packages using 'configure' work.
> They pick up whatever is defined in your environment at
> configure time.

We don't use configure, though.

> And as I wrote, my most preferred solution would be something
> like 'HOSTCC=gcc-3 make xyz_config'.  To achieve this, a simple
> line like '[ $HOSTCC ] && echo "HOSTCC = $HOSTCC" >> config.mk'
> in mkconfig would probably suffice.  But maybe there's another
> (better) way.

What makes it difficult for you to use

	make HOSTCC=gcc-3 xyz_config
instead of 
	HOSTCC=gcc-3 make xyz_config
??

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Dealing with failure is easy: work hard to improve. Success  is  also
easy  to  handle:  you've  solved  the  wrong  problem.  Work hard to
improve.

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

* [U-Boot-Users] Makefile problems
  2005-05-17  7:17         ` Wolfgang Denk
@ 2005-05-17 14:56           ` Simon Poole
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Poole @ 2005-05-17 14:56 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
>>And as I wrote, my most preferred solution would be something
>>like 'HOSTCC=gcc-3 make xyz_config'.  To achieve this, a simple
>>line like '[ $HOSTCC ] && echo "HOSTCC = $HOSTCC" >> config.mk'
>>in mkconfig would probably suffice.  But maybe there's another
>>(better) way.
> 
> 
> What makes it difficult for you to use
> 
> 	make HOSTCC=gcc-3 xyz_config
> instead of 
> 	HOSTCC=gcc-3 make xyz_config
> ??
> 
> Best regards,
> 
> Wolfgang Denk
> 
or

MAKEARGS=
[ -n "$HOSTCC" ] && MAKEARGS="HOSTCC=$HOSTCC"
make $MAKEARGS xyz_config

--
Simon Poole
www.appliancestudio.com

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

end of thread, other threads:[~2005-05-17 14:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-13 23:48 [U-Boot-Users] Makefile problems Detlef Vollmann
2005-05-16 12:33 ` Simon Poole
2005-05-16 18:09   ` Detlef Vollmann
2005-05-16 23:04     ` Wolfgang Denk
2005-05-17  5:12       ` Detlef Vollmann
2005-05-17  7:17         ` Wolfgang Denk
2005-05-17 14:56           ` Simon Poole

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