summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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