public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
@ 2003-12-03 13:50 Cam
  2003-12-03 15:32 ` George G. Davis
  2003-12-07 20:05 ` Wolfgang Denk
  0 siblings, 2 replies; 6+ messages in thread
From: Cam @ 2003-12-03 13:50 UTC (permalink / raw)
  To: u-boot

Hello u-boot-users,

Here is a short patch for the examples/Makefile. This improves 
reliability in the case of a deficient toolchain.

For example the MontaVista (pro 3.0) ppc_82xx objcopy does not accept 
srec input, and produces an empty output file which can confuse make.

This patch ensures that the binary image is produced from the elf file 
and not the srec file, which allows a clean build.

-Cam

PS. MontaVista have 'no general interest in supporting srec input' 
because of 'how little information srec files contain'.

-- 
camilo at mesias.co.uk                                                 <--
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: examples-Makefile.diff
Url: http://lists.denx.de/pipermail/u-boot/attachments/20031203/4f349cbe/attachment.txt 

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

* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
  2003-12-03 13:50 [U-Boot-Users] tiny patch for examples/Makefile (objcopy related) Cam
@ 2003-12-03 15:32 ` George G. Davis
  2003-12-07 20:05 ` Wolfgang Denk
  1 sibling, 0 replies; 6+ messages in thread
From: George G. Davis @ 2003-12-03 15:32 UTC (permalink / raw)
  To: u-boot



Cam wrote:
> Hello u-boot-users,
> 
> Here is a short patch for the examples/Makefile. This improves 
> reliability in the case of a deficient toolchain.
> 
> For example the MontaVista (pro 3.0) ppc_82xx objcopy does not accept 
> srec input, and produces an empty output file which can confuse make.

Yep, I had noticed this long ago too. Why not just add "-I srec" as in the
attached?

--
Regards,
George

> 
> This patch ensures that the binary image is produced from the elf file 
> and not the srec file, which allows a clean build.
> 
> -Cam
> 
> PS. MontaVista have 'no general interest in supporting srec input' 
> because of 'how little information srec files contain'.
> 
> 
> ------------------------------------------------------------------------
> 
> diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
> --- u-boot-1.0.0.orig/examples/Makefile	2003-10-14 20:43:56.000000000 +0100
> +++ u-boot-1.0.0/examples/Makefile	2003-12-03 11:21:04.000000000 +0000
> @@ -104,7 +104,7 @@
>  	$(OBJCOPY) -O srec $(<:.o=) $@
>  
>  %.bin:	%.srec
> -	$(OBJCOPY) -O binary $< $@ 2>/dev/null
> +	$(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null
>  
>  #########################################################################
>  
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20031203/390504b3/attachment.txt 

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

* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
  2003-12-03 13:50 [U-Boot-Users] tiny patch for examples/Makefile (objcopy related) Cam
  2003-12-03 15:32 ` George G. Davis
@ 2003-12-07 20:05 ` Wolfgang Denk
  2003-12-10 16:13   ` Detlev Zundel
  1 sibling, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2003-12-07 20:05 UTC (permalink / raw)
  To: u-boot

Dear Cam,

in message <3FCDEA1B.6010306@mesias.co.uk> you wrote:
> 
> Here is a short patch for the examples/Makefile. This improves 
> reliability in the case of a deficient toolchain.

Thanks, added.

> For example the MontaVista (pro 3.0) ppc_82xx objcopy does not accept 
> srec input, and produces an empty output file which can confuse make.
...
> PS. MontaVista have 'no general interest in supporting srec input' 
> because of 'how little information srec files contain'.

Well, but this is a standard feature in the binutils,  and  it  seems
ignorant to me to (intentionally) disable it. Anyway - thanks for the
fix.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
How many Unix hacks does it take to change a light bulb?  Let's  see,
   can you use a shell script for that or does it need a C program?

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

* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
  2003-12-07 20:05 ` Wolfgang Denk
@ 2003-12-10 16:13   ` Detlev Zundel
  2003-12-10 16:37     ` George G. Davis
  0 siblings, 1 reply; 6+ messages in thread
From: Detlev Zundel @ 2003-12-10 16:13 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang & Cam,

> Dear Cam,
>
> in message <3FCDEA1B.6010306@mesias.co.uk> you wrote:
>> 
>> Here is a short patch for the examples/Makefile. This improves 
>> reliability in the case of a deficient toolchain.
>>
>> diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
>> --- u-boot-1.0.0.orig/examples/Makefile	2003-10-14 20:43:56.000000000 +0100
>> +++ u-boot-1.0.0/examples/Makefile	2003-12-03 11:21:04.000000000 +0000
>> @@ -104,7 +104,7 @@
>>  	$(OBJCOPY) -O srec $(<:.o=) $@
>>  
>>  %.bin:	%.srec
>> -	$(OBJCOPY) -O binary $< $@ 2>/dev/null
>> +	$(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null
>>  
>>  #########################################################################

> Thanks, added.

Are you aware, that you effectively have a misleading rule now?  The
rule says how to generate ".bin" from ".srec" files, while in the
command pattern you explicitely use none of the prerequisites but the
hand-derived ELF file.  This might potentially mess up make's rule
algorithm.

As I am on holiday right now, I am too lazy to come up with a cleaner
fix, I just wanted to phrase my concern.

Cheers
  Detlev

-- 
<ESC>:!emacs %

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

* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
  2003-12-10 16:13   ` Detlev Zundel
@ 2003-12-10 16:37     ` George G. Davis
  2003-12-10 21:17       ` Cam
  0 siblings, 1 reply; 6+ messages in thread
From: George G. Davis @ 2003-12-10 16:37 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 10, 2003 at 05:13:55PM +0100, Detlev Zundel wrote:
> Hi Wolfgang & Cam,
> 
> > Dear Cam,
> >
> > in message <3FCDEA1B.6010306@mesias.co.uk> you wrote:
> >> 
> >> Here is a short patch for the examples/Makefile. This improves 
> >> reliability in the case of a deficient toolchain.
> >>
> >> diff -urN u-boot-1.0.0.orig/examples/Makefile u-boot-1.0.0/examples/Makefile
> >> --- u-boot-1.0.0.orig/examples/Makefile	2003-10-14 20:43:56.000000000 +0100
> >> +++ u-boot-1.0.0/examples/Makefile	2003-12-03 11:21:04.000000000 +0000
> >> @@ -104,7 +104,7 @@
> >>  	$(OBJCOPY) -O srec $(<:.o=) $@
> >>  
> >>  %.bin:	%.srec
> >> -	$(OBJCOPY) -O binary $< $@ 2>/dev/null
> >> +	$(OBJCOPY) -O binary $(<:.srec=) $@ 2>/dev/null
> >>  
> >>  #########################################################################
> 
> > Thanks, added.
> 
> Are you aware, that you effectively have a misleading rule now?  The
> rule says how to generate ".bin" from ".srec" files, while in the
> command pattern you explicitely use none of the prerequisites but the
> hand-derived ELF file.  This might potentially mess up make's rule
> algorithm.
> 
> As I am on holiday right now, I am too lazy to come up with a cleaner
> fix, I just wanted to phrase my concern.

This works without the side-effects too:   ; P

Index: examples/Makefile
===================================================================
RCS file: /cvsroot/u-boot/u-boot/examples/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- examples/Makefile	14 Oct 2003 19:43:56 -0000	1.14
+++ examples/Makefile	3 Dec 2003 15:29:11 -0000
@@ -104,7 +104,7 @@
 	$(OBJCOPY) -O srec $(<:.o=) $@
 
 %.bin:	%.srec
-	$(OBJCOPY) -O binary $< $@ 2>/dev/null
+	$(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null
 
 #########################################################################
 
--
Regards,
George

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

* [U-Boot-Users] tiny patch for examples/Makefile (objcopy related)
  2003-12-10 16:37     ` George G. Davis
@ 2003-12-10 21:17       ` Cam
  0 siblings, 0 replies; 6+ messages in thread
From: Cam @ 2003-12-10 21:17 UTC (permalink / raw)
  To: u-boot

George

I have a preference for generating the srec and binary outputs from a 
common input, it seems simpler, and less prone to things going wrong. I 
realise that the current Makefile achieves this in an obscure way (the 
bin is made dependent on the srec, however it really depends on a file 
produced as a side-effect of the srec target).

> This works without the side-effects too:   ; P
[...]
> +	$(OBJCOPY) -I srec -O binary $< $@ 2>/dev/null

I really like that, because it is simple. However it does not work for 
me, as the MontaVista ppc_82xx-objcopy does not support srec input.

If I get some time I will try to do more with the Makefiles, as I would 
like them to work for Rational ClearCase make (clearmake). Mostly they 
do right now with the exception of recursive make invocations. However 
there are greater priorities within the project and I expect I might not 
get the time to tweak the Makefiles beyond getting it working.

Thanks for the feedback, it's a joy to find such an active and 
interested community.

-Cam

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

end of thread, other threads:[~2003-12-10 21:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-03 13:50 [U-Boot-Users] tiny patch for examples/Makefile (objcopy related) Cam
2003-12-03 15:32 ` George G. Davis
2003-12-07 20:05 ` Wolfgang Denk
2003-12-10 16:13   ` Detlev Zundel
2003-12-10 16:37     ` George G. Davis
2003-12-10 21:17       ` Cam

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