From 595fe32e7680e75bca74addff27471138cfeb139 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 11 Jan 2023 23:29:29 +0000 Subject: Makefile: Add release tarball generation rules. * Makefile (version, GIT, GPG, LZIP, distribute_files, dist_archive): New variables. (dist, $(dist_archive), %.asc): New rules. (.PHONY): Add dist. --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 979c4f1..cc69eed 100644 --- a/Makefile +++ b/Makefile @@ -18,12 +18,16 @@ # . 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) -- cgit v1.2.3