From 268fce8a3e49dd86358a491873905b6635dd9157 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Nov 2021 18:08:24 +0100 Subject: [PATCH] scalar: allow installing the command Now that we implemented Scalar's core functionality, let's offer users the option to install the command via `make -C contrib/scalar install`. Signed-off-by: Johannes Schindelin --- contrib/scalar/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/scalar/Makefile b/contrib/scalar/Makefile index 37f283f35d74d6..3944efe2caa23d 100644 --- a/contrib/scalar/Makefile +++ b/contrib/scalar/Makefile @@ -32,4 +32,14 @@ clean: test: all $(MAKE) -C t -.PHONY: $(GITLIBS) all clean test FORCE +INSTALL = install +prefix = $(HOME) +bindir = $(prefix)/bin +DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) +bindir_SQ = $(subst ','\'',$(bindir)) + +install: + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)' + $(INSTALL) scalar$(X) '$(DESTDIR_SQ)$(bindir_SQ)' + +.PHONY: $(GITLIBS) all clean test install FORCE