Add “install” and “uninstall” tasks to Makefile

This commit is contained in:
Jaidyn Ann 2024-06-01 22:07:02 -05:00
parent b3a6062127
commit 17762ad3e4

View File

@ -1,6 +1,11 @@
LISP ?= sbcl LISP ?= sbcl
all: clean build PREFIX ?= /usr/local
BINDIR ?= ${PREFIX}/bin
MANDIR ?= ${PREFIX}/share/man
MAN1DIR ?= ${MANDIR}/man1
all: build
clean: clean:
-rm mirror-img -rm mirror-img
@ -12,13 +17,23 @@ quicklisp:
--eval '(ql:add-to-init-file)' \ --eval '(ql:add-to-init-file)' \
--eval '(quit)' --eval '(quit)'
build: mirror-img:
$(LISP) --load mirror-img.asd \ $(LISP) --load mirror-img.asd \
--eval '(ql:quickload :mirror-img)' \ --eval '(ql:quickload :mirror-img)' \
--eval '(ql:quickload :mirror-img/unix)' \ --eval '(ql:quickload :mirror-img/unix)' \
--eval '(asdf:make :mirror-img/unix)' \ --eval '(asdf:make :mirror-img/unix)' \
--eval '(quit)' --eval '(quit)'
build: mirror-img
install: build
install -m 775 mirror-img ${BINDIR}
install -m 444 mirror-img.1 ${MAN1DIR}
uninstall:
rm ${BINDIR}/mirror-img
rm ${MAN1DIR}/mirror-img.1
test: test:
$(LISP) --load mirror-img.asd \ $(LISP) --load mirror-img.asd \
--eval '(ql:quickload :mirror-img)' \ --eval '(ql:quickload :mirror-img)' \