From: Przemyslaw Skibinski Date: Thu, 3 Nov 2016 11:59:20 +0000 (+0100) Subject: fixed MinGW compilation X-Git-Tag: v1.1.2~88^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a415594b156d5d76e03f033aea1e67793513b1c;p=thirdparty%2Fzstd.git fixed MinGW compilation --- diff --git a/Makefile b/Makefile index 96f5a9ad8..a57587341 100644 --- a/Makefile +++ b/Makefile @@ -14,10 +14,12 @@ ZWRAPDIR = zlibWrapper TESTDIR = tests # Define nul output +VOID = /dev/null + ifneq (,$(filter Windows%,$(OS))) -VOID = nul +EXT =.exe else -VOID = /dev/null +EXT = endif .PHONY: default @@ -35,7 +37,7 @@ lib: zstd: @$(MAKE) -C $(PRGDIR) - cp $(PRGDIR)/zstd . + cp $(PRGDIR)/zstd$(EXT) . .PHONY: zlibwrapper zlibwrapper: @@ -51,7 +53,7 @@ clean: @$(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 04ebe26bd..cfc3028eb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -73,9 +73,11 @@ $(LIBZSTD): LDFLAGS += -shared -fPIC $(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 64aeb668d..b72cebdb1 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -56,7 +56,6 @@ endif # 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 @@ else endif else EXT = -VOID = /dev/null endif