automatically generate version.h from ChangeLog's Revision tag

used for printing the JTAG Tools build number upon startup


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@811 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Arnim Läuger 17 years ago
parent 4b93f558b6
commit c6685ac0a3

@ -1,4 +1,7 @@
=== ChangeLog for UrJTAG $Revision$ ===
2007-12-05 Arnim Laeuger <arniml@users.sourceforge.net>
* src/jtag.c (main): Print build number based on version.h.
* src/Makefile.am (version.h): Added rules to generate version.h from ChangeLog's Revision tag.
2004-11-24 Marcel Telka <marcel@telka.sk>
@ -1743,3 +1746,5 @@
Version 0.1 released.
$Revision$

@ -68,5 +68,11 @@ jtag_LDADD = \
-lm \
@LIBINTL@
nodist_jtag_SOURCES = version.h
BUILT_SOURCES = version.h
CLEANFILES = version.h
version.h: ../ChangeLog version.awk
$(AWK) -f version.awk $< > $@
localedir = $(datadir)/locale
INCLUDES = -DLOCALEDIR=\"$(localedir)\"

@ -24,6 +24,7 @@
*/
#include "sysdep.h"
#include "version.h"
#include <stdio.h>
#include <stdlib.h>
@ -445,11 +446,12 @@ main( int argc, const char **argv )
/* interactive */
printf(
_("%s\n"
_("%s Build %s\n"
"Copyright (C) 2002, 2003 ETC s.r.o.\n"
"%s is free software, covered by the GNU General Public License, and you are\n"
"welcome to change it and/or distribute copies of it under certain conditions.\n"
"There is absolutely no warranty for %s.\n\n"), PACKAGE_STRING, PACKAGE_NAME, PACKAGE_NAME
"There is absolutely no warranty for %s.\n\n"), PACKAGE_STRING, URJTAG_BUILD_NUMBER,
PACKAGE_NAME, PACKAGE_NAME
);
chain = chain_alloc();

@ -0,0 +1,26 @@
BEGIN {
print "/*"
print " * version.h"
print " * control long build version number"
print " *"
print " * Created automatically with version.awk script"
print " *"
print " */"
print ""
print "#ifndef __VERSION_H__"
print "#define __VERSION_H__"
print ""
FS="[ \t.]"
}
/Revision/ { printf "#define URJTAG_BUILD_NUMBER\t\"%s\"\n", $2 }
END {
print ""
print "#ifndef URJTAG_BUILD_NUMBER"
print "#define URJTAG_BUILD_NUMBER \"0\""
print "#endif"
print ""
print "#endif"
}
Loading…
Cancel
Save