58 lines
1.1 KiB
Makefile
Raw Normal View History

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
ifdef USE_SYSTEM_MINIZIP
LIBS += -lminizip
endif
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
endif
ifndef USE_STANDARD_DOUBLE
$(Q)$(MAKE) -C ../third_party/dtoa
endif
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;)