summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Christian <lucas@lucasec.com>2016-07-16 23:21:33 -0700
committerLucas Christian <lucas@lucasec.com>2016-07-16 23:22:25 -0700
commit81ccba8b54718c3f198699a81e26b07d8b7ae643 (patch)
treed4467705b0edb0040b83daf87e57f157421b5ef9
parent20861375e78338b67a25b71cf1eba383327c84fc (diff)
downloadmdns-repeater-81ccba8b54718c3f198699a81e26b07d8b7ae643.tar.gz
mdns-repeater-81ccba8b54718c3f198699a81e26b07d8b7ae643.zip
Update version tagging for git
-rw-r--r--.gitignore (renamed from .hgignore)10
-rw-r--r--Makefile14
-rw-r--r--mdns-repeater.c2
3 files changed, 12 insertions, 14 deletions
diff --git a/.hgignore b/.gitignore
index 4d9b3b2..cea2d46 100644
--- a/.hgignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
-syntax: glob
-
-*.o
-_hgversion
-mdns-repeater
-mdns-repeater-*.zip
+*.o
+_version
+mdns-repeater
+mdns-repeater-*.zip
diff --git a/Makefile b/Makefile
index a04f707..7d57abf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,13 @@
# Makefile for mdns-repeater
-ZIP_NAME = mdns-repeater-$(HGVERSION)
+ZIP_NAME = mdns-repeater-$(VCSVERSION)
ZIP_FILES = mdns-repeater \
README.txt \
LICENSE.txt
-HGVERSION=$(shell hg parents --template "{latesttag}.{latesttagdistance}")
+VCSVERSION=$(shell git describe --dirty="-SNAPSHOT" --always --tags)
CFLAGS=-Wall
@@ -18,13 +18,13 @@ CFLAGS+= -Os
LDFLAGS+= -s
endif
-CFLAGS+= -DHGVERSION="\"${HGVERSION}\""
+CFLAGS+= -DVCSVERSION="\"${VCSVERSION}\""
.PHONY: all clean
all: mdns-repeater
-mdns-repeater.o: _hgversion
+mdns-repeater.o: _version
mdns-repeater: mdns-repeater.o
@@ -39,12 +39,12 @@ zip: mdns-repeater
# version checking rules
.PHONY: dummy
-_hgversion: dummy
- @echo $(HGVERSION) | cmp -s $@ - || echo $(HGVERSION) > $@
+_version: dummy
+ @echo $(VCSVERSION) | cmp -s $@ - || echo $(VCSVERSION) > $@
clean:
-$(RM) *.o
- -$(RM) _hgversion
+ -$(RM) _version
-$(RM) mdns-repeater
-$(RM) mdns-repeater-*.zip
diff --git a/mdns-repeater.c b/mdns-repeater.c
index 03417d0..748ccf6 100644
--- a/mdns-repeater.c
+++ b/mdns-repeater.c
@@ -288,7 +288,7 @@ static void daemonize() {
}
static void show_help(const char *progname) {
- fprintf(stderr, "mDNS repeater (version " HGVERSION ")\n");
+ fprintf(stderr, "mDNS repeater (version " VCSVERSION ")\n");
fprintf(stderr, "Copyright (C) 2011 Darell Tan\n\n");
fprintf(stderr, "usage: %s [ -f ] <ifdev> ...\n", progname);