aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2022-08-23 00:57:09 +0200
committerTeddy Wing2022-08-23 00:57:09 +0200
commite7e878e98ab8ba34720e8466f0cab10e8e70980a (patch)
tree33f53aa9422893c178e6bf351864f4556ddc4c22
parentadd2fe905028b9f9926f10a9e862d2fec1511106 (diff)
downloadextreload-e7e878e98ab8ba34720e8466f0cab10e8e70980a.tar.bz2
Makefile: Add an `install` target
Make it easy for package managers to build and install the program.
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index acfee9c..80344fc 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,14 @@
# along with Extreload. If not, see <https://www.gnu.org/licenses/>.
+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)