aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2009-07-29 20:41:39 -0400
committerKevin O'Connor <kevin@koconnor.net>2009-07-29 20:41:39 -0400
commitc95d2cee36db79c88253d43a90230ceadf0c26cf (patch)
tree22ba1fd5527278ca9dc5f69370f9c9907c26aeca /Makefile
parent8c8a880b584ccf8958d67e99a6750ba32d0b6454 (diff)
downloadseabios-c95d2cee36db79c88253d43a90230ceadf0c26cf.tar.gz
Add auto-generated version info to each build.
Add versioning info to initial debug and screen banner output.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 7 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2e2ba1db..37589097 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,9 @@
#
# This file may be distributed under the terms of the GNU LGPLv3 license.
+# Program version
+VERSION=pre-0.4.2-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname)
+
# Output directory
OUT=out/
@@ -134,11 +137,13 @@ $(OUT)rom32.o: $(OUT)code32.o $(OUT)rombios32.lds
$(Q)$(LD) -r -T $(OUT)rombios32.lds $< -o $@
$(OUT)rom.o: $(OUT)rom16.o $(OUT)rom32.o $(OUT)rombios16.lds $(OUT)rombios.lds
- @echo " Linking $@"
+ @echo " Linking $@ (version \"$(VERSION)\")"
+ $(Q)echo 'const char VERSION[] __attribute__((section(".data32.version"))) = "$(VERSION)";' > $(OUT)version.c
+ $(Q)$(CC) $(CFLAGS) -c $(OUT)version.c -o $(OUT)version.o
$(Q)$(LD) -T $(OUT)rombios16.lds $(OUT)rom16.o -R $(OUT)rom32.o -o $(OUT)rom16.reloc.o
$(Q)$(STRIP) $(OUT)rom16.reloc.o -o $(OUT)rom16.final.o
$(Q)$(OBJCOPY) --adjust-vma 0xf0000 $(OUT)rom16.o $(OUT)rom16.moved.o
- $(Q)$(LD) -T $(OUT)rombios.lds $(OUT)rom16.final.o $(OUT)rom32.o -R $(OUT)rom16.moved.o -o $@
+ $(Q)$(LD) -T $(OUT)rombios.lds $(OUT)rom16.final.o $(OUT)rom32.o $(OUT)version.o -R $(OUT)rom16.moved.o -o $@
$(OUT)bios.bin.elf: $(OUT)rom.o
@echo " Prepping $@"