diff options
author | Lucas Christian <lucas@lucasec.com> | 2016-07-16 23:21:33 -0700 |
---|---|---|
committer | Lucas Christian <lucas@lucasec.com> | 2016-07-16 23:22:25 -0700 |
commit | 81ccba8b54718c3f198699a81e26b07d8b7ae643 (patch) | |
tree | d4467705b0edb0040b83daf87e57f157421b5ef9 | |
parent | 20861375e78338b67a25b71cf1eba383327c84fc (diff) | |
download | mdns-repeater-81ccba8b54718c3f198699a81e26b07d8b7ae643.tar.gz mdns-repeater-81ccba8b54718c3f198699a81e26b07d8b7ae643.zip |
Update version tagging for git
-rw-r--r-- | .gitignore (renamed from .hgignore) | 10 | ||||
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | mdns-repeater.c | 2 |
3 files changed, 12 insertions, 14 deletions
@@ -1,6 +1,4 @@ -syntax: glob
-
-*.o
-_hgversion
-mdns-repeater
-mdns-repeater-*.zip
+*.o +_version +mdns-repeater +mdns-repeater-*.zip @@ -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); |