ext/xlsxwriter/libxlsxwriter/src/Makefile in xlsxwriter-0.0.3 vs ext/xlsxwriter/libxlsxwriter/src/Makefile in xlsxwriter-0.0.4.pre.2
- old
+ new
@@ -13,12 +13,21 @@
# Directory variables.
OBJS_DIR = .
INC_DIR = ../include
-# The minizip directory.
+LIBS = -lz
+
+ifdef USE_SYSTEM_MINIZIP
+LIBS += -lminizip
+CFLAGS += -DUSE_SYSTEM_MINIZIP
+else
+# Use the local copy of minizip.
MINIZIP_DIR = ../third_party/minizip
+MINIZIP_OBJ = $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o
+MINIZIP_SO = $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so
+endif
ifdef USE_STANDARD_TMPFILE
# Use standard/C tmpfile().
CFLAGS += -DUSE_STANDARD_TMPFILE
@@ -30,10 +39,21 @@
endif
# Flags passed to compiler.
CFLAGS += -g -O3 -Wall -Wextra -pedantic -ansi
+# Fix for modified zconf.h on Gentoo.
+ifneq (,$(findstring gentoo, $(shell uname -sr)))
+CFLAGS += -DOF=_Z_OF
+endif
+
+
+# Ignore icc remarks about inlining limits.
+ifeq ($(CC),icc)
+CFLAGS +=-diag-disable=11074,11076
+endif
+
# Library names.
LIBXLSXWRITER_A = libxlsxwriter.a
LIBXLSXWRITER_SO = libxlsxwriter.so
# Library with additional non-static functions for testing.
@@ -90,23 +110,23 @@
test_lib : libxlsxwriter_test.a
# The static library.
$(LIBXLSXWRITER_A) : $(OBJS)
- $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $(TMPFILEPLUS_OBJ) $^
+ $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $^
# The dynamic library.
ifeq ($(findstring m32,$(CFLAGS)),m32)
ARCH = -m32
endif
$(LIBXLSXWRITER_SO) : $(SOBJS)
- $(Q)$(CC) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so $(TMPFILEPLUS_SO) $^ -lz
+ $(Q)$(CC) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_SO) $(TMPFILEPLUS_SO) $^ $(LIBS)
# The test library.
$(LIBXLSXWRITER_TO) : $(TOBJS)
- $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $(TMPFILEPLUS_OBJ) $^
+ $(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_OBJ) $(TMPFILEPLUS_OBJ) $^
# Minimal target for quick compile without creating the libs.
test_compile : $(OBJS)
# Targets for the object files.
@@ -115,10 +135,10 @@
%.so : %.c $(HDRS)
$(Q)$(CC) $(FPIC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
%.to : %.c $(HDRS)
- $(Q)$(CC) -g -O0 -DTESTING -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
+ $(Q)$(CC) -g -O3 -DTESTING -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
# Clean up any temp/build files.
clean :
$(Q)rm -f *.o *.a *.so *.to *.dylib *.dll