summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarell Tan <darell.tan@gmail.com>2011-01-02 22:38:41 +0800
committerDarell Tan <darell.tan@gmail.com>2011-01-02 22:38:41 +0800
commit6f54e6bce3ccf7ad12a8f9a417fed4b4be16c463 (patch)
tree5a997cbe7c2cfb966d33452511e8d48a3df24425
parent81c0027bd200bfc106989baa91ab5306864a11ee (diff)
downloadmdns-repeater-6f54e6bce3ccf7ad12a8f9a417fed4b4be16c463.tar.gz
mdns-repeater-6f54e6bce3ccf7ad12a8f9a417fed4b4be16c463.zip
Added hg revision tag into executable to allow tracking of versions.
See http://mercurial.selenic.com/wiki/KeywordPlan
-rw-r--r--Makefile4
-rw-r--r--mdns-repeater.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b177f91..d49a3bf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
# Makefile for mdns-repeater
+HGVERSION=$(shell hg id -i)
+
CFLAGS=-Wall
ifdef DEBUG
@@ -9,6 +11,8 @@ CFLAGS+= -Os
LDFLAGS+= -s
endif
+CFLAGS+= -DHGVERSION="\"${HGVERSION}\""
+
.PHONY: all clean
all: mdns-repeater
diff --git a/mdns-repeater.c b/mdns-repeater.c
index 5b5165b..05aa002 100644
--- a/mdns-repeater.c
+++ b/mdns-repeater.c
@@ -243,7 +243,7 @@ static void daemonize() {
}
static void show_help(const char *progname) {
- fprintf(stderr, "mDNS repeater\n");
+ fprintf(stderr, "mDNS repeater (rev %s)\n", HGVERSION);
fprintf(stderr, "usage: %s [ -f ] <ifdev> ...\n", progname);
fprintf(stderr, "\n"
"<ifdev> specifies an interface like \"eth0\"\n"