mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-08-04 02:06:31 -04:00
Makefile: support custom BINDIR, INCDIR, and LIBDIR
The Makefile forced installation into $(PREFIX)/lib, e.g. /usr/lib. But many distros use /usr/lib64 instead. Therefore, allow specifying a custom BINDIR, INCDIR, and/or LIBDIR. This allows the parent shell to call on Gentoo Linux: make install DESTDIR="${DESTDIR}/${EPREFIX}" LIBDIR=/usr/"$(get_libdir)" [EB - improved commit message]
This commit is contained in:
parent
cb7ee82c22
commit
96ce0ffcde
27
Makefile
27
Makefile
@ -34,6 +34,9 @@ override CFLAGS := \
|
||||
##############################################################################
|
||||
|
||||
PREFIX ?= /usr
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
INCDIR ?= $(PREFIX)/include
|
||||
LIBDIR ?= $(PREFIX)/lib
|
||||
|
||||
SOVERSION := 0
|
||||
STATIC_LIB_SUFFIX := .a
|
||||
@ -240,20 +243,20 @@ DEFAULT_TARGETS += gunzip$(PROG_SUFFIX)
|
||||
all:$(DEFAULT_TARGETS)
|
||||
|
||||
install:all
|
||||
install -Dm644 -t $(DESTDIR)$(PREFIX)/lib $(STATIC_LIB)
|
||||
install -Dm755 -t $(DESTDIR)$(PREFIX)/lib $(SHARED_LIB)
|
||||
ln -sf $(SHARED_LIB) $(DESTDIR)$(PREFIX)/lib/libdeflate.so
|
||||
install -Dm644 -t $(DESTDIR)$(PREFIX)/include libdeflate.h
|
||||
install -Dm755 gzip $(DESTDIR)$(PREFIX)/bin/libdeflate-gzip
|
||||
ln -f $(DESTDIR)$(PREFIX)/bin/libdeflate-gzip $(DESTDIR)$(PREFIX)/bin/libdeflate-gunzip
|
||||
install -Dm644 -t $(DESTDIR)$(LIBDIR) $(STATIC_LIB)
|
||||
install -Dm755 -t $(DESTDIR)$(LIBDIR) $(SHARED_LIB)
|
||||
ln -sf $(SHARED_LIB) $(DESTDIR)$(LIBDIR)/libdeflate.so
|
||||
install -Dm644 -t $(DESTDIR)$(INCDIR) libdeflate.h
|
||||
install -Dm755 gzip $(DESTDIR)$(BINDIR)/libdeflate-gzip
|
||||
ln -f $(DESTDIR)$(BINDIR)/libdeflate-gzip $(DESTDIR)$(BINDIR)/libdeflate-gunzip
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(PREFIX)/lib/$(STATIC_LIB) \
|
||||
$(DESTDIR)$(PREFIX)/lib/$(SHARED_LIB) \
|
||||
$(DESTDIR)$(PREFIX)/lib/libdeflate.so \
|
||||
$(DESTDIR)$(PREFIX)/include/libdeflate.h \
|
||||
$(DESTDIR)$(PREFIX)/bin/libdeflate-gzip \
|
||||
$(DESTDIR)$(PREFIX)/bin/libdeflate-gunzip
|
||||
rm -f $(DESTDIR)$(LIBDIR)/$(STATIC_LIB) \
|
||||
$(DESTDIR)$(LIBDIR)/$(SHARED_LIB) \
|
||||
$(DESTDIR)$(LIBDIR)/libdeflate.so \
|
||||
$(DESTDIR)$(INCDIR)/libdeflate.h \
|
||||
$(DESTDIR)$(BINDIR)/libdeflate-gzip \
|
||||
$(DESTDIR)$(BINDIR)/libdeflate-gunzip
|
||||
|
||||
test_programs:$(TEST_PROGRAMS)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user