+
+%.8: %.8.adoc
+ asciidoctor -b manpage $^
+
+clean:
+ rm -f packnl packnl.8 incore.lsp.8
+
+# Installation targets
+
+BINFILES = packnl
+MAN8FILES = packnl.8 incore.lsp.8 main-args.lsp.8
+LSPMODFILES = incore.lsp main-args.lsp
+
+BINDIR = $(DESTDIR)/usr/bin
+MAN8DIR = $(DESTDIR)/usr/share/man/man8
+LSPMODDIR = $(DESTDIR)/usr/share/newlisp
+
+INSTALLTARGETS =
+INSTALLTARGETS += $(addprefix $(BINDIR),$(BINFILES))
+INSTALLTARGETS += $(addprefix $(MAN8DIR)/,$(MAN8FILES))
+INSTALLTARGETS += $(addprefix $(LSPMODDIR)/,$(LSPMODFILES))
+
+INSTALL = install
+
+$(BINDIR)/% $(MAN8DIR)/% $(LSPMODDIR)/%: %
+ $(INSTALL) -D -T $< $@
+
+install: $(INSTALLTARGETS)