Commit 3ca0299925816e9643d37c39e44c29341bc1265c

Thomas de Grivel 2020-08-28T13:35:44

Release Adams 0.3.1

diff --git a/Makefile b/Makefile
index b84a083..8a393a2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,14 @@
-
+PACKAGE = adams
+VERSION = 0.3.1
+RELEASE_DIR = ${PACKAGE}-${VERSION}
+RELEASE_TARBALL = ${PACKAGE}-${VERSION}.tar.gz
+RELEASE_DEPS_TARBALL = ${PACKAGE}-${VERSION}.deps.tar.gz
 PROGRAM = build/adams
 PREFIX = /usr/local
 LISP = sbcl --dynamic-space-size 2048
 LISP_LOAD = ${LISP} --load
+CLEANFILES = build/*
+DISTCLEANFILES = ${RELEASE_DIR} ${RELEASE_TARBALL} ${RELEASE_DEPS_TARBALL}
 
 all: ${PROGRAM}
 
@@ -15,10 +21,23 @@ build/systems.lisp: prepare-build.lisp adams.asd
 ${PROGRAM}: build.lisp config.lisp build/systems.lisp toplevel.lisp
 	LANG=C.UTF-8 ${LISP_LOAD} build.lisp --quit
 
-clean:
-	rm -rf build/*
-
 install:
 	install -m 0755 ${PROGRAM} ${PREFIX}/bin
 
-.PHONY: all clean deps install ${PROGRAM}
+release: ${RELEASE_TARBALL} ${RELEASE_DEPS_TARBALL}
+
+${RELEASE_TARBALL}:
+	mkdir ${RELEASE_DIR}
+	find . -name build -prune -or -name '*.lisp' -or -name '*.asd' -or -name '*.md' | cpio -pd ${RELEASE_DIR}
+	tar czf ${RELEASE_TARBALL} ${RELEASE_DIR}
+
+${RELEASE_DEPS_TARBALL}:
+	tar czf ${RELEASE_DEPS_TARBALL} build/*.lisp
+
+clean:
+	rm -rf ${CLEANFILES}
+
+distclean:
+	rm -rf ${DISTCLEANFILES}
+
+.PHONY: all clean deps install ${PROGRAM} release