diff --git a/.gitignore b/.gitignore index 7a501a9..db3f89c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ abootimg - +version.h diff --git a/Makefile b/Makefile index 2b11450..627d5b2 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,11 @@ all: abootimg 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 clean: - rm -f abootimg abootimg-static + rm -f abootimg version.h archive: clean cd ..; tar cvzf abootimg.tar.gz abootimg --exclude tests --exclude tmp\* --exclude .git diff --git a/abootimg.c b/abootimg.c index d71e12c..31598da 100644 --- a/abootimg.c +++ b/abootimg.c @@ -31,6 +31,7 @@ #include #endif +#include "version.h" #include "bootimg.h" @@ -91,6 +92,8 @@ void print_usage(void) { printf ( " abootimg - manipulate Android Boot Images.\n" + " (c) 2011 Gilles Grandou \n" + " " VERSION_STR "\n" "\n" " abootimg [-h]\n" "\n"