From d37d3b54f408d913b5e51133ac5d11385c257bdd Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Mon, 6 Apr 2020 02:24:16 +0300 Subject: [PATCH] mdbx-make: refine install/uninstall targets. Change-Id: Id8390b6ff462f55237534a06a92d03b8666b518f --- GNUmakefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 4669a357..27eee508 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -9,7 +9,7 @@ SHELL := env bash # install sandbox -SANDBOX ?= +DESTDIR ?= # install prefixes (inside sandbox) prefix ?= /usr/local @@ -303,14 +303,17 @@ cross-qemu: #< dist-cutoff-end install: $(LIBRARIES) $(TOOLS) $(HEADERS) - mkdir -p $(SANDBOX)$(prefix)/bin$(suffix) \ - && cp -t $(SANDBOX)$(prefix)/bin$(suffix) $(TOOLS) && \ - mkdir -p $(SANDBOX)$(prefix)/lib$(suffix) \ - && cp -t $(SANDBOX)$(prefix)/lib$(suffix) $(LIBRARIES) && \ - mkdir -p $(SANDBOX)$(prefix)/include \ - && cp -t $(SANDBOX)$(prefix)/include $(HEADERS) && \ - mkdir -p $(SANDBOX)$(mandir)/man1 \ - && cp -t $(SANDBOX)$(mandir)/man1 $(addprefix $(MAN_SRCDIR), $(MANPAGES)) + install -D -p -s -t $(DESTDIR)$(prefix)/bin$(suffix) $(TOOLS) && \ + install -D -p -s -t $(DESTDIR)$(prefix)/lib$(suffix) $(filter-out libmdbx.a,$(LIBRARIES)) && \ + install -D -p -t $(DESTDIR)$(prefix)/lib$(suffix) libmdbx.a && \ + install -D -p -m 444 -t $(DESTDIR)$(prefix)/include $(HEADERS) && \ + install -D -p -m 444 -t $(DESTDIR)$(mandir)/man1 $(addprefix $(MAN_SRCDIR), $(MANPAGES)) + +uninstall: + rm -f $(addprefix $(DESTDIR)$(prefix)/bin$(suffix)/,$(TOOLS)) \ + $(addprefix $(DESTDIR)$(prefix)/lib$(suffix)/,$(LIBRARIES)) \ + $(addprefix $(DESTDIR)$(prefix)/include/,$(HEADERS)) \ + $(addprefix $(DESTDIR)$(mandir)/man1/,$(MANPAGES)) ################################################################################ # Benchmarking by ioarena