fast_excel 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -2
- data/Makefile +14 -0
- data/README.md +7 -2
- data/Rakefile +10 -0
- data/extconf.rb +0 -0
- data/fast_excel.gemspec +3 -1
- data/lib/fast_excel/binding.rb +3 -7
- data/lib/rubygems_plugin.rb +3 -0
- data/libxlsxwriter/.gitignore +49 -0
- data/libxlsxwriter/.indent.pro +125 -0
- data/libxlsxwriter/.travis.yml +25 -0
- data/libxlsxwriter/CONTRIBUTING.md +226 -0
- data/libxlsxwriter/Changes.txt +557 -0
- data/libxlsxwriter/LICENSE.txt +89 -0
- data/libxlsxwriter/Makefile +156 -0
- data/libxlsxwriter/Readme.md +78 -0
- data/libxlsxwriter/cocoapods/libxlsxwriter-umbrella.h +30 -0
- data/libxlsxwriter/cocoapods/libxlsxwriter.modulemap +7 -0
- data/libxlsxwriter/include/xlsxwriter/app.h +79 -0
- data/libxlsxwriter/include/xlsxwriter/chart.h +3476 -0
- data/libxlsxwriter/include/xlsxwriter/common.h +372 -0
- data/libxlsxwriter/include/xlsxwriter/content_types.h +74 -0
- data/libxlsxwriter/include/xlsxwriter/core.h +51 -0
- data/libxlsxwriter/include/xlsxwriter/custom.h +52 -0
- data/libxlsxwriter/include/xlsxwriter/drawing.h +111 -0
- data/libxlsxwriter/include/xlsxwriter/format.h +1214 -0
- data/libxlsxwriter/include/xlsxwriter/hash_table.h +76 -0
- data/libxlsxwriter/include/xlsxwriter/packager.h +80 -0
- data/libxlsxwriter/include/xlsxwriter/relationships.h +77 -0
- data/libxlsxwriter/include/xlsxwriter/shared_strings.h +83 -0
- data/libxlsxwriter/include/xlsxwriter/styles.h +77 -0
- data/libxlsxwriter/include/xlsxwriter/theme.h +47 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/ioapi.h +214 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/queue.h +694 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/tmpfileplus.h +53 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/tree.h +801 -0
- data/libxlsxwriter/include/xlsxwriter/third_party/zip.h +375 -0
- data/libxlsxwriter/include/xlsxwriter/utility.h +166 -0
- data/libxlsxwriter/include/xlsxwriter/workbook.h +757 -0
- data/libxlsxwriter/include/xlsxwriter/worksheet.h +2641 -0
- data/libxlsxwriter/include/xlsxwriter/xmlwriter.h +178 -0
- data/libxlsxwriter/include/xlsxwriter.h +23 -0
- data/libxlsxwriter/lib/.gitignore +0 -0
- data/libxlsxwriter/libxlsxwriter.podspec +47 -0
- data/libxlsxwriter/src/Makefile +130 -0
- data/libxlsxwriter/src/app.c +443 -0
- data/libxlsxwriter/src/chart.c +6346 -0
- data/libxlsxwriter/src/content_types.c +345 -0
- data/libxlsxwriter/src/core.c +293 -0
- data/libxlsxwriter/src/custom.c +224 -0
- data/libxlsxwriter/src/drawing.c +746 -0
- data/libxlsxwriter/src/format.c +729 -0
- data/libxlsxwriter/src/hash_table.c +223 -0
- data/libxlsxwriter/src/packager.c +948 -0
- data/libxlsxwriter/src/relationships.c +245 -0
- data/libxlsxwriter/src/shared_strings.c +266 -0
- data/libxlsxwriter/src/styles.c +1088 -0
- data/libxlsxwriter/src/theme.c +348 -0
- data/libxlsxwriter/src/utility.c +515 -0
- data/libxlsxwriter/src/workbook.c +1930 -0
- data/libxlsxwriter/src/worksheet.c +5022 -0
- data/libxlsxwriter/src/xmlwriter.c +355 -0
- data/libxlsxwriter/third_party/minizip/Makefile +44 -0
- data/libxlsxwriter/third_party/minizip/Makefile.am +45 -0
- data/libxlsxwriter/third_party/minizip/Makefile.orig +25 -0
- data/libxlsxwriter/third_party/minizip/MiniZip64_Changes.txt +6 -0
- data/libxlsxwriter/third_party/minizip/MiniZip64_info.txt +74 -0
- data/libxlsxwriter/third_party/minizip/README.txt +5 -0
- data/libxlsxwriter/third_party/minizip/configure.ac +32 -0
- data/libxlsxwriter/third_party/minizip/crypt.h +131 -0
- data/libxlsxwriter/third_party/minizip/ioapi.c +247 -0
- data/libxlsxwriter/third_party/minizip/ioapi.h +208 -0
- data/libxlsxwriter/third_party/minizip/iowin32.c +456 -0
- data/libxlsxwriter/third_party/minizip/iowin32.h +28 -0
- data/libxlsxwriter/third_party/minizip/make_vms.com +25 -0
- data/libxlsxwriter/third_party/minizip/miniunz.c +660 -0
- data/libxlsxwriter/third_party/minizip/miniunzip.1 +63 -0
- data/libxlsxwriter/third_party/minizip/minizip.1 +46 -0
- data/libxlsxwriter/third_party/minizip/minizip.c +520 -0
- data/libxlsxwriter/third_party/minizip/minizip.pc.in +12 -0
- data/libxlsxwriter/third_party/minizip/mztools.c +291 -0
- data/libxlsxwriter/third_party/minizip/mztools.h +37 -0
- data/libxlsxwriter/third_party/minizip/unzip.c +2125 -0
- data/libxlsxwriter/third_party/minizip/unzip.h +437 -0
- data/libxlsxwriter/third_party/minizip/zip.c +2007 -0
- data/libxlsxwriter/third_party/minizip/zip.h +367 -0
- data/libxlsxwriter/third_party/tmpfileplus/Makefile +42 -0
- data/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c +342 -0
- data/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.h +53 -0
- data/libxlsxwriter/version.txt +1 -0
- metadata +89 -6
- data/binaries/libxlsxwriter-alpine.so +0 -0
- data/binaries/libxlsxwriter-darwin.dylib +0 -0
- data/binaries/libxlsxwriter-glibc.so +0 -0
@@ -0,0 +1,178 @@
|
|
1
|
+
/*
|
2
|
+
* libxlsxwriter
|
3
|
+
*
|
4
|
+
* Copyright 2014-2017, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
|
+
*
|
6
|
+
* xmlwriter - A libxlsxwriter library for creating Excel XLSX
|
7
|
+
* XML files.
|
8
|
+
*
|
9
|
+
* The xmlwriter library is used to create the XML sub-components files
|
10
|
+
* in the Excel XLSX file format.
|
11
|
+
*
|
12
|
+
* This library is used in preference to a more generic XML library to allow
|
13
|
+
* for customization and optimization for the XLSX file format.
|
14
|
+
*
|
15
|
+
* The xmlwriter functions are only used internally and do not need to be
|
16
|
+
* called directly by the end user.
|
17
|
+
*
|
18
|
+
*/
|
19
|
+
#ifndef __XMLWRITER_H__
|
20
|
+
#define __XMLWRITER_H__
|
21
|
+
|
22
|
+
#include <stdio.h>
|
23
|
+
#include <stdlib.h>
|
24
|
+
#include <stdint.h>
|
25
|
+
#include "common.h"
|
26
|
+
|
27
|
+
#define LXW_MAX_ATTRIBUTE_LENGTH 256
|
28
|
+
#define LXW_ATTR_32 32
|
29
|
+
|
30
|
+
#define LXW_ATTRIBUTE_COPY(dst, src) \
|
31
|
+
do{ \
|
32
|
+
strncpy(dst, src, LXW_MAX_ATTRIBUTE_LENGTH -1); \
|
33
|
+
dst[LXW_MAX_ATTRIBUTE_LENGTH - 1] = '\0'; \
|
34
|
+
} while (0)
|
35
|
+
|
36
|
+
|
37
|
+
/* *INDENT-OFF* */
|
38
|
+
#ifdef __cplusplus
|
39
|
+
extern "C" {
|
40
|
+
#endif
|
41
|
+
/* *INDENT-ON* */
|
42
|
+
|
43
|
+
/* Attribute used in XML elements. */
|
44
|
+
struct xml_attribute {
|
45
|
+
char key[LXW_MAX_ATTRIBUTE_LENGTH];
|
46
|
+
char value[LXW_MAX_ATTRIBUTE_LENGTH];
|
47
|
+
|
48
|
+
/* Make the struct a queue.h list element. */
|
49
|
+
STAILQ_ENTRY (xml_attribute) list_entries;
|
50
|
+
};
|
51
|
+
|
52
|
+
/* Use queue.h macros to define the xml_attribute_list type. */
|
53
|
+
STAILQ_HEAD(xml_attribute_list, xml_attribute);
|
54
|
+
|
55
|
+
/* Create a new attribute struct to add to a xml_attribute_list. */
|
56
|
+
struct xml_attribute *lxw_new_attribute_str(const char *key,
|
57
|
+
const char *value);
|
58
|
+
struct xml_attribute *lxw_new_attribute_int(const char *key, uint32_t value);
|
59
|
+
struct xml_attribute *lxw_new_attribute_dbl(const char *key, double value);
|
60
|
+
|
61
|
+
/* Macro to initialize the xml_attribute_list pointers. */
|
62
|
+
#define LXW_INIT_ATTRIBUTES() \
|
63
|
+
STAILQ_INIT(&attributes)
|
64
|
+
|
65
|
+
/* Macro to add attribute string elements to xml_attribute_list. */
|
66
|
+
#define LXW_PUSH_ATTRIBUTES_STR(key, value) \
|
67
|
+
do { \
|
68
|
+
attribute = lxw_new_attribute_str((key), (value)); \
|
69
|
+
STAILQ_INSERT_TAIL(&attributes, attribute, list_entries); \
|
70
|
+
} while (0)
|
71
|
+
|
72
|
+
/* Macro to add attribute int values to xml_attribute_list. */
|
73
|
+
#define LXW_PUSH_ATTRIBUTES_INT(key, value) \
|
74
|
+
do { \
|
75
|
+
attribute = lxw_new_attribute_int((key), (value)); \
|
76
|
+
STAILQ_INSERT_TAIL(&attributes, attribute, list_entries); \
|
77
|
+
} while (0)
|
78
|
+
|
79
|
+
/* Macro to add attribute double values to xml_attribute_list. */
|
80
|
+
#define LXW_PUSH_ATTRIBUTES_DBL(key, value) \
|
81
|
+
do { \
|
82
|
+
attribute = lxw_new_attribute_dbl((key), (value)); \
|
83
|
+
STAILQ_INSERT_TAIL(&attributes, attribute, list_entries); \
|
84
|
+
} while (0)
|
85
|
+
|
86
|
+
/* Macro to free xml_attribute_list and attribute. */
|
87
|
+
#define LXW_FREE_ATTRIBUTES() \
|
88
|
+
while (!STAILQ_EMPTY(&attributes)) { \
|
89
|
+
attribute = STAILQ_FIRST(&attributes); \
|
90
|
+
STAILQ_REMOVE_HEAD(&attributes, list_entries); \
|
91
|
+
free(attribute); \
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Create the XML declaration in an XML file.
|
96
|
+
*
|
97
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
98
|
+
*/
|
99
|
+
void lxw_xml_declaration(FILE * xmlfile);
|
100
|
+
|
101
|
+
/**
|
102
|
+
* Write an XML start tag with optional attributes.
|
103
|
+
*
|
104
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
105
|
+
* @param tag The XML tag to write.
|
106
|
+
* @param attributes An optional list of attributes to add to the tag.
|
107
|
+
*/
|
108
|
+
void lxw_xml_start_tag(FILE * xmlfile,
|
109
|
+
const char *tag,
|
110
|
+
struct xml_attribute_list *attributes);
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Write an XML start tag with optional un-encoded attributes.
|
114
|
+
* This is a minor optimization for attributes that don't need encoding.
|
115
|
+
*
|
116
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
117
|
+
* @param tag The XML tag to write.
|
118
|
+
* @param attributes An optional list of attributes to add to the tag.
|
119
|
+
*/
|
120
|
+
void lxw_xml_start_tag_unencoded(FILE * xmlfile,
|
121
|
+
const char *tag,
|
122
|
+
struct xml_attribute_list *attributes);
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Write an XML end tag.
|
126
|
+
*
|
127
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
128
|
+
* @param tag The XML tag to write.
|
129
|
+
*/
|
130
|
+
void lxw_xml_end_tag(FILE * xmlfile, const char *tag);
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Write an XML empty tag with optional attributes.
|
134
|
+
*
|
135
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
136
|
+
* @param tag The XML tag to write.
|
137
|
+
* @param attributes An optional list of attributes to add to the tag.
|
138
|
+
*/
|
139
|
+
void lxw_xml_empty_tag(FILE * xmlfile,
|
140
|
+
const char *tag,
|
141
|
+
struct xml_attribute_list *attributes);
|
142
|
+
|
143
|
+
/**
|
144
|
+
* Write an XML empty tag with optional un-encoded attributes.
|
145
|
+
* This is a minor optimization for attributes that don't need encoding.
|
146
|
+
*
|
147
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
148
|
+
* @param tag The XML tag to write.
|
149
|
+
* @param attributes An optional list of attributes to add to the tag.
|
150
|
+
*/
|
151
|
+
void lxw_xml_empty_tag_unencoded(FILE * xmlfile,
|
152
|
+
const char *tag,
|
153
|
+
struct xml_attribute_list *attributes);
|
154
|
+
|
155
|
+
/**
|
156
|
+
* Write an XML element containing data and optional attributes.
|
157
|
+
*
|
158
|
+
* @param xmlfile A FILE pointer to the output XML file.
|
159
|
+
* @param tag The XML tag to write.
|
160
|
+
* @param data The data section of the XML element.
|
161
|
+
* @param attributes An optional list of attributes to add to the tag.
|
162
|
+
*/
|
163
|
+
void lxw_xml_data_element(FILE * xmlfile,
|
164
|
+
const char *tag,
|
165
|
+
const char *data,
|
166
|
+
struct xml_attribute_list *attributes);
|
167
|
+
|
168
|
+
char *lxw_escape_control_characters(const char *string);
|
169
|
+
|
170
|
+
char *lxw_escape_data(const char *data);
|
171
|
+
|
172
|
+
/* *INDENT-OFF* */
|
173
|
+
#ifdef __cplusplus
|
174
|
+
}
|
175
|
+
#endif
|
176
|
+
/* *INDENT-ON* */
|
177
|
+
|
178
|
+
#endif /* __XMLWRITER_H__ */
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/*
|
2
|
+
* libxlsxwriter
|
3
|
+
*
|
4
|
+
* Copyright 2014-2017, John McNamara, jmcnamara@cpan.org. See LICENSE.txt.
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @file xlsxwriter.h
|
9
|
+
*
|
10
|
+
* xlsxwriter - A library for creating Excel XLSX files.
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
#ifndef __LXW_XLSXWRITER_H__
|
14
|
+
#define __LXW_XLSXWRITER_H__
|
15
|
+
|
16
|
+
#include "xlsxwriter/workbook.h"
|
17
|
+
#include "xlsxwriter/worksheet.h"
|
18
|
+
#include "xlsxwriter/format.h"
|
19
|
+
#include "xlsxwriter/utility.h"
|
20
|
+
|
21
|
+
#define LXW_VERSION "0.6.9"
|
22
|
+
|
23
|
+
#endif /* __LXW_XLSXWRITER_H__ */
|
File without changes
|
@@ -0,0 +1,47 @@
|
|
1
|
+
Pod::Spec.new do |s|
|
2
|
+
s.name = "libxlsxwriter"
|
3
|
+
s.version = "0.6.9"
|
4
|
+
s.summary = "Libxlsxwriter: A C library for creating Excel XLSX files."
|
5
|
+
s.ios.deployment_target = "6.0"
|
6
|
+
s.osx.deployment_target = "10.8"
|
7
|
+
|
8
|
+
s.description = <<-DESC
|
9
|
+
Libxlsxwriter is a C library that can be used to write text, numbers, formulas and hyperlinks to multiple worksheets in an Excel 2007+ XLSX file.
|
10
|
+
|
11
|
+
It supports features such as:
|
12
|
+
|
13
|
+
* 100% compatible Excel XLSX files.
|
14
|
+
* Full Excel formatting.
|
15
|
+
* Merged cells.
|
16
|
+
* Defined names.
|
17
|
+
* Autofilters.
|
18
|
+
* Charts.
|
19
|
+
* Worksheet PNG/JPEG images.
|
20
|
+
* Memory optimisation mode for writing large files.
|
21
|
+
* Source code available on [GitHub](https://github.com/jmcnamara/libxlsxwriter).
|
22
|
+
* FreeBSD license.
|
23
|
+
* ANSI C.
|
24
|
+
* Works with GCC, Clang, Xcode, MSVC 2015, ICC, TCC, MinGW, MingGW-w64/32.
|
25
|
+
* Works on Linux, FreeBSD, OpenBSD, OS X, iOS and Windows. Also works on MSYS/MSYS2 and Cygwin.
|
26
|
+
* Compiles for 32 and 64 bit.
|
27
|
+
* The only dependency is on `zlib`.
|
28
|
+
DESC
|
29
|
+
|
30
|
+
s.homepage = "http://libxlsxwriter.github.io"
|
31
|
+
s.documentation_url = "http://libxlsxwriter.github.io"
|
32
|
+
s.license = "FreeBSD"
|
33
|
+
s.author = { "John McNamara" => "jmcnamara@cpan.org" }
|
34
|
+
|
35
|
+
s.source = { :git => "https://github.com/jmcnamara/libxlsxwriter.git", :tag => "RELEASE_" + s.version.to_s }
|
36
|
+
s.source_files = "src/**/*.c", "third_party/**/{zip.c,ioapi.c,tmpfileplus.c}", "include/**/*.h"
|
37
|
+
|
38
|
+
s.header_dir = "xlsxwriter"
|
39
|
+
s.header_mappings_dir = "include/xlsxwriter"
|
40
|
+
s.library = "z"
|
41
|
+
s.compiler_flags = "-DNOCRYPT=1", "-DNOUNCRYPT=1"
|
42
|
+
s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '${PODS_ROOT}/libxlsxwriter/include' }
|
43
|
+
s.module_map = "cocoapods/libxlsxwriter.modulemap"
|
44
|
+
s.prepare_command = <<-CMD
|
45
|
+
cp cocoapods/libxlsxwriter-umbrella.h include/xlsxwriter/libxlsxwriter-umbrella.h
|
46
|
+
CMD
|
47
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
###############################################################################
|
2
|
+
#
|
3
|
+
# Makefile for libxlsxwriter library.
|
4
|
+
#
|
5
|
+
# Copyright 2014-2017, John McNamara, jmcnamara@cpan.org
|
6
|
+
#
|
7
|
+
|
8
|
+
# Keep the output quiet by default.
|
9
|
+
Q=@
|
10
|
+
ifdef V
|
11
|
+
Q=
|
12
|
+
endif
|
13
|
+
|
14
|
+
# Directory variables.
|
15
|
+
OBJS_DIR = .
|
16
|
+
INC_DIR = ../include
|
17
|
+
|
18
|
+
# The minizip directory.
|
19
|
+
MINIZIP_DIR = ../third_party/minizip
|
20
|
+
|
21
|
+
|
22
|
+
ifdef USE_STANDARD_TMPFILE
|
23
|
+
# Use standard/C tmpfile().
|
24
|
+
CFLAGS += -DUSE_STANDARD_TMPFILE
|
25
|
+
else
|
26
|
+
# Use tmpfileplus (the default).
|
27
|
+
TMPFILEPLUS_DIR = ../third_party/tmpfileplus
|
28
|
+
TMPFILEPLUS_OBJ = $(TMPFILEPLUS_DIR)/tmpfileplus.o
|
29
|
+
TMPFILEPLUS_SO = $(TMPFILEPLUS_DIR)/tmpfileplus.so
|
30
|
+
endif
|
31
|
+
|
32
|
+
# Flags passed to compiler.
|
33
|
+
CFLAGS += -g -O3 -Wall -Wextra -pedantic -ansi
|
34
|
+
|
35
|
+
# Ignore icc remarks about inlining limits.
|
36
|
+
ifeq ($(CC),icc)
|
37
|
+
CFLAGS +=-diag-disable=11074,11076
|
38
|
+
endif
|
39
|
+
|
40
|
+
# Library names.
|
41
|
+
LIBXLSXWRITER_A = libxlsxwriter.a
|
42
|
+
LIBXLSXWRITER_SO = libxlsxwriter.so
|
43
|
+
|
44
|
+
# Library with additional non-static functions for testing.
|
45
|
+
LIBXLSXWRITER_TO = libxlsxwriter_test.a
|
46
|
+
|
47
|
+
# Flags passed to static linker.
|
48
|
+
ARFLAGS = rc
|
49
|
+
|
50
|
+
# Flags passed to dynamic linker.
|
51
|
+
FPIC = -fPIC
|
52
|
+
SOFLAGS = -shared $(FPIC)
|
53
|
+
|
54
|
+
# Get Env/OS name.
|
55
|
+
UNAME := $(shell uname)
|
56
|
+
|
57
|
+
# Change make options on OS X.
|
58
|
+
ifeq ($(UNAME), Darwin)
|
59
|
+
LIBXLSXWRITER_SO = libxlsxwriter.dylib
|
60
|
+
SOFLAGS = -dynamiclib $(FPIC) -install_name /usr/lib/$(LIBXLSXWRITER_SO)
|
61
|
+
endif
|
62
|
+
|
63
|
+
# Check for MinGW/MinGW64/Cygwin environments.
|
64
|
+
ifneq (,$(findstring MINGW, $(UNAME)))
|
65
|
+
MING_LIKE = y
|
66
|
+
endif
|
67
|
+
ifneq (,$(findstring MSYS, $(UNAME)))
|
68
|
+
MING_LIKE = y
|
69
|
+
endif
|
70
|
+
ifneq (,$(findstring CYGWIN, $(UNAME)))
|
71
|
+
MING_LIKE = y
|
72
|
+
endif
|
73
|
+
|
74
|
+
# Change make options on MinGW/MinGW64/Cygwin.
|
75
|
+
ifdef MING_LIKE
|
76
|
+
LIBXLSXWRITER_SO = libxlsxwriter.dll
|
77
|
+
FPIC =
|
78
|
+
CC = gcc
|
79
|
+
CFLAGS += -Wno-char-subscripts -Wno-long-long
|
80
|
+
endif
|
81
|
+
|
82
|
+
# Headers as dependecies.
|
83
|
+
HDRS = $(wildcard ../include/xlsxwriter/*.h)
|
84
|
+
|
85
|
+
# Ojects to compile.
|
86
|
+
SRCS = $(wildcard *.c)
|
87
|
+
OBJS = $(patsubst %.c,%.o,$(SRCS))
|
88
|
+
SOBJS = $(patsubst %.c,%.so,$(SRCS))
|
89
|
+
TOBJS = $(patsubst %.c,%.to,$(SRCS))
|
90
|
+
# End of OBJS
|
91
|
+
|
92
|
+
# Build the object files and the libraries.
|
93
|
+
all : $(LIBXLSXWRITER_A) $(LIBXLSXWRITER_SO)
|
94
|
+
$(Q)cp $(LIBXLSXWRITER_A) $(LIBXLSXWRITER_SO) ../lib
|
95
|
+
|
96
|
+
test_lib : libxlsxwriter_test.a
|
97
|
+
|
98
|
+
# The static library.
|
99
|
+
$(LIBXLSXWRITER_A) : $(OBJS)
|
100
|
+
$(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $(TMPFILEPLUS_OBJ) $^
|
101
|
+
|
102
|
+
# The dynamic library.
|
103
|
+
ifeq ($(findstring m32,$(CFLAGS)),m32)
|
104
|
+
ARCH = -m32
|
105
|
+
endif
|
106
|
+
|
107
|
+
$(LIBXLSXWRITER_SO) : $(SOBJS)
|
108
|
+
$(Q)$(CC) $(SOFLAGS) $(ARCH) -o $@ $(MINIZIP_DIR)/ioapi.so $(MINIZIP_DIR)/zip.so $(TMPFILEPLUS_SO) $^ -lz
|
109
|
+
|
110
|
+
# The test library.
|
111
|
+
$(LIBXLSXWRITER_TO) : $(TOBJS)
|
112
|
+
$(Q)$(AR) $(ARFLAGS) $@ $(MINIZIP_DIR)/ioapi.o $(MINIZIP_DIR)/zip.o $(TMPFILEPLUS_OBJ) $^
|
113
|
+
|
114
|
+
# Minimal target for quick compile without creating the libs.
|
115
|
+
test_compile : $(OBJS)
|
116
|
+
|
117
|
+
# Targets for the object files.
|
118
|
+
%.o : %.c $(HDRS)
|
119
|
+
$(Q)$(CC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $<
|
120
|
+
|
121
|
+
%.so : %.c $(HDRS)
|
122
|
+
$(Q)$(CC) $(FPIC) -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
|
123
|
+
|
124
|
+
%.to : %.c $(HDRS)
|
125
|
+
$(Q)$(CC) -g -O3 -DTESTING -I$(INC_DIR) $(CFLAGS) $(CXXFLAGS) -c $< -o $@
|
126
|
+
|
127
|
+
|
128
|
+
# Clean up any temp/build files.
|
129
|
+
clean :
|
130
|
+
$(Q)rm -f *.o *.a *.so *.to *.dylib *.dll
|