Fix MinGW cross build from Unix
generate_res.bat seems rather pointless, am I missing something? I just inlined it into the Makefile.dev
parent
106278e7e5
commit
0ede342acc
|
@ -165,15 +165,15 @@ $(ZSTDDECOMP_O): CFLAGS += $(ALIGN_LOOP)
|
||||||
zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP)
|
zstd : CPPFLAGS += $(THREAD_CPP) $(ZLIBCPP) $(LZMACPP) $(LZ4CPP)
|
||||||
zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD)
|
zstd : LDFLAGS += $(THREAD_LD) $(ZLIBLD) $(LZMALD) $(LZ4LD) $(DEBUGFLAGS_LD)
|
||||||
zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
zstd : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
||||||
|
ifneq (,$(filter Windows%,$(OS)))
|
||||||
|
zstd : $(RES_FILE)
|
||||||
|
endif
|
||||||
zstd : $(ZSTDLIB_FILES) zstdcli.o util.o timefn.o fileio.o benchfn.o benchzstd.o datagen.o dibio.o
|
zstd : $(ZSTDLIB_FILES) zstdcli.o util.o timefn.o fileio.o benchfn.o benchzstd.o datagen.o dibio.o
|
||||||
@echo "$(THREAD_MSG)"
|
@echo "$(THREAD_MSG)"
|
||||||
@echo "$(ZLIB_MSG)"
|
@echo "$(ZLIB_MSG)"
|
||||||
@echo "$(LZMA_MSG)"
|
@echo "$(LZMA_MSG)"
|
||||||
@echo "$(LZ4_MSG)"
|
@echo "$(LZ4_MSG)"
|
||||||
ifneq (,$(filter Windows%,$(OS)))
|
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
|
||||||
windres/generate_res.bat
|
|
||||||
endif
|
|
||||||
$(CC) $(FLAGS) $^ $(RES_FILE) -o $@$(EXT) $(LDFLAGS)
|
|
||||||
|
|
||||||
.PHONY: zstd-release
|
.PHONY: zstd-release
|
||||||
zstd-release: DEBUGFLAGS := -DBACKTRACE_ENABLE=0
|
zstd-release: DEBUGFLAGS := -DBACKTRACE_ENABLE=0
|
||||||
|
@ -183,11 +183,11 @@ zstd-release: zstd
|
||||||
zstd32 : CPPFLAGS += $(THREAD_CPP)
|
zstd32 : CPPFLAGS += $(THREAD_CPP)
|
||||||
zstd32 : LDFLAGS += $(THREAD_LD)
|
zstd32 : LDFLAGS += $(THREAD_LD)
|
||||||
zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
zstd32 : CPPFLAGS += -DZSTD_LEGACY_SUPPORT=$(ZSTD_LEGACY_SUPPORT)
|
||||||
zstd32 : $(ZSTDLIB_FILES) zstdcli.c util.c timefn.c fileio.c benchfn.c benchzstd.c datagen.c dibio.c
|
|
||||||
ifneq (,$(filter Windows%,$(OS)))
|
ifneq (,$(filter Windows%,$(OS)))
|
||||||
windres/generate_res.bat
|
zstd32 : $(RES32_FILE)
|
||||||
endif
|
endif
|
||||||
$(CC) -m32 $(FLAGS) $^ $(RES32_FILE) -o $@$(EXT)
|
zstd32 : $(ZSTDLIB_FILES) zstdcli.c util.c timefn.c fileio.c benchfn.c benchzstd.c datagen.c dibio.c
|
||||||
|
$(CC) -m32 $(FLAGS) $^ -o $@$(EXT)
|
||||||
|
|
||||||
zstd-nolegacy : $(ZSTD_FILES) $(ZDICT_FILES) zstdcli.o util.o fileio.c benchfn.o benchzstd.o timefn.o datagen.o dibio.o
|
zstd-nolegacy : $(ZSTD_FILES) $(ZDICT_FILES) zstdcli.o util.o fileio.c benchfn.o benchzstd.o timefn.o datagen.o dibio.o
|
||||||
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
|
$(CC) $(FLAGS) $^ -o $@$(EXT) $(LDFLAGS)
|
||||||
|
@ -235,8 +235,16 @@ zstdmt: zstd
|
||||||
ln -sf zstd zstdmt
|
ln -sf zstd zstdmt
|
||||||
|
|
||||||
.PHONY: generate_res
|
.PHONY: generate_res
|
||||||
generate_res:
|
generate_res: $(RES64_FILE) $(RES32_FILE)
|
||||||
windres/generate_res.bat
|
|
||||||
|
ifneq (,$(filter Windows%,$(OS)))
|
||||||
|
RC ?= windres
|
||||||
|
# http://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable
|
||||||
|
$(RES64_FILE): windres/zstd.rc
|
||||||
|
$(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-x86-64
|
||||||
|
$(RES32_FILE): windres/zstd.rc
|
||||||
|
$(RC) -o $@ -I ../lib -I windres -i $< -O coff -F pe-i386
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
@echo off
|
|
||||||
REM http://stackoverflow.com/questions/708238/how-do-i-add-an-icon-to-a-mingw-gcc-compiled-executable
|
|
||||||
|
|
||||||
where /q windres.exe
|
|
||||||
IF ERRORLEVEL 1 (
|
|
||||||
ECHO The windres.exe is missing. Ensure it is installed and placed in your PATH.
|
|
||||||
EXIT /B
|
|
||||||
) ELSE (
|
|
||||||
windres.exe -I ../lib -I windres -i windres/zstd.rc -O coff -F pe-x86-64 -o windres/zstd64.res
|
|
||||||
windres.exe -I ../lib -I windres -i windres/zstd.rc -O coff -F pe-i386 -o windres/zstd32.res
|
|
||||||
)
|
|
Loading…
Reference in New Issue