diff --git a/ROM2/.gitignore b/ROM2/.gitignore index 6e3d5b15275b481d6d0d846ec8b34fe009428358..74113bcbb5697f7232a0f809e590ab3b6653a157 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 e9f6e0c7f1e7ff5ec94578b3822fca40c3726d77..11242d5f1e4860d5039905b785e6129c35a2dd0f 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 0000000000000000000000000000000000000000..0ba0d5f44b8336ab1f9b70a92e5ef42c538a9994 --- /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 <<EOT; +#ifndef _VERSION_H_ +#define _VERSION_H_ + +/* ROM version */ + +#define DATEBUILT_STRING "$datestring" +#define VERSION_STRING "$revision" + +#endif /* _VERSION_H_ */ +EOT diff --git a/ROM2/version.h b/ROM2/version.h deleted file mode 100644 index 28810e9398051fc5d86326f26330f7a4604067d5..0000000000000000000000000000000000000000 --- a/ROM2/version.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _VERSION_H_ -#define _VERSION_H_ - -#include "vend.h" - -/* Snack machine ROM version */ - -#define VERSION_STRING "Y 20150319" - -#endif /* _VERSION_H_ */ diff --git a/TODO b/TODO index 56746d9d588aadd7f227329083afd37b36a59d02..02f47f032a34c4851b75fb605f7a631408863cc2 100644 --- a/TODO +++ b/TODO @@ -26,6 +26,8 @@ Modify main_basic.c as appropriate Partially done. git tag -a ROMY +git push --tags + git describe --long