From 2bb2d8f7432bb8dd01dbb6f6bdb6ebf7d4e83447 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 5 Jan 2022 15:54:23 +0530 Subject: Makefile: Add dist and distcheck targets. * Makefile (GIT, GPG, LZIP, distribute_files, dist_archive): New variables. (.PHONY): Add dist and distcheck. (dist, $(dist_archive), distcheck): New targets. (%.asc): New pattern rule. (clean): Clean $(dist_archive) and $(dist_archive).asc. * build-aux/distcheck.scm: New file. --- Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ae1b4ed..59bc559 100644 --- a/Makefile +++ b/Makefile @@ -21,12 +21,18 @@ include Makefile.include GUILE = guile GUILD = guild +GIT = git +GPG = gpg +LZIP = lzip EMACS = emacs top_level_module_dir = $(project) sources = $(wildcard $(top_level_module_dir)/*.scm) objects = $(sources:.scm=.go) tests = $(wildcard tests/*.scm) +distribute_files = $(sources) $(tests) \ + COPYING NEWS.org README.org \ + guix.scm Makefile configure configure.scm scmdir = $(datarootdir)/guile/site/$(guile_effective_version)/$(top_level_module_dir) godir = $(libdir)/guile/$(guile_effective_version)/site-ccache/$(top_level_module_dir) @@ -36,10 +42,24 @@ all: $(objects) %.go: %.scm $(GUILD) compile -L . -o $@ $< -.PHONY: check install clean +.PHONY: check install clean dist distcheck check: $(tests) $(GUILE) -L . $^ +dist_archive = $(project)-$(version).tar.lz + +dist: $(dist_archive) $(dist_archive).asc + +$(dist_archive): .git/refs/heads/main + $(GIT) archive --prefix $(basename $(basename $@))/ --format=tar main $(distribute_files) \ + | $(LZIP) --force --output $@ + +%.asc: % + $(GPG) --detach-sign --armor $< + +distcheck: $(dist_archive) + $(GUILE) build-aux/distcheck.scm $< + install: $(sources) $(objects) install -D $(sources) --target-directory $(scmdir) install -D $(objects) --target-directory $(godir) @@ -50,4 +70,4 @@ website/index.html: README.org build-aux/build-home-page.el $(EMACS) -Q --batch --load build-aux/build-home-page.el --funcall build-website clean: - rm -f $(objects) Makefile.include website/index.html + rm -f $(objects) $(dist_archive) $(dist_archive).asc Makefile.include website/index.html -- cgit v1.2.3