LIBXLSXWRITER	= \
  libxlsxwriter/src/app.o libxlsxwriter/src/format.o libxlsxwriter/src/theme.o \
  libxlsxwriter/src/chart.o libxlsxwriter/src/hash_table.o libxlsxwriter/src/utility.o \
  libxlsxwriter/src/content_types.o libxlsxwriter/src/packager.o libxlsxwriter/src/workbook.o \
  libxlsxwriter/src/core.o libxlsxwriter/src/relationships.o libxlsxwriter/src/worksheet.o \
  libxlsxwriter/src/custom.o libxlsxwriter/src/shared_strings.o libxlsxwriter/src/xmlwriter.o \
  libxlsxwriter/src/drawing.o libxlsxwriter/src/styles.o libxlsxwriter/third_party/tmpfileplus/tmpfileplus.o \
  libxlsxwriter/src/chartsheet.o libxlsxwriter/third_party/minizip/ioapi.o libxlsxwriter/third_party/minizip/zip.o libxlsxwriter/src/metadata.o \
  libxlsxwriter/src/comment.o libxlsxwriter/src/vml.o libxlsxwriter/third_party/md5/md5.o libxlsxwriter/src/table.o \
  libxlsxwriter/src/rich_value.o libxlsxwriter/src/rich_value_rel.o libxlsxwriter/src/rich_value_structure.o \
  libxlsxwriter/src/rich_value_types.o \

STATLIB = libxlsxwriter/src/libstatxlsxwriter.a

all: $(SHLIB) cleanup

$(SHLIB): $(STATLIB)

PKG_CFLAGS = $(C_VISIBILITY)
PKG_CPPFLAGS = -Ilibxlsxwriter/include -DUSE_R_LANG
PKG_LIBS = -Llibxlsxwriter/src -lstatxlsxwriter -lz

$(STATLIB): $(LIBXLSXWRITER)
	@rm -f $@
	$(AR) -cr $@ $(LIBXLSXWRITER)
	$(RANLIB) $@

cleanup: $(SHLIB)
	@rm -f $(LIBXLSXWRITER) $(STATLIB)
