Support DESTDIR when installing (#745)

In autoconf-style builds, DESTDIR is used to install to somewhere
other than /; this is used in particular by packaging systems to
"install" to a staging area before archiving the package contents.

See https://www.gnu.org/prep/standards/html_node/DESTDIR.html for the
specification.

Signed-off-by: Stephen Kitt <steve@sk2.org>
This commit is contained in:
Stephen Kitt 2021-11-11 20:47:09 +01:00 committed by GitHub
parent 39a6ddd782
commit 3423f61bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -17,7 +17,7 @@ check:
go test -v
install: build
cp mlr $(INSTALLDIR)
cp mlr $(DESTDIR)/$(INSTALLDIR)
make -C man install
fmt:

View file

@ -22,8 +22,8 @@ build: .always
cp mlr.1 ./man1
install:
mkdir -p $(INSTALLDIR)
cp mlr.1 $(INSTALLDIR)/mlr.1
mkdir -p $(DESTDIR)/$(INSTALLDIR)
cp mlr.1 $(DESTDIR)/$(INSTALLDIR)/mlr.1
# ----------------------------------------------------------------