aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 22 insertions, 2 deletions
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