fixed MinGW compilation

This commit is contained in:
Przemyslaw Skibinski 2016-11-03 12:59:20 +01:00
parent 1f60eb6b17
commit 3a415594b1
3 changed files with 9 additions and 7 deletions

View File

@ -14,10 +14,12 @@ ZWRAPDIR = zlibWrapper
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 @@ 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

View File

@ -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)

View File

@ -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