Include import library in Windows binary releases

Previously:
	- libdeflate.dll: the dynamic library
	- libdeflate.lib: the static library

Now:
	- libdeflate.dll: the dynamic library
	- libdeflate.lib: the import library
	- libdeflatestatic.lib: the static library
This commit is contained in:
Eric Biggers 2018-12-06 20:13:18 -08:00
parent 2b6689d8aa
commit 7fad94b8c9
2 changed files with 19 additions and 15 deletions

View File

@ -34,15 +34,17 @@ override CFLAGS := \
STATIC_LIB_SUFFIX := .a
SHARED_LIB_SUFFIX := .so
SHARED_LIB_CFLAGS := -fPIC
SHARED_LIB_LDFLAGS :=
PROG_SUFFIX :=
PROG_CFLAGS :=
HARD_LINKS := 1
# Compiling for Windows with MinGW?
ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
STATIC_LIB_SUFFIX := .lib
STATIC_LIB_SUFFIX := static.lib
SHARED_LIB_SUFFIX := .dll
SHARED_LIB_CFLAGS :=
SHARED_LIB_LDFLAGS := -Wl,--out-implib,libdeflate.lib
PROG_SUFFIX := .exe
PROG_CFLAGS := -static -municode
HARD_LINKS :=
@ -130,7 +132,8 @@ DEFAULT_TARGETS += $(STATIC_LIB)
# Create shared library
$(SHARED_LIB):$(SHARED_LIB_OBJ)
$(QUIET_CCLD) $(CC) -o $@ $(LDFLAGS) $(LIB_CFLAGS) -shared $+
$(QUIET_CCLD) $(CC) -o $@ $(LDFLAGS) $(LIB_CFLAGS) \
$(SHARED_LIB_LDFLAGS) -shared $+
DEFAULT_TARGETS += $(SHARED_LIB)

View File

@ -9,7 +9,8 @@ for arch in 'i686' 'x86_64'; do
dir=libdeflate-$(git describe --tags | tr -d v)-windows-${arch}-bin
rm -rf $dir ${dir}.zip
mkdir $dir
cp libdeflate.dll libdeflate.lib libdeflate.h *.exe $dir
cp libdeflate.dll libdeflate.lib libdeflatestatic.lib \
libdeflate.h *.exe $dir
${arch}-w64-mingw32-strip ${dir}/libdeflate.dll ${dir}/*.exe
for file in COPYING NEWS; do
sed < $file > ${dir}/${file}.txt -e 's/$/\r/g'