diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-22 23:02:01 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-12-22 23:02:01 (GMT) |
commit | ea51ad0ceefd0a47df706a9301a8baf9b2629cc0 (patch) | |
tree | ddd9d71f58321b8b16ed70e1e1866887d106f786 /lib/Makefile | |
parent | 9b4b081c151ddde70587f0838062a9fd660bcc49 (diff) | |
download | lz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.zip lz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.tar.gz lz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.tar.bz2 |
Solaris: working "make install"
Diffstat (limited to 'lib/Makefile')
-rw-r--r-- | lib/Makefile | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/lib/Makefile b/lib/Makefile index 2b47fb0..f9fad29 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -42,11 +42,6 @@ LIBVER := $(shell echo $(LIBVER_SCRIPT)) BUILD_STATIC:= yes -DESTDIR ?= -PREFIX ?= /usr/local -LIBDIR ?= $(PREFIX)/lib -INCLUDEDIR=$(PREFIX)/include - CPPFLAGS+= -DXXH_NAMESPACE=LZ4_ CFLAGS ?= -O3 DEBUGFLAGS:=-g -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow \ @@ -107,10 +102,30 @@ clean: @echo Cleaning library completed -#------------------------------------------------------------------------ -#make install is validated only for Linux, OSX, kFreeBSD, Hurd and -#FreeBSD targets -ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD)) +#----------------------------------------------------------------------------- +# make install is validated only for Linux, OSX, BSD, Hurd and Solaris targets +#----------------------------------------------------------------------------- +ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS)) + +ifneq (,$(filter $(shell uname),SunOS)) +PREFIX ?= /usr +INSTALL ?= ginstall +else +PREFIX ?= /usr/local +INSTALL ?= install +endif +DESTDIR ?= +LIBDIR ?= $(PREFIX)/lib +INCLUDEDIR=$(PREFIX)/include + +ifneq (,$(filter $(shell uname),OpenBSD FreeBSD NetBSD DragonFly)) +PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig +else +PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig +endif + +INSTALL_LIB ?= $(INSTALL) -m 755 +INSTALL_DATA ?= $(INSTALL) -m 644 liblz4.pc: liblz4.pc.in Makefile @echo creating pkgconfig @@ -121,17 +136,19 @@ liblz4.pc: liblz4.pc.in Makefile $< >$@ install: lib liblz4.pc - @install -d -m 755 $(DESTDIR)$(LIBDIR)/pkgconfig/ $(DESTDIR)$(INCLUDEDIR)/ - @install -m 755 liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR) - @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) - @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) - @install -m 644 liblz4.pc $(DESTDIR)$(LIBDIR)/pkgconfig/ + @$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/ $(DESTDIR)$(INCLUDEDIR)/ + @$(INSTALL_DATA) liblz4.pc $(DESTDIR)$(PKGCONFIGDIR)/ + @echo Installing libraries ifeq ($(BUILD_STATIC),yes) - @install -m 644 liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a + @$(INSTALL_LIB) liblz4.a $(DESTDIR)$(LIBDIR)/liblz4.a endif - @install -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h - @install -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h - @install -m 644 lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h + @$(INSTALL_LIB) liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR) + @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT_MAJOR) + @ln -sf liblz4.$(SHARED_EXT_VER) $(DESTDIR)$(LIBDIR)/liblz4.$(SHARED_EXT) + @echo Installing includes + @$(INSTALL_DATA) -m 644 lz4.h $(DESTDIR)$(INCLUDEDIR)/lz4.h + @$(INSTALL_DATA) -m 644 lz4hc.h $(DESTDIR)$(INCLUDEDIR)/lz4hc.h + @$(INSTALL_DATA) -m 644 lz4frame.h $(DESTDIR)$(INCLUDEDIR)/lz4frame.h @echo lz4 static and shared libraries installed uninstall: |