From: Mark Tearle Date: Fri, 20 Mar 2015 13:11:24 +0000 (+0800) Subject: Automatically generate version.h X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=e307c022274b808bfba942fed0ca5708c2c855fa;p=uccvend-snackrom.git Automatically generate version.h --- diff --git a/ROM2/.gitignore b/ROM2/.gitignore index 6e3d5b1..74113bc 100644 --- a/ROM2/.gitignore +++ b/ROM2/.gitignore @@ -3,6 +3,7 @@ rom2.s19 rom2.elf rom2.b romsrc.s +version.h crctab.h crctest gencrctab diff --git a/ROM2/Makefile b/ROM2/Makefile index e9f6e0c..11242d5 100644 --- a/ROM2/Makefile +++ b/ROM2/Makefile @@ -43,7 +43,7 @@ rom2.elf: $(OBJS) memory.x check-romsrc.pl @perl -w check-romsrc.pl clean: - rm -f *.o *.elf *.s19 *.b *.a rom.tar.bz2 romsrc.s crctab.h m68hc11-gdb gencrctab crctest + rm -f *.o *.elf *.s19 *.b *.a rom.tar.bz2 romsrc.s crctab.h version.h m68hc11-gdb gencrctab crctest crctest: crctest.c crctab.h gcc -o $@ $< @@ -64,6 +64,11 @@ rom.tar.bz2: romsrc.s: rom.tar.bz2 src2asm.pl perl -w src2asm.pl < $< > $@ +main_basic.c: version.h + +version.h: gen-version.pl + ./gen-version.pl > $@ + xmodem.c: crctab.h crctab.h: gencrctab diff --git a/ROM2/gen-version.pl b/ROM2/gen-version.pl new file mode 100755 index 0000000..0ba0d5f --- /dev/null +++ b/ROM2/gen-version.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl -w + +use POSIX qw(strftime); + +$revision = `git describe --long`; +$datestring = strftime "%Y%m%d", localtime; + +chomp $revision; + + +print <