From add2fe905028b9f9926f10a9e862d2fec1511106 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 23 Aug 2022 00:51:38 +0200 Subject: Makefile: Add self-contained bundle target Add a target to create a self-contained bundle of the program that isn't dependent on Quicklisp. This code is based on what I did in Wajir. --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 98bc97e..acfee9c 100644 --- a/Makefile +++ b/Makefile @@ -68,3 +68,15 @@ pkg: extreload_$(VERSION)_darwin-x86_64.tar.bz2 extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist + + +bundle: + mkdir -p lib/extreload + cp -a extreload.asd src lib/extreload/ + + $(LISP) --load bundle.lisp + +bundle/bundled-local-projects/0000/extreload/extreload: bundle + $(LISP) --load bundle/bundle.lisp \ + --eval '(asdf:make :extreload)' \ + --eval '(quit)' -- cgit v1.2.3 From e7e878e98ab8ba34720e8466f0cab10e8e70980a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 23 Aug 2022 00:57:09 +0200 Subject: Makefile: Add an `install` target Make it easy for package managers to build and install the program. --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index acfee9c..80344fc 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,14 @@ # along with Extreload. If not, see . +prefix ?= /usr/local +exec_prefix ?= $(prefix) +bindir ?= $(exec_prefix)/bin +datarootdir ?= $(prefix)/share +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + + LISP ?= sbcl VERSION := $(shell fgrep ':version' extreload.asd | awk -F '"' '{ print $$2 }') @@ -80,3 +88,11 @@ bundle/bundled-local-projects/0000/extreload/extreload: bundle $(LISP) --load bundle/bundle.lisp \ --eval '(asdf:make :extreload)' \ --eval '(quit)' + + +.PHONY: install +install: bundle/bundled-local-projects/0000/extreload/extreload $(MAN_PAGE) + install -m 755 bundle/bundled-local-projects/0000/extreload/extreload $(DESTDIR)$(bindir) + + install -d $(DESTDIR)$(man1dir) + install -m 644 $(MAN_PAGE) $(DESTDIR)$(man1dir) -- cgit v1.2.3 From bc3109dd27646004bf12430ddeb210f23ccda7f7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 20:57:04 +0200 Subject: Makefile: Add dependencies on `bundle` target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 80344fc..34c25cf 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist -bundle: +bundle: extreload.asd src/*.lisp mkdir -p lib/extreload cp -a extreload.asd src lib/extreload/ -- cgit v1.2.3 From e830899cf2268f38ff21038c9c7edfd0b080b385 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 20:57:27 +0200 Subject: Makefile: Rewrite `pkg` target to include bundle and source Copy the `pkg` target from Wajir to make a tarball of the bundled dependencies in `bundle` and the Extreload source code. This tarball can then be distributed and the program can be built and installed from it using the Makefile. By distributing the source, an executable can be built for more architectures and systems. --- Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 34c25cf..8f2abfa 100644 --- a/Makefile +++ b/Makefile @@ -71,13 +71,6 @@ $(DIST_MAN_PAGE): $(DIST)/share/man/man1 $(MAN_PAGE) cp $(MAN_PAGE) $< -.PHONY: pkg -pkg: extreload_$(VERSION)_darwin-x86_64.tar.bz2 - -extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist - tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist - - bundle: extreload.asd src/*.lisp mkdir -p lib/extreload cp -a extreload.asd src lib/extreload/ @@ -90,6 +83,21 @@ bundle/bundled-local-projects/0000/extreload/extreload: bundle --eval '(quit)' +.PHONY: pkg +pkg: extreload_$(VERSION).tar.bz2 + +extreload_$(VERSION).tar.bz2: bundle extreload.asd src/*.lisp + git archive \ + --prefix=extreload_$(VERSION)/ \ + --output=extreload_$(VERSION).tar \ + HEAD + tar -r \ + -s ,bundle,extreload_$(VERSION)/bundle, \ + -f extreload_$(VERSION).tar \ + bundle + bzip2 extreload_$(VERSION).tar + + .PHONY: install install: bundle/bundled-local-projects/0000/extreload/extreload $(MAN_PAGE) install -m 755 bundle/bundled-local-projects/0000/extreload/extreload $(DESTDIR)$(bindir) -- cgit v1.2.3 From ab47e8726d57daa115f3d292a40a36fa1e768818 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:25:33 +0200 Subject: Update copyright dates after bundle changes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8f2abfa..c070882 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Teddy Wing +# Copyright (c) 2021–2022 Teddy Wing # # This file is part of Extreload. # -- cgit v1.2.3