added version number

* generate version.h from git-describe
* print version number and (c) in help message
This commit is contained in:
Gilles Grandou 2011-05-03 23:40:07 +02:00
parent 891020dec7
commit f23308b89a
3 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
abootimg abootimg
version.h

View File

@ -2,10 +2,11 @@
all: abootimg all: abootimg
abootimg: abootimg.c bootimg.h abootimg: abootimg.c bootimg.h
echo '#define VERSION_STR "$(shell git describe --tags --abbrev=0)"' > version.h
gcc -g -O2 -Wno-unused-result -o abootimg abootimg.c -DHAS_BLKID -lblkid gcc -g -O2 -Wno-unused-result -o abootimg abootimg.c -DHAS_BLKID -lblkid
clean: clean:
rm -f abootimg abootimg-static rm -f abootimg version.h
archive: clean archive: clean
cd ..; tar cvzf abootimg.tar.gz abootimg --exclude tests --exclude tmp\* --exclude .git cd ..; tar cvzf abootimg.tar.gz abootimg --exclude tests --exclude tmp\* --exclude .git

View File

@ -31,6 +31,7 @@
#include <blkid/blkid.h> #include <blkid/blkid.h>
#endif #endif
#include "version.h"
#include "bootimg.h" #include "bootimg.h"
@ -91,6 +92,8 @@ void print_usage(void)
{ {
printf ( printf (
" abootimg - manipulate Android Boot Images.\n" " abootimg - manipulate Android Boot Images.\n"
" (c) 2011 Gilles Grandou <gilles@grandou.net>\n"
" " VERSION_STR "\n"
"\n" "\n"
" abootimg [-h]\n" " abootimg [-h]\n"
"\n" "\n"