Ignore:
Timestamp:
Aug 29, 2013, 12:18:45 PM (11 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 ...

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.