From 50e729a68785effed387f5aaf02accde250cc360 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Fri, 26 Mar 2021 14:45:03 +0300 Subject: [PATCH] mdbx-make: add `install-strip` and `install-no-strip` targets. Resolves https://github.com/erthink/libmdbx/pull/180 --- GNUmakefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index ec9ccf8b..a99dcbe0 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -26,6 +26,7 @@ mandir ?= $(prefix)/man # lib/bin suffix for multiarch/biarch, e.g. '.x86_64' suffix ?= +INSTALL ?= install CC ?= gcc CFLAGS_EXTRA ?= LD ?= ld @@ -60,7 +61,7 @@ LIBRARIES := libmdbx.a libmdbx.$(SO_SUFFIX) TOOLS := mdbx_stat mdbx_copy mdbx_dump mdbx_load mdbx_chk mdbx_drop MANPAGES := mdbx_stat.1 mdbx_copy.1 mdbx_dump.1 mdbx_load.1 mdbx_chk.1 mdbx_drop.1 -.PHONY: mdbx all install clean +.PHONY: mdbx all install install-strip install-no-strip clean all: $(LIBRARIES) $(TOOLS) @@ -421,12 +422,19 @@ cross-qemu: done #< dist-cutoff-end + install: $(LIBRARIES) $(TOOLS) $(HEADERS) - 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)) + $(INSTALL) -D -p $(EXE_INSTALL_FLAGS) -t $(DESTDIR)$(prefix)/bin$(suffix) $(TOOLS) && \ + $(INSTALL) -D -p $(EXE_INSTALL_FLAGS) -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)) + +install-strip: EXE_INSTALL_FLAGS = -s +install-strip: install + +install-no-strip: EXE_INSTALL_FLAGS = +install-no-strip: install uninstall: rm -f $(addprefix $(DESTDIR)$(prefix)/bin$(suffix)/,$(TOOLS)) \