summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorgregoire.detrez <gregoire.detrez@gu.se>2014-10-15 08:51:25 +0000
committergregoire.detrez <gregoire.detrez@gu.se>2014-10-15 08:51:25 +0000
commit503a29e00249dccb7c862586e6990d9145b27a9d (patch)
tree1bc908ee4827ae65d9ab6fc6228f9de4d89af6b7 /Makefile
parentb0e9ded3cd30f7bb3a16595a4a4eab3eb5abd99b (diff)
Add a make target to create the source distribution
`make sdist` will create a `dist/gf-<version>.tar.gz package with the source files (using the `darcs dist` command).
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index bb7c3fde3..be3ad00f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,7 @@
-.PHONY: all build install doc clean gf # sdist
+.PHONY: all build install doc clean gf sdist
+
+# This gets the numeric part of the version from the cabal file
+VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal)
all: build
@@ -41,3 +44,10 @@ pkg:
# Make a binary tar distribution
bintar:
bash bin/build-binary-dist.sh
+
+# Make a source tar.gz distribution using darcs to make sure that everything
+# is included. We put the distribution in dist/ so it is removed on
+# `make clean`
+sdist:
+ test -d dist || mkdir dist
+ darcs dist -d dist/gf-${VERSION}