fixed MinGW compilation
diff --git a/Makefile b/Makefile
index 96f5a9a..a575873 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,12 @@
TESTDIR = tests
# Define nul output
-ifneq (,$(filter Windows%,$(OS)))
-VOID = nul
-else
VOID = /dev/null
+
+ifneq (,$(filter Windows%,$(OS)))
+EXT =.exe
+else
+EXT =
endif
.PHONY: default
@@ -35,7 +37,7 @@
zstd:
@$(MAKE) -C $(PRGDIR)
- cp $(PRGDIR)/zstd .
+ cp $(PRGDIR)/zstd$(EXT) .
.PHONY: zlibwrapper
zlibwrapper:
@@ -51,7 +53,7 @@
@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
@$(MAKE) -C $(TESTDIR) $@ > $(VOID)
@$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID)
- @$(RM) zstd
+ @$(RM) zstd$(EXT)
@echo Cleaning completed
diff --git a/lib/Makefile b/lib/Makefile
index 04ebe26..cfc3028 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -73,9 +73,11 @@
$(LIBZSTD): $(ZSTD_FILES)
@echo compiling dynamic library $(LIBVER)
@$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
+ifeq (,$(filter Windows%,$(OS)))
@echo creating versioned links
@ln -sf $@.$(SHARED_EXT_VER) libzstd.$(SHARED_EXT_MAJOR)
@ln -sf $@.$(SHARED_EXT_VER) libzstd.$(SHARED_EXT)
+endif
libzstd : $(LIBZSTD)
diff --git a/programs/Makefile b/programs/Makefile
index 64aeb66..b72cebd 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -56,7 +56,6 @@
# Define *.exe as extension for Windows systems
ifneq (,$(filter Windows%,$(OS)))
EXT =.exe
-VOID = nul
RES64_FILE = windres\zstd64.res
RES32_FILE = windres\zstd32.res
ifneq (,$(filter x86_64%,$(shell $(CC) -dumpmachine)))
@@ -66,7 +65,6 @@
endif
else
EXT =
-VOID = /dev/null
endif