From aa0f1992e3284055403b5ca315cb4fd2c1ec20c9 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Mon, 8 Feb 2016 15:43:43 +0100 Subject: [PATCH] Use git describe for the version string --- Makefile | 4 +++- main.c | 6 +++--- nmrpd.h | 2 -- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0a644e2..e6f64bb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/main.c b/main.c index b8963e9..2b87385 100644 --- a/main.c +++ b/main.c @@ -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': diff --git a/nmrpd.h b/nmrpd.h index 0f9e6ac..bcbe522 100644 --- a/nmrpd.h +++ b/nmrpd.h @@ -44,8 +44,6 @@ #include #endif -#define NMRPD_VERSION "0.9" - enum nmrp_op { NMRP_UPLOAD_FW = 0, NMRP_UPLOAD_ST = 1, -- 2.25.1