summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile21
1 files changed, 20 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 979c4f1..cc69eed 100644
--- a/Makefile
+++ b/Makefile
@@ -18,12 +18,16 @@
# <http://www.gnu.org/licenses/>.
project = guile-email
+version = $(subst v,,$(shell git describe --abbrev=0))
# FIXME: Do not hardcode the effective version.
guile_effective_version = 3.0
EMACS ?= emacs
+GIT ?= git
+GPG ?= gpg
GUILD ?= guild
GUILE ?= guile
+LZIP ?= lzip
MAKEINFO ?= makeinfo
prefix ?= /usr/local
@@ -39,11 +43,15 @@ tests = $(wildcard tests/*.scm)
doc_texi = doc/$(project).texi
doc_html = $(doc_texi:.texi=.html)
doc_info = $(doc_texi:.texi=.info)
+distribute_files = $(sources) tests $(doc_texi) \
+ build-aux/test-driver.scm \
+ COPYING NEWS README.org \
+ guix.scm Makefile
scmdir = $(datarootdir)/guile/site/$(guile_effective_version)
godir = $(libdir)/guile/$(guile_effective_version)/site-ccache
-.PHONY: all check install clean
+.PHONY: all check install clean dist
all: $(objects)
@@ -70,6 +78,17 @@ website/manual/dev/en: $(doc_html)
check: $(tests)
$(GUILE) --no-auto-compile -L . build-aux/test-driver.scm $^
+dist_archive = $(project)-$(version).tar.lz
+
+dist: $(dist_archive) $(dist_archive).asc
+
+$(dist_archive): .git/refs/heads/master
+ $(GIT) archive --prefix $(basename $(basename $@))/ --format=tar master $(distribute_files) \
+ | $(LZIP) --force --output $@
+
+%.asc: %
+ $(GPG) --detach-sign --armor $<
+
install: $(doc_info)
mkdir -p $(scmdir) $(godir)
cp --parents -vr $(sources) $(scmdir)