All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] make clean problem
@ 2008-10-08 13:52 Eugene O'Brien
  2008-10-08 15:26 ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Eugene O'Brien @ 2008-10-08 13:52 UTC (permalink / raw)
  To: u-boot

Hello,

I just stumbled on a problem with the make clean command in U-Boot. When
executing make clean I noticed that some programmes that should have
been deleted were not deleted. These were the programmes to be deleted
with instructions such as:

@rm -f $(obj)tools/env/{fw_printenv,fw_setenv}

The reason is (after scratching my head for a few hours) that on my
platform BASH is not the default shell. I am using Ubuntu and /bin/sh is
linked to dash (see https://wiki.ubuntu.com/DashAsBinSh for details). As
I am not an expert on shells, my guess is that the above construct is a
"bashism" and not compliant to /bin/sh.

There are two trivial solutions to this problem:

(a) Add a line SHELL=/bin/bash somewhere in top level Makefile
(b) Write out each individual file's path name separately in the @rm
command line.

What is best course of action? Choosing (a) means that we are specifying
BASH as a requirement for the U-Boot HOST environment. If this is
already the case then solution (a) is perhaps the best and limits U-Boot
regression testing to one shell type. Otherwise if we want to be
compatible with /bin/sh then I believe solution (b) is preferable.

Regards,
Eugene O'Brien

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

* [U-Boot] make clean problem
  2008-10-08 13:52 [U-Boot] make clean problem Eugene O'Brien
@ 2008-10-08 15:26 ` Wolfgang Denk
  2008-10-08 18:08   ` Jerry Van Baren
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-10-08 15:26 UTC (permalink / raw)
  To: u-boot

Dear "Eugene O'Brien",

In message <8B3930FEA8618C44B48EB06B5D33A06E01CCE207@satmail.Advantech.ca> you wrote:
> 
> @rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
> 
> The reason is (after scratching my head for a few hours) that on my
> platform BASH is not the default shell. I am using Ubuntu and /bin/sh is
> linked to dash (see https://wiki.ubuntu.com/DashAsBinSh for details). As
> I am not an expert on shells, my guess is that the above construct is a
> "bashism" and not compliant to /bin/sh.

Good catch...

> There are two trivial solutions to this problem:
> 
> (a) Add a line SHELL=/bin/bash somewhere in top level Makefile
> (b) Write out each individual file's path name separately in the @rm
> command line.

I think the above way to abbreviate long lists  of  file  names  that
have a long common partis pretty useful to keep the code readable, so
I tend to prefer solution (a).

But let's see what other people say...

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
"The first rule of magic is simple. Don't waste your time waving your
hands and hoping when a rock or a club will do."
                                               - McCloctnik the Lucid

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

* [U-Boot] make clean problem
  2008-10-08 15:26 ` Wolfgang Denk
@ 2008-10-08 18:08   ` Jerry Van Baren
  2008-10-08 19:13     ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Jerry Van Baren @ 2008-10-08 18:08 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear "Eugene O'Brien",
> 
> In message <8B3930FEA8618C44B48EB06B5D33A06E01CCE207@satmail.Advantech.ca> you wrote:
>> @rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
>>
>> The reason is (after scratching my head for a few hours) that on my
>> platform BASH is not the default shell. I am using Ubuntu and /bin/sh is
>> linked to dash (see https://wiki.ubuntu.com/DashAsBinSh for details). As
>> I am not an expert on shells, my guess is that the above construct is a
>> "bashism" and not compliant to /bin/sh.
> 
> Good catch...
> 
>> There are two trivial solutions to this problem:
>>
>> (a) Add a line SHELL=/bin/bash somewhere in top level Makefile
>> (b) Write out each individual file's path name separately in the @rm
>> command line.
> 
> I think the above way to abbreviate long lists  of  file  names  that
> have a long common partis pretty useful to keep the code readable, so
> I tend to prefer solution (a).
> 
> But let's see what other people say...

I *LIKE* bash, so I too like (a).

Having said that, and with the disclaimer that I'm not sure it is an 
improvement, I believe the following line is a "make-ism" equivalent to 
the bash-ism (untested):

@rm -f $(foreach file, fw_printenv fw_setenv, $(obj)tools/env/$(file))

> Best regards,
> 
> Wolfgang Denk

Ditto,
gvb

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

* [U-Boot] make clean problem
  2008-10-08 18:08   ` Jerry Van Baren
@ 2008-10-08 19:13     ` Wolfgang Denk
       [not found]       ` <d66caabb0810081414y21152e4cw67a268d385dde4b7@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2008-10-08 19:13 UTC (permalink / raw)
  To: u-boot

Dear Jerry Van Baren,

In message <48ECF72E.20704@ge.com> you wrote:
>
> >> @rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
...
> Having said that, and with the disclaimer that I'm not sure it is an 
> improvement, I believe the following line is a "make-ism" equivalent to 
> the bash-ism (untested):
> 
> @rm -f $(foreach file, fw_printenv fw_setenv, $(obj)tools/env/$(file))

Well, I certainly think it ain't no improvment at all. Thebash code
may be cryptic, but in a way that is readable to a prgrammer.

The make notation makes me believe I had too much beer (and I haven't
even started yet).

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
The C-shell doesn't parse. It adhoculates.
    - Casper.Dik at Holland.Sun.COM in <3ol96k$b2j@engnews2.Eng.Sun.COM>

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

* [U-Boot] make clean problem
       [not found]       ` <d66caabb0810081414y21152e4cw67a268d385dde4b7@mail.gmail.com>
@ 2008-10-08 21:16         ` Graeme Russ
  2008-10-08 22:09           ` Wolfgang Denk
  0 siblings, 1 reply; 6+ messages in thread
From: Graeme Russ @ 2008-10-08 21:16 UTC (permalink / raw)
  To: u-boot

What about if bash hasn't been installed for whatever reason?

On Thu, Oct 9, 2008 at 8:14 AM, Graeme Russ <graeme.russ@gmail.com> wrote:
> What about if bash hasn't been installed for whatever reason?
>
> On Thu, Oct 9, 2008 at 6:13 AM, Wolfgang Denk <wd@denx.de> wrote:
>> Dear Jerry Van Baren,
>>
>> In message <48ECF72E.20704@ge.com> you wrote:
>>>
>>> >> @rm -f $(obj)tools/env/{fw_printenv,fw_setenv}
>> ...
>>> Having said that, and with the disclaimer that I'm not sure it is an
>>> improvement, I believe the following line is a "make-ism" equivalent to
>>> the bash-ism (untested):
>>>
>>> @rm -f $(foreach file, fw_printenv fw_setenv, $(obj)tools/env/$(file))
>>
>> Well, I certainly think it ain't no improvment at all. Thebash code
>> may be cryptic, but in a way that is readable to a prgrammer.
>>
>> The make notation makes me believe I had too much beer (and I haven't
>> even started yet).
>>
>> 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
>> The C-shell doesn't parse. It adhoculates.
>>    - Casper.Dik at Holland.Sun.COM in <3ol96k$b2j@engnews2.Eng.Sun.COM>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>

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

* [U-Boot] make clean problem
  2008-10-08 21:16         ` Graeme Russ
@ 2008-10-08 22:09           ` Wolfgang Denk
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2008-10-08 22:09 UTC (permalink / raw)
  To: u-boot

Dear "Graeme Russ",

In message <d66caabb0810081416u4725db4fne091a8de25d7de2c@mail.gmail.com> you wrote:
> What about if bash hasn't been installed for whatever reason?

Then you have the same like when any other of the required tools
(make, gcc, ...) is not installed: you have to install it.

Seriously: I doubt that you will find any normal Linux distribution
which does not install bash by default.

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
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1

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

end of thread, other threads:[~2008-10-08 22:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08 13:52 [U-Boot] make clean problem Eugene O'Brien
2008-10-08 15:26 ` Wolfgang Denk
2008-10-08 18:08   ` Jerry Van Baren
2008-10-08 19:13     ` Wolfgang Denk
     [not found]       ` <d66caabb0810081414y21152e4cw67a268d385dde4b7@mail.gmail.com>
2008-10-08 21:16         ` Graeme Russ
2008-10-08 22:09           ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.