This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: RedBoot: how to display correct build date/time?
- To: Grant Edwards <grante at visi dot com>
- Subject: RE: [ECOS] RedBoot: how to display correct build date/time?
- From: Gary Thomas <gthomas at cambridge dot redhat dot com>
- Date: Mon, 26 Feb 2001 11:02:50 -0700 (MST)
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat, Inc.
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