google / zopfli

Zopfli Compression Algorithm is a compression library programmed in C to perform very good, but slow, deflate or zlib compression.
Apache License 2.0
3.43k stars 330 forks source link

Incorrect ZopfliPNG static library build rule #179

Open OpenA opened 3 years ago

OpenA commented 3 years ago

It's not include zopfli object files (and not working if i just separatly linking libzopflipng.a + libzopfli.a in my project)

diff --git a/Makefile b/Makefile
index 5407de8..36a80ae 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ libzopflipng: $(ZOPFLILIB_OBJ) $(LODEPNG_OBJ) $(ZOPFLIPNGLIB_OBJ)
    $(CXX) $^ $(CFLAGS) --shared -Wl,-soname,libzopflipng.so.1 -o libzopflipng.so.1.0.3 $(LDFLAGS)

 # ZopfliPNG static library
-libzopflipng.a: $(LODEPNG_OBJ) $(ZOPFLIPNGLIB_OBJ)
+libzopflipng.a: $(LODEPNG_OBJ) $(ZOPFLILIB_OBJ) $(ZOPFLIPNGLIB_OBJ)
    ar rcs $@ $^

 # Remove all libraries and binaries

but in shared library it have and all working

# ZopfliPNG shared library
libzopflipng: $(ZOPFLILIB_OBJ) $(LODEPNG_OBJ) $(ZOPFLIPNGLIB_OBJ)
    $(CXX) $^ $(CFLAGS) --shared -Wl,-soname,libzopflipng.so.1 -o libzopflipng.so.1.0.3 $(LDFLAGS)