2014-06-08 17:40:59 +01:00
|
|
|
###############################################################################
|
|
|
|
#
|
|
|
|
# Makefile for libxlsxwriter examples.
|
|
|
|
#
|
2025-02-11 00:03:36 +00:00
|
|
|
# Copyright 2014-2025, John McNamara, jmcnamara@cpan.org
|
2014-06-08 17:40:59 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
# Keep the output quiet by default.
|
|
|
|
Q=@
|
|
|
|
ifdef V
|
|
|
|
Q=
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Directory variables.
|
|
|
|
INC_DIR = ../include
|
|
|
|
|
|
|
|
# Flags passed to the C++ compiler.
|
|
|
|
CFLAGS += -g -Wall -Wextra
|
|
|
|
|
|
|
|
# Source files to compile.
|
|
|
|
SRCS = $(wildcard *.c)
|
|
|
|
EXES = $(patsubst %.c,%,$(SRCS))
|
|
|
|
|
|
|
|
LIBXLSXWRITER = ../src/libxlsxwriter.a
|
|
|
|
|
|
|
|
LIBS = $(LIBXLSXWRITER) -lz
|
2017-08-14 20:08:57 +01:00
|
|
|
ifdef USE_SYSTEM_MINIZIP
|
|
|
|
LIBS += -lminizip
|
|
|
|
endif
|
2021-05-27 21:08:58 +01:00
|
|
|
ifdef USE_OPENSSL_MD5
|
|
|
|
LIBS += -lcrypto
|
|
|
|
endif
|
2014-06-08 17:40:59 +01:00
|
|
|
|
|
|
|
all : $(LIBXLSXWRITER) $(EXES)
|
|
|
|
|
|
|
|
$(LIBXLSXWRITER):
|
2016-07-12 23:20:44 +01:00
|
|
|
$(Q)$(MAKE) -C ../third_party/minizip
|
2016-07-14 00:02:50 +01:00
|
|
|
ifndef USE_STANDARD_TMPFILE
|
|
|
|
$(Q)$(MAKE) -C ../third_party/tmpfileplus
|
2019-12-24 00:14:47 +00:00
|
|
|
endif
|
2021-07-11 13:40:35 +01:00
|
|
|
ifndef USE_STANDARD_DOUBLE
|
|
|
|
$(Q)$(MAKE) -C ../third_party/dtoa
|
|
|
|
endif
|
2019-12-24 00:14:47 +00:00
|
|
|
ifndef USE_NO_MD5
|
|
|
|
$(Q)$(MAKE) -C ../third_party/md5
|
2016-07-14 00:02:50 +01:00
|
|
|
endif
|
2016-07-12 23:20:44 +01:00
|
|
|
$(Q)$(MAKE) -C ../src
|
2014-06-08 17:40:59 +01:00
|
|
|
|
|
|
|
clean :
|
|
|
|
$(Q)rm -f $(EXES)
|
|
|
|
|
|
|
|
# Executable targets.
|
|
|
|
%: %.c $(LIBXLSXWRITER)
|
|
|
|
$(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $< -o $@ $(LIBS)
|
|
|
|
|
|
|
|
test_valgrind: all
|
2015-04-16 23:47:23 +01:00
|
|
|
$(Q)$(foreach exe,$(EXES),valgrind -q --error-exitcode=1 --leak-check=full ./$(exe) || exit;)
|