From eac579bdd36b2837f769b60c9c7daf208021de6a Mon Sep 17 00:00:00 2001 From: Darell Tan Date: Wed, 21 Sep 2011 21:50:06 +0800 Subject: Added Makefile target to create release zip files. --- .hgignore | 2 +- Makefile | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3