summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorJPeterMugaas <jpmugaas@suddenlink.net>2019-04-22 17:48:59 (GMT)
committerJPeterMugaas <jpmugaas@suddenlink.net>2019-04-22 17:48:59 (GMT)
commit773b66547f84792fd4143e605ca27f31c2989945 (patch)
tree269e98dc06b47c6741eb7e98b92abb0bd391f406 /programs
parent131896ab9d4fc9b8c606616327ed223d5d86472b (diff)
downloadlz4-773b66547f84792fd4143e605ca27f31c2989945.zip
lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.gz
lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.bz2
Initial commits from diff I submitted earlier
Diffstat (limited to 'programs')
-rw-r--r--programs/Makefile41
1 files changed, 36 insertions, 5 deletions
diff --git a/programs/Makefile b/programs/Makefile
index 92fd683..47912d8 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -56,17 +56,48 @@ LZ4_VERSION=$(LIBVER)
MD2ROFF = ronn
MD2ROFF_FLAGS = --roff --warnings --manual="User Commands" --organization="lz4 $(LZ4_VERSION)"
+TARGET_OS ?= $(shell uname)
+ifeq ($(TARGET_OS),)
+ TARGET_OS ?= $(OS)
+endif
# Define *.exe as extension for Windows systems
-ifneq (,$(filter Windows%,$(OS)))
+ifneq (,$(filter Windows%,$(TARGET_OS)))
+EXT :=.exe
+else
+ifneq (,$(filter MINGW%,$(TARGET_OS)))
+EXT :=.exe
+else
+ifneq (,$(filter MSYS%,$(TARGET_OS)))
+EXT :=.exe
+else
+ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
EXT :=.exe
-VOID := nul
else
EXT :=
-VOID := /dev/null
+endif
+endif
+endif
endif
-
+#determine if dev/nul based on host environment
+ifneq (,$(filter MINGW%,$(shell uname)))
+VOID := /dev/null
+else
+ifneq (,$(filter MSYS%,$(shell uname)))
+VOID := /dev/null
+else
+ifneq (,$(filter CYGWIN%,$(shell uname)))
+VOID := /dev/null
+else
+ifneq (,$(filter Windows%,$(OS)))
+VOID := nul
+else
+VOID := /dev/null
+endif
+endif
+endif
+endif
default: lz4-release
@@ -109,7 +140,7 @@ clean:
#-----------------------------------------------------------------------------
# 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 Haiku MidnightBSD MINGW32_NT-6.1 MINGW64_NT-6.1 MINGW32_NT-10.0 MINGW64_NT-10.0))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku MidnightBSD MINGW32_NT% MINGW64_NT% MSYS% CYGWIN_NT%,$(shell uname)))
unlz4: lz4
ln -s lz4$(EXT) unlz4$(EXT)