Use git describe for the version string

This commit is contained in:
Joseph C. Lehner 2016-02-08 15:43:43 +01:00
parent c8c69c10ce
commit aa0f1992e3
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
CC ?= gcc
PREFIX ?= /usr/local
CFLAGS += -Wall -g
CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"$(shell git describe --always)\"
LIBS = -lpcap
.PHONY: clean install release release/osx release/linux
@ -28,8 +28,10 @@ install: nmrp-flash
release/osx:
make release CFLAGS="-arch i686 -arch x86_64"
cp nmrp-flash binaries/osx/
release/linux: release
cp nmrp-flash binaries/linux/
release: clean nmrp-flash
strip nmrp-flash

6
main.c
View file

@ -57,11 +57,11 @@ void usage(FILE *fp)
"C:\\> nmrp-flash.exe -i net0 -a 192.168.1.254 -f firmware.bin\n"
#endif
"\n"
"nmrp-flash v%s, Copyright (C) 2016 Joseph C. Lehner\n"
"nmrp-flash %s, Copyright (C) 2016 Joseph C. Lehner\n"
"nmrp-flash is free software, licensed under the GNU GPLv3.\n"
"Source code at https://github.com/jclehner/nmrp-flash\n"
"\n",
NMRPD_VERSION
NMRPFLASH_VERSION
);
}
@ -131,7 +131,7 @@ int main(int argc, char **argv)
break;
case 'V':
printf("nmrp-flash v%s\n", NMRPD_VERSION);
printf("nmrp-flash %s\n", NMRPFLASH_VERSION);
val = 0;
goto out;
case 'v':

View file

@ -44,8 +44,6 @@
#include <windows.h>
#endif
#define NMRPD_VERSION "0.9"
enum nmrp_op {
NMRP_UPLOAD_FW = 0,
NMRP_UPLOAD_ST = 1,