Makefile: Add `dist' target.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 24 May 2014 22:20:55 +0000 (23:20 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 11 Jun 2014 13:11:29 +0000 (14:11 +0100)
I don't think source distributions are really the right answer for
Chopwood, but it's a tradition, and it doesn't seem like a harmful one.

For the record: you're expected to run Chopwood out of a Git clone; and
users should get distributions from you using the AGPL-required `source'
command.

Makefile

index 13a7b59..3ccd4e5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -117,4 +117,23 @@ CLEANFILES += $(TARGETS)
 clean::; rm -f $(CLEANFILES)
 .PHONY: clean
 
+###--------------------------------------------------------------------------
+### Distributions.
+
+distdir                         = $(PACKAGE)-$(VERSION)
+
+DISTFILES               = $(SOURCES)
+DISTFILES              += AGPLv3
+DISTFILES              += Makefile get-version
+DISTFILES              += userv.rc
+
+dist:
+       rm -rf $(distdir)
+       mkdir $(distdir)
+       cp $(DISTFILES) $(distdir)
+       echo $(VERSION) >$(distdir)/RELEASE
+       tar cvfz $(distdir).tar.gz $(distdir)
+       rm -rf $(distdir)
+.PHONY: dist
+
 ###----- That's all, folks --------------------------------------------------