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(+) 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