mirror of
https://github.com/jmcnamara/libxlsxwriter
synced 2025-03-28 21:13:14 +00:00
Added option to use system minizip in make build.
Added option to use system minizip in the Makefile make system. Issue #119.
This commit is contained in:
parent
7401ea39ee
commit
856a45a292
@ -7,6 +7,7 @@ compiler:
|
||||
env:
|
||||
- CFLAGS='-Werror'
|
||||
- NO_VALGRIND=1 USE_STANDARD_TMPFILE=1 CFLAGS='-Werror'
|
||||
- NO_VALGRIND=1 USE_SYSTEM_MINIZIP=1 CFLAGS='-Werror'
|
||||
- NO_VALGRIND=1 CFLAGS='-Werror -m32'
|
||||
|
||||
install:
|
||||
@ -14,6 +15,7 @@ install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y gcc-multilib
|
||||
- sudo apt-get install -y zlib1g-dev
|
||||
- sudo apt-get install -y libminizip-dev
|
||||
- sudo apt-get install -y zlib1g-dev:i386
|
||||
- sudo apt-get install -y gcc
|
||||
- sudo apt-get install -y valgrind
|
||||
|
12
Makefile
12
Makefile
@ -17,7 +17,9 @@ INSTALL_DIR ?= /usr/local
|
||||
|
||||
# Build the libs.
|
||||
all :
|
||||
ifndef USE_SYSTEM_MINIZIP
|
||||
$(Q)$(MAKE) -C third_party/minizip
|
||||
endif
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) -C third_party/tmpfileplus
|
||||
endif
|
||||
@ -33,11 +35,13 @@ clean :
|
||||
$(Q)$(MAKE) clean -C test/unit
|
||||
$(Q)$(MAKE) clean -C test/functional/src
|
||||
$(Q)$(MAKE) clean -C examples
|
||||
$(Q)$(MAKE) clean -C third_party/minizip
|
||||
$(Q)rm -rf docs/html
|
||||
$(Q)rm -rf test/functional/__pycache__
|
||||
$(Q)rm -f test/functional/*.pyc
|
||||
$(Q)rm -f lib/*
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) clean -C third_party/minizip
|
||||
endif
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) clean -C third_party/tmpfileplus
|
||||
endif
|
||||
@ -59,7 +63,9 @@ test_functional : all
|
||||
# Run all tests.
|
||||
test_unit :
|
||||
@echo "Compiling unit tests ..."
|
||||
ifndef USE_SYSTEM_MINIZIP
|
||||
$(Q)$(MAKE) -C third_party/minizip
|
||||
endif
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) -C third_party/tmpfileplus
|
||||
endif
|
||||
@ -106,7 +112,9 @@ strip:
|
||||
|
||||
# Run a coverity static analysis.
|
||||
coverity:
|
||||
ifndef USE_SYSTEM_MINIZIP
|
||||
$(Q)$(MAKE) -C third_party/minizip
|
||||
endif
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) -C third_party/tmpfileplus
|
||||
endif
|
||||
@ -121,7 +129,9 @@ endif
|
||||
|
||||
# Run a scan-build static analysis.
|
||||
scan_build:
|
||||
ifndef USE_SYSTEM_MINIZIP
|
||||
$(Q)$(MAKE) -C third_party/minizip
|
||||
endif
|
||||
ifndef USE_STANDARD_TMPFILE
|
||||
$(Q)$(MAKE) -C third_party/tmpfileplus
|
||||
endif
|
||||
|
@ -24,6 +24,9 @@ EXES = $(patsubst %.c,%,$(SRCS))
|
||||
LIBXLSXWRITER = ../src/libxlsxwriter.a
|
||||
|
||||
LIBS = $(LIBXLSXWRITER) -lz
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
LIBS += -lminizip
|
||||
endif
|
||||
|
||||
all : $(LIBXLSXWRITER) $(EXES)
|
||||
|
||||
|
16
src/Makefile
16
src/Makefile
@ -15,8 +15,16 @@ endif
|
||||
OBJS_DIR = .
|
||||
INC_DIR = ../include
|
||||
|
||||
# The minizip directory.
|
||||
LIBS = -lz
|
||||
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
LIBS += -lminizip
|
||||
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
|
||||
@ -103,7 +111,7 @@ 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)
|
||||
@ -111,11 +119,11 @@ 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)
|
||||
|
@ -24,6 +24,9 @@ EXES = $(patsubst %.c,%,$(SRCS))
|
||||
LIBXLSXWRITER = ../../../src/libxlsxwriter.a
|
||||
|
||||
LIBS = $(LIBXLSXWRITER) -lz
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
LIBS += -lminizip
|
||||
endif
|
||||
|
||||
all : $(LIBXLSXWRITER) $(EXES)
|
||||
|
||||
@ -41,4 +44,3 @@ clean :
|
||||
|
||||
test_valgrind: all
|
||||
$(Q)$(foreach exe,$(EXES),valgrind -q --error-exitcode=1 --leak-check=full ./$(exe) || exit;)
|
||||
|
||||
|
@ -44,6 +44,9 @@ OBJS = $(patsubst %.c,%.o,$(SRCS))
|
||||
# Libs to link.
|
||||
LIBS_A = $(LIB_DIR)/libxlsxwriter_test.a
|
||||
LIBS_O = -lz
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
LIBS_O += -lminizip
|
||||
endif
|
||||
# End of LIBS
|
||||
|
||||
# House-keeping build targets.
|
||||
@ -95,4 +98,3 @@ test_all : test_all.o $(OBJS) $(LIBS_A)
|
||||
#
|
||||
test : all test_all
|
||||
$(Q)./test_all
|
||||
|
||||
|
@ -26,6 +26,10 @@ OBJS = $(patsubst %.c,%.o,$(SRCS))
|
||||
# Libs to link.
|
||||
LIBS_A = $(LIB_DIR)/libxlsxwriter_test.a
|
||||
LIBS_O = -lz
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
LIBS_O += -lminizip
|
||||
endif
|
||||
|
||||
|
||||
# Make all the individual tests.
|
||||
all : $(TESTS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user