summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarell Tan <darell.tan@gmail.com>2011-09-21 21:50:06 +0800
committerDarell Tan <darell.tan@gmail.com>2011-09-21 21:50:06 +0800
commiteac579bdd36b2837f769b60c9c7daf208021de6a (patch)
tree4e674ac6f9cb31f3bf9a7f1b38ac2793fe3164dc
parent805f2687adab13454d771d6d697e4b6096c57b82 (diff)
downloadmdns-repeater-eac579bdd36b2837f769b60c9c7daf208021de6a.tar.gz
mdns-repeater-eac579bdd36b2837f769b60c9c7daf208021de6a.zip
Added Makefile target to create release zip files.
-rw-r--r--.hgignore2
-rw-r--r--Makefile17
2 files changed, 18 insertions, 1 deletions
diff --git a/.hgignore b/.hgignore
index 40452c3..4d9b3b2 100644
--- a/.hgignore
+++ b/.hgignore
@@ -3,4 +3,4 @@ syntax: glob
*.o
_hgversion
mdns-repeater
-
+mdns-repeater-*.zip
diff --git a/Makefile b/Makefile
index 8ecc858..a04f707 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,12 @@
# Makefile for mdns-repeater
+
+ZIP_NAME = mdns-repeater-$(HGVERSION)
+
+ZIP_FILES = mdns-repeater \
+ README.txt \
+ LICENSE.txt
+
HGVERSION=$(shell hg parents --template "{latesttag}.{latesttagdistance}")
CFLAGS=-Wall
@@ -21,6 +28,15 @@ mdns-repeater.o: _hgversion
mdns-repeater: mdns-repeater.o
+.PHONY: zip
+zip: TMPDIR := $(shell mktemp -d)
+zip: mdns-repeater
+ mkdir $(TMPDIR)/$(ZIP_NAME)
+ cp $(ZIP_FILES) $(TMPDIR)/$(ZIP_NAME)
+ -$(RM) $(CURDIR)/$(ZIP_NAME).zip
+ cd $(TMPDIR) && zip -r $(CURDIR)/$(ZIP_NAME).zip $(ZIP_NAME)
+ -$(RM) -rf $(TMPDIR)
+
# version checking rules
.PHONY: dummy
_hgversion: dummy
@@ -30,4 +46,5 @@ clean:
-$(RM) *.o
-$(RM) _hgversion
-$(RM) mdns-repeater
+ -$(RM) mdns-repeater-*.zip