summaryrefslogtreecommitdiffstats
path: root/examples
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 /examples
parent131896ab9d4fc9b8c606616327ed223d5d86472b (diff)
downloadlz4-773b66547f84792fd4143e605ca27f31c2989945.zip
lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.gz
lz4-773b66547f84792fd4143e605ca27f31c2989945.tar.bz2
Initial commits from diff I submitted earlier
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile47
1 files changed, 42 insertions, 5 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 103e7ec..26aaafd 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -38,14 +38,51 @@ LZ4 = ../programs/lz4
# Define *.exe as extension for Windows systems
-ifneq (,$(filter Windows%,$(OS)))
-EXT =.exe
-VOID = nul
+
+# Define *.exe as extension for targetting Windows systems
+TARGET_OS ?= $(shell uname)
+ifeq ($(TARGET_OS),)
+ TARGET_OS ?= $(OS)
+endif
+
+ifneq (,$(filter Windows%,$(TARGET_OS)))
+LIBLZ4 = liblz4-$(LIBVER_MAJOR)
+EXT = .exe
+else
+EXT = .exe
+ifneq (,$(filter MINGW%,$(TARGET_OS)))
+EXT = .exe
else
-EXT =
-VOID = /dev/null
+ifneq (,$(filter MSYS%,$(TARGET_OS)))
+EXT = .exe
+else
+ifneq (,$(filter CYGWIN%,$(TARGET_OS)))
+EXT = .exe
+else
+EXT =
+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: all