public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RedBoot: how to display correct build date/time?
@ 2001-02-26  9:45 Grant Edwards
  2001-02-26  9:57 ` Grant Edwards
  2001-02-26 10:03 ` Gary Thomas
  0 siblings, 2 replies; 4+ messages in thread
From: Grant Edwards @ 2001-02-26  9:45 UTC (permalink / raw)
  To: ecos-discuss

Hi all,

I'm trying to figure out how to get RedBoot to display the
build date/time.  It currently displays the date/time that
main.c was compiled.  If I'm not making changes to main.c, then
the date/time in main.c is not really "current".

For my other eCos apps, I set up my application makefile so 
it does something like:

application: $(OBJS) $(ECOS)/lib/libtarget.a $(ECOS)/lib/libextras.a
	echo "char linkTimeStamp[] = \"`date`\";" >linkTimeStamp.c
	$(XCC) -c linkTimeStamp.c
	$(LD) -Wl,-Map,$@.map $(LDFLAGS) -o $@ $(OBJS) linkTimeStamp.o $(LIBS)

But, since the Makefile for RedBoot is generated auto-magically
by ecosconfig, I'm not sure what would be the best method for
getting a build timestamp into RedBoot...

-- 
Grant Edwards
grante@visi.com

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

* Re: [ECOS] RedBoot: how to display correct build date/time?
  2001-02-26  9:45 [ECOS] RedBoot: how to display correct build date/time? Grant Edwards
@ 2001-02-26  9:57 ` Grant Edwards
  2001-02-26 10:03 ` Gary Thomas
  1 sibling, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2001-02-26  9:57 UTC (permalink / raw)
  To: ecos-discuss

On Mon, Feb 26, 2001 at 11:50:09AM -0600, Grant Edwards wrote:

> I'm trying to figure out how to get RedBoot to display the
> build date/time.  It currently displays the date/time that
> main.c was compiled.  If I'm not making changes to main.c, then
> the date/time in main.c is not really "current".

Uh, wait -- it looks like main.c is supposed to be re-compiled
any time anything in libtarget.a changes:

        make -priority 320 {
            <PREFIX>/bin/redboot.elf : $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o $(PREFIX)/lib/$
                    @sh -c "mkdir -p $(dir $@)"
                    $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ main.o
        }
        make -priority 319 {
           main.o: $(REPOSITORY)/$(PACKAGE)/src/main.c $(PREFIX)/lib/libtarget.a
             $(CC) -c $(INCLUDE_PATH) $(CFLAGS) -o main.o $(REPOSITORY)/$(PACKAGE)/src/main.c

The problem is that when stuff in libextras.a changes, it
doesn't generate a re-compile of main.c (updating the build
date/time).  Adding $(PREFIX)/lib/libextras.a to the prereq's
for main.o makes it work the way I wanted.

-- 
Grant Edwards
grante@visi.com

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

* RE: [ECOS] RedBoot: how to display correct build date/time?
  2001-02-26  9:45 [ECOS] RedBoot: how to display correct build date/time? Grant Edwards
  2001-02-26  9:57 ` Grant Edwards
@ 2001-02-26 10:03 ` Gary Thomas
  2001-02-26 10:09   ` Grant Edwards
  1 sibling, 1 reply; 4+ messages in thread
From: Gary Thomas @ 2001-02-26 10:03 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

On 26-Feb-2001 Grant Edwards wrote:
> 
> Hi all,
> 
> I'm trying to figure out how to get RedBoot to display the
> build date/time.  It currently displays the date/time that
> main.c was compiled.  If I'm not making changes to main.c, then
> the date/time in main.c is not really "current".
> 
> For my other eCos apps, I set up my application makefile so 
> it does something like:
> 
> application: $(OBJS) $(ECOS)/lib/libtarget.a $(ECOS)/lib/libextras.a
>       echo "char linkTimeStamp[] = \"`date`\";" >linkTimeStamp.c
>       $(XCC) -c linkTimeStamp.c
>       $(LD) -Wl,-Map,$@.map $(LDFLAGS) -o $@ $(OBJS) linkTimeStamp.o $(LIBS)
> 
> But, since the Makefile for RedBoot is generated auto-magically
> by ecosconfig, I'm not sure what would be the best method for
> getting a build timestamp into RedBoot...

Actually, the date/time string comes from 'version.c'.  A small change
to the CDL will make this work better, rebuilding 'version.o' whenever
the RedBoot application gets relinked:

Index: redboot/current/cdl/redboot.cdl
===================================================================
RCS file: /home/cvs/ecc/ecc/redboot/current/cdl/redboot.cdl,v
retrieving revision 1.35
diff -u -5 -p -r1.35 redboot.cdl
--- redboot/current/cdl/redboot.cdl     2001/02/22 15:05:16     1.35
+++ redboot/current/cdl/redboot.cdl     2001/02/26 18:01:33
@@ -77,18 +77,15 @@ cdl_package CYGPKG_REDBOOT {
         compile main.c crc.c
        compile printf.c misc_funs.c io.c parse.c ticks.c xyzModem.c syscall.c
         compile -library=libextras.a load.c 
 
         make -priority 320 {
-            <PREFIX>/bin/redboot.elf : $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o
$(PREFIX)/lib/libtarget.a $(PREFIX)/lib/libextras.a version.o
+            <PREFIX>/bin/redboot.elf : $(PREFIX)/lib/target.ld $(PREFIX)/lib/vectors.o
$(PREFIX)/lib/libtarget.a $(PREFIX)/lib/libextras.a
                     @sh -c "mkdir -p $(dir $@)"
+                    $(CC) -c $(INCLUDE_PATH) $(CFLAGS) -o version.o
$(REPOSITORY)/$(PACKAGE)/src/version.c
                    $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -o $@ version.o
         }
-       make -priority 319 {
-           version.o: $(REPOSITORY)/$(PACKAGE)/src/version.c $(PREFIX)/lib/libtarget.a
-             $(CC) -c $(INCLUDE_PATH) $(CFLAGS) -o version.o $(REPOSITORY)/$(PACKAGE)/src/version.c
-       }
     }
 
     cdl_component CYGPKG_REDBOOT_NETWORKING {
         display       "Build Redboot ROM binary image"
         flavor        bool

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

* Re: [ECOS] RedBoot: how to display correct build date/time?
  2001-02-26 10:03 ` Gary Thomas
@ 2001-02-26 10:09   ` Grant Edwards
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2001-02-26 10:09 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

On Mon, Feb 26, 2001 at 11:02:50AM -0700, Gary Thomas wrote:

> Actually, the date/time string comes from 'version.c'.  A small
> change to the CDL will make this work better, rebuilding
> 'version.o' whenever the RedBoot application gets relinked:

My copy of RedBoot must be out of date.  I don't have a
version.c and the date/time I see is printed by do_version() in
main.c.  One of these days I'll have to try upgrading, but I'm
afraid of breaking the custom features I've added.  :(.

-- 
Grant Edwards
grante@visi.com

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

end of thread, other threads:[~2001-02-26 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-26  9:45 [ECOS] RedBoot: how to display correct build date/time? Grant Edwards
2001-02-26  9:57 ` Grant Edwards
2001-02-26 10:03 ` Gary Thomas
2001-02-26 10:09   ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).