Changeset 502


Ignore:
Timestamp:
Aug 29, 2013, 12:18:45 PM (10 years ago)
Author:
bouyer
Message:

Print a version string at execution, dynamically computed at link time.
The version string includes: content of ./version, builder and date,
and svn revision.
This helps to know which version we're really executing ...

Location:
trunk/softs/tsar_boot
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/Makefile

    r425 r502  
    7272all: $(TARGET)
    7373
    74 $(TARGET): $(BUILD_DIR) $(OBJS) $(PLATFORM_DIR)/ldscript $(BUILD_DIR)/platform.ld
     74$(BUILD_DIR)/version.o: $(BUILD_DIR) $(OBJS) version version.sh
     75        $(ECHO) "[version.sh]"
     76        ./version.sh > $(BUILD_DIR)/version.c
     77        $(ECHO) "[   CC    ]     $(BUILD_DIR)/version.c"
     78        $(CC) $(DEFS) $(CFLAGS) $(INCLUDE) -c -o $@ $(BUILD_DIR)/version.c
     79        $(DU) -D $@ > $@.txt
     80
     81$(TARGET): $(BUILD_DIR) $(BUILD_DIR)/version.o $(OBJS) $(PLATFORM_DIR)/ldscript $(BUILD_DIR)/platform.ld
    7582        $(ECHO) "[   LD    ]     $@"
    76         $(LD) -o $@ -T $(PLATFORM_DIR)/ldscript $(OBJS)
     83        $(LD) -o $@ -T $(PLATFORM_DIR)/ldscript $(OBJS) $(BUILD_DIR)/version.o
    7784        $(DU) -D $@ > $@.txt
    7885
  • trunk/softs/tsar_boot/src/reset.S

    r425 r502  
    3939    .extern boot_putd
    4040    .extern boot_ioc_init
     41    .extern versionstr
    4142
    4243    .globl  boot                    /* Make reset an external symbol */
     
    142143    addu    sp,     k1,     k0      /* sp <= seg_stack_base + BOOT_STACK_SIZE */
    143144
     145    la      a0,     versionstr
     146    la      k0,     boot_puts
     147    jalr    k0
     148    nop
     149
    144150#ifndef SOCLIB_IOC
    145151
Note: See TracChangeset for help on using the changeset viewer.