From 5a6586937b201b4b8daeb5299a7279873767801f Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Thu, 23 May 2013 23:25:59 +0200 Subject: make: include build name Include long version string into tools when called with --version. Signed-off-by: Daniel Borkmann --- Makefile | 5 +++-- astraceroute.c | 2 +- bpfc.c | 2 +- curvetun.c | 2 +- flowtop.c | 2 +- ifpps.c | 2 +- netsniff-ng.c | 2 +- staging/mausezahn.c | 2 +- trafgen.c | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 9fa4436..c35cd07 100644 --- a/Makefile +++ b/Makefile @@ -95,6 +95,7 @@ endif ALL_CFLAGS = $(CFLAGS) -I. ALL_CFLAGS += -DVERSION_STRING=\"$(VERSION_STRING)\" +ALL_CFLAGS += -DVERSION_LONG=\"$(VERSION_LONG)\" ALL_CFLAGS += -DPREFIX_STRING=\"$(PREFIX)\" ifneq ($(wildcard /usr/include/linux/net_tstamp.h),) ALL_CFLAGS += -D__WITH_HARDWARE_TIMESTAMPING @@ -141,7 +142,7 @@ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION export CROSS_COMPILE VERSION_STRING = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) -VERSION_SHORT = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) +VERSION_LONG = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)~$(NAME) bold = $(shell tput bold) normal = $(shell tput sgr0) @@ -229,7 +230,7 @@ bpfc: ALL_CFLAGS += -I.. curvetun: ALL_CFLAGS += -I ${NACL_INC_DIR} curvetun: ALL_LDFLAGS += -L ${NACL_LIB_DIR} # This gets some extra treatment here until the code looks properly -mausezahn: ALL_CFLAGS = -O2 -I. -I.. -DVERSION_STRING=\"$(VERSION_STRING)\" -DPREFIX_STRING=\"$(PREFIX)\" +mausezahn: ALL_CFLAGS = -O2 -I. -I.. -DVERSION_STRING=\"$(VERSION_STRING)\" -DPREFIX_STRING=\"$(PREFIX)\" -DVERSION_LONG=\"$(VERSION_LONG)\" bpfc_clean_custom: $(Q)$(call RM,$(BUILD_DIR)/*.h $(BUILD_DIR)/*.c) diff --git a/astraceroute.c b/astraceroute.c index a3d5d57..4b1aada 100644 --- a/astraceroute.c +++ b/astraceroute.c @@ -231,7 +231,7 @@ static void __noreturn help(void) static void __noreturn version(void) { - printf("\nastraceroute %s, autonomous system trace route utility\n", VERSION_STRING); + printf("\nastraceroute %s, autonomous system trace route utility\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2011-2013 Daniel Borkmann \n" diff --git a/bpfc.c b/bpfc.c index d1b54f1..f326025 100644 --- a/bpfc.c +++ b/bpfc.c @@ -65,7 +65,7 @@ static void __noreturn help(void) static void __noreturn version(void) { - printf("\nbpfc %s, a tiny BPF compiler\n", VERSION_STRING); + printf("\nbpfc %s, a tiny BPF compiler\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2011-2013 Daniel Borkmann ,\n" diff --git a/curvetun.c b/curvetun.c index e888933..29bee4a 100644 --- a/curvetun.c +++ b/curvetun.c @@ -132,7 +132,7 @@ static void __noreturn help(void) static void __noreturn version(void) { - printf("\ncurvetun %s, lightweight curve25519-based VPN/IP tunnel\n", VERSION_STRING); + printf("\ncurvetun %s, lightweight curve25519-based VPN/IP tunnel\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2011-2013 Daniel Borkmann ,\n" diff --git a/flowtop.c b/flowtop.c index 1050fc5..134be9f 100644 --- a/flowtop.c +++ b/flowtop.c @@ -262,7 +262,7 @@ static void help(void) static void version(void) { printf("\nflowtop %s, top-like netfilter TCP/UDP flow tracking\n", - VERSION_STRING); + VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2011-2013 Daniel Borkmann \n" diff --git a/ifpps.c b/ifpps.c index 8cad4ed..75cc3e6 100644 --- a/ifpps.c +++ b/ifpps.c @@ -126,7 +126,7 @@ static void __noreturn help(void) static void __noreturn version(void) { printf("\nifpps %s, top-like kernel networking and system statistics\n", - VERSION_STRING); + VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2009-2013 Daniel Borkmann \n" diff --git a/netsniff-ng.c b/netsniff-ng.c index a2f4fac..fe09c82 100644 --- a/netsniff-ng.c +++ b/netsniff-ng.c @@ -1072,7 +1072,7 @@ static void __noreturn help(void) static void __noreturn version(void) { - printf("\nnetsniff-ng %s, the packet sniffing beast\n", VERSION_STRING); + printf("\nnetsniff-ng %s, the packet sniffing beast\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2009-2013 Daniel Borkmann \n" diff --git a/staging/mausezahn.c b/staging/mausezahn.c index 7f712b7..7831b90 100644 --- a/staging/mausezahn.c +++ b/staging/mausezahn.c @@ -170,7 +170,7 @@ static void help(void) static void version(void) { - printf("\nmausezahn %s, a fast versatile traffic generator\n", VERSION_STRING); + printf("\nmausezahn %s, a fast versatile traffic generator\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2008-2010 Herbert Haas ,\n" diff --git a/trafgen.c b/trafgen.c index 82cc3db..9fa43fc 100644 --- a/trafgen.c +++ b/trafgen.c @@ -275,7 +275,7 @@ static void __noreturn example(void) static void __noreturn version(void) { - printf("\ntrafgen %s, multithreaded zero-copy network packet generator\n", VERSION_STRING); + printf("\ntrafgen %s, multithreaded zero-copy network packet generator\n", VERSION_LONG); puts("http://www.netsniff-ng.org\n\n" "Please report bugs to \n" "Copyright (C) 2011-2013 Daniel Borkmann ,\n" -- cgit v1.2.3-54-g00ecf