mdbx-make: add install-strip and install-no-strip targets.

Resolves https://github.com/erthink/libmdbx/pull/180
This commit is contained in:
Leonid Yuriev 2021-03-26 14:45:03 +03:00
parent c77494e2aa
commit 50e729a687

View File

@ -26,6 +26,7 @@ mandir ?= $(prefix)/man
# lib/bin suffix for multiarch/biarch, e.g. '.x86_64' # lib/bin suffix for multiarch/biarch, e.g. '.x86_64'
suffix ?= suffix ?=
INSTALL ?= install
CC ?= gcc CC ?= gcc
CFLAGS_EXTRA ?= CFLAGS_EXTRA ?=
LD ?= ld 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 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 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) all: $(LIBRARIES) $(TOOLS)
@ -421,12 +422,19 @@ cross-qemu:
done done
#< dist-cutoff-end #< dist-cutoff-end
install: $(LIBRARIES) $(TOOLS) $(HEADERS) install: $(LIBRARIES) $(TOOLS) $(HEADERS)
install -D -p -s -t $(DESTDIR)$(prefix)/bin$(suffix) $(TOOLS) && \ $(INSTALL) -D -p $(EXE_INSTALL_FLAGS) -t $(DESTDIR)$(prefix)/bin$(suffix) $(TOOLS) && \
install -D -p -s -t $(DESTDIR)$(prefix)/lib$(suffix) $(filter-out libmdbx.a,$(LIBRARIES)) && \ $(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 -t $(DESTDIR)$(prefix)/lib$(suffix) libmdbx.a && \
install -D -p -m 444 -t $(DESTDIR)$(prefix)/include $(HEADERS) && \ $(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 -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: uninstall:
rm -f $(addprefix $(DESTDIR)$(prefix)/bin$(suffix)/,$(TOOLS)) \ rm -f $(addprefix $(DESTDIR)$(prefix)/bin$(suffix)/,$(TOOLS)) \