summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorPrzemyslaw Skibinski <inikep@gmail.com>2016-12-22 23:02:01 (GMT)
committerPrzemyslaw Skibinski <inikep@gmail.com>2016-12-22 23:02:01 (GMT)
commitea51ad0ceefd0a47df706a9301a8baf9b2629cc0 (patch)
treeddd9d71f58321b8b16ed70e1e1866887d106f786 /programs
parent9b4b081c151ddde70587f0838062a9fd660bcc49 (diff)
downloadlz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.zip
lz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.tar.gz
lz4-ea51ad0ceefd0a47df706a9301a8baf9b2629cc0.tar.bz2
Solaris: working "make install"
Diffstat (limited to 'programs')
-rw-r--r--programs/Makefile37
1 files changed, 25 insertions, 12 deletions
diff --git a/programs/Makefile b/programs/Makefile
index 5f14ad7..f91a326 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -38,10 +38,6 @@ LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
LIBVER_PATCH := $(shell echo $(LIBVER_PATCH_SCRIPT))
LIBVER := $(shell echo $(LIBVER_SCRIPT))
-DESTDIR ?=
-PREFIX ?= /usr/local
-BINDIR := $(PREFIX)/bin
-MANDIR := $(PREFIX)/share/man/man1
LZ4DIR := ../lib
VOID := /dev/null
@@ -107,10 +103,10 @@ preview-man: clean-man man
man ./lz4.1
-#------------------------------------------------------------------------
-#make install is validated only for Linux, OSX, kFreeBSD, FreeBSD, Hurd and
-#Solaris targets
-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU FreeBSD SunOS))
+#-----------------------------------------------------------------------------
+# 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))
unlz4: lz4
ln -s lz4 unlz4
@@ -118,15 +114,32 @@ unlz4: lz4
lz4cat: lz4
ln -s lz4 lz4cat
+
+ifneq (,$(filter $(shell uname),SunOS))
+PREFIX ?= /usr
+INSTALL ?= ginstall
+else
+PREFIX ?= /usr/local
+INSTALL ?= install
+endif
+DESTDIR ?=
+BINDIR = $(PREFIX)/bin
+MANDIR = $(PREFIX)/share/man/man1
+
+INSTALL_PROGRAM ?= $(INSTALL) -m 755
+INSTALL_SCRIPT ?= $(INSTALL) -m 755
+INSTALL_MAN ?= $(INSTALL) -m 644
+
+
install: lz4$(EXT) lz4c$(EXT)
@echo Installing binaries
- @install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
- @install -m 755 lz4 $(DESTDIR)$(BINDIR)/lz4
+ @$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
+ @$(INSTALL_PROGRAM) lz4 $(DESTDIR)$(BINDIR)/lz4
@ln -sf lz4 $(DESTDIR)$(BINDIR)/lz4cat
@ln -sf lz4 $(DESTDIR)$(BINDIR)/unlz4
- @install -m 755 lz4c$(EXT) $(DESTDIR)$(BINDIR)/lz4c
+ @$(INSTALL_PROGRAM) lz4c$(EXT) $(DESTDIR)$(BINDIR)/lz4c
@echo Installing man pages
- @install -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1
+ @$(INSTALL_MAN) -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1
@ln -sf lz4.1 $(DESTDIR)$(MANDIR)/lz4c.1
@ln -sf lz4.1 $(DESTDIR)$(MANDIR)/lz4cat.1
@ln -sf lz4.1 $(DESTDIR)$(MANDIR)/unlz4.1