forked from WizardMac/ReadStat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
436 lines (368 loc) · 14 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
AUTOMAKE_OPTIONS = foreign dist-zip
lib_LTLIBRARIES = libreadstat.la
libreadstat_la_SOURCES = \
src/CKHashTable.c \
src/readstat_bits.c \
src/readstat_convert.c \
src/readstat_error.c \
src/readstat_io_unistd.c \
src/readstat_malloc.c \
src/readstat_metadata.c \
src/readstat_parser.c \
src/readstat_value.c \
src/readstat_variable.c \
src/readstat_writer.c \
src/sas/ieee.c \
src/sas/readstat_sas.c \
src/sas/readstat_sas7bcat_read.c \
src/sas/readstat_sas7bcat_write.c \
src/sas/readstat_sas7bdat_read.c \
src/sas/readstat_sas7bdat_write.c \
src/sas/readstat_sas_rle.c \
src/sas/readstat_xport.c \
src/sas/readstat_xport_read.c \
src/sas/readstat_xport_write.c \
src/sas/readstat_xport_parse_format.c \
src/spss/readstat_por.c \
src/spss/readstat_por_parse.c \
src/spss/readstat_por_read.c \
src/spss/readstat_por_write.c \
src/spss/readstat_sav.c \
src/spss/readstat_sav_compress.c \
src/spss/readstat_sav_parse.c \
src/spss/readstat_sav_parse_timestamp.c \
src/spss/readstat_sav_read.c \
src/spss/readstat_sav_write.c \
src/spss/readstat_spss.c \
src/spss/readstat_spss_parse.c \
src/stata/readstat_dta.c \
src/stata/readstat_dta_parse_timestamp.c \
src/stata/readstat_dta_read.c \
src/stata/readstat_dta_write.c \
src/txt/commands_util.c \
src/txt/readstat_copy.c \
src/txt/readstat_sas_commands_read.c \
src/txt/readstat_spss_commands_read.c \
src/txt/readstat_schema.c \
src/txt/readstat_stata_dictionary_read.c \
src/txt/readstat_txt_read.c
if HAVE_ZLIB
libreadstat_la_SOURCES += \
src/spss/readstat_zsav_compress.c \
src/spss/readstat_zsav_read.c \
src/spss/readstat_zsav_write.c
endif
if HAVE_RAGEL
.rl.c:
$(AM_V_GEN)$(RAGEL) $(RAGELFLAGS) $< -o $@
endif
libreadstat_la_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99
libreadstat_la_LIBADD = @EXTRA_LIBS@
libreadstat_la_LDFLAGS = @EXTRA_LDFLAGS@ -version-info @READSTAT_VERSION_INFO@
if HAVE_ZLIB
libreadstat_la_LIBADD += -lz
libreadstat_la_CFLAGS += -DHAVE_ZLIB=1
endif
if CODE_COVERAGE_ENABLED
libreadstat_la_CFLAGS += -O0 -fprofile-arcs -ftest-coverage
endif
if FUZZER_ENABLED
libreadstat_la_CFLAGS += -fsanitize=fuzzer-no-link
libreadstat_la_LDFLAGS += -fsanitize=fuzzer
endif
dist_man1_MANS = man/readstat.man man/extract_metadata.man
include_HEADERS = src/readstat.h
noinst_HEADERS = \
src/CKHashTable.h \
src/readstat_bits.h \
src/readstat_convert.h \
src/readstat_iconv.h \
src/readstat_io_unistd.h \
src/readstat_malloc.h \
src/readstat_strings.h \
src/readstat_writer.h \
src/sas/ieee.h \
src/sas/readstat_sas.h \
src/sas/readstat_sas_rle.h \
src/sas/readstat_xport.h \
src/sas/readstat_xport_parse_format.h \
src/spss/readstat_por.h \
src/spss/readstat_por_parse.h \
src/spss/readstat_sav.h \
src/spss/readstat_sav_compress.h \
src/spss/readstat_sav_parse.h \
src/spss/readstat_sav_parse_timestamp.h \
src/spss/readstat_spss.h \
src/spss/readstat_spss_parse.h \
src/spss/readstat_zsav_compress.h \
src/spss/readstat_zsav_read.h \
src/spss/readstat_zsav_write.h \
src/stata/readstat_dta.h \
src/stata/readstat_dta_parse_timestamp.h \
src/txt/commands_util.h \
src/txt/readstat_copy.h \
src/txt/readstat_schema.h \
src/bin/extract_metadata.h \
src/bin/read_csv/csv_metadata.h \
src/bin/read_csv/jsmn.h \
src/bin/read_csv/json_metadata.h \
src/bin/read_csv/mod_csv.h \
src/bin/read_csv/mod_dta.h \
src/bin/read_csv/mod_sav.h \
src/bin/read_csv/read_csv.h \
src/bin/read_csv/read_module.h \
src/bin/read_csv/value.h \
src/bin/write/double_decimals.h \
src/bin/write/json/write_missing_values.h \
src/bin/write/json/write_value_labels.h \
src/bin/write/mod_csv.h \
src/bin/write/mod_readstat.h \
src/bin/write/mod_xlsx.h \
src/bin/write/module.h \
src/bin/write/module_util.h \
src/bin/util/main.h \
src/bin/util/file_format.h \
src/bin/util/quote_and_escape.h \
src/bin/util/readstat_dta_days.h \
src/bin/util/readstat_sav_date.h \
src/fuzz/fuzz_format.h \
src/test/test_buffer.h \
src/test/test_buffer_io.h \
src/test/test_dta.h \
src/test/test_error.h \
src/test/test_list.h \
src/test/test_read.h \
src/test/test_readstat.h \
src/test/test_sas.h \
src/test/test_sav.h \
src/test/test_types.h \
src/test/test_write.h
bin_PROGRAMS = \
extract_metadata \
readstat
readstat_SOURCES = \
src/bin/readstat.c \
src/bin/read_csv/jsmn.c \
src/bin/read_csv/json_metadata.c \
src/bin/read_csv/mod_csv.c \
src/bin/read_csv/mod_dta.c \
src/bin/read_csv/mod_sav.c \
src/bin/read_csv/value.c \
src/bin/write/double_decimals.c \
src/bin/write/mod_csv.c \
src/bin/write/mod_readstat.c \
src/bin/write/module_util.c \
src/bin/util/file_format.c \
src/bin/util/quote_and_escape.c \
src/bin/util/readstat_dta_days.c \
src/bin/util/readstat_sav_date.c
readstat_LDADD = libreadstat.la
readstat_CFLAGS = -DREADSTAT_VERSION=\"@READSTAT_VERSION@\" -Wall -Werror -pedantic-errors -std=c99
if HAVE_ZLIB
readstat_CFLAGS += -DHAVE_ZLIB=1
endif
extract_metadata_SOURCES = \
src/bin/extract_metadata.c \
src/bin/write/json/write_missing_values.c \
src/bin/write/json/write_value_labels.c \
src/bin/util/file_format.c \
src/bin/util/quote_and_escape.c \
src/bin/util/readstat_dta_days.c \
src/bin/util/readstat_sav_date.c
extract_metadata_LDADD = libreadstat.la
extract_metadata_CFLAGS = -Wall -Werror -pedantic-errors -std=c99
if HAVE_XLSXWRITER
readstat_SOURCES += src/bin/write/mod_xlsx.c
readstat_LDADD += -lxlsxwriter
readstat_CFLAGS += -DHAVE_XLSXWRITER=1
endif
if HAVE_CSVREADER
readstat_SOURCES += src/bin/read_csv/read_csv.c
readstat_LDADD += -lcsv
readstat_CFLAGS += -DHAVE_CSVREADER=1
endif
check_PROGRAMS = \
test_readstat \
test_dta_days \
test_sav_date \
test_double_decimals
test_readstat_SOURCES = \
src/test/test_buffer.c \
src/test/test_buffer_io.c \
src/test/test_dta.c \
src/test/test_error.c \
src/test/test_read.c \
src/test/test_readstat.c \
src/test/test_sas.c \
src/test/test_sav.c \
src/test/test_write.c
test_readstat_LDADD = libreadstat.la
test_readstat_CFLAGS = -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 -DDEBUG=1
test_dta_days_SOURCES = \
src/bin/util/readstat_dta_days.c \
src/test/test_dta_days.c
test_dta_days_LDADD = libreadstat.la
test_dta_days_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99
test_sav_date_SOURCES = \
src/bin/util/readstat_sav_date.c \
src/test/test_sav_date.c
test_sav_date_LDADD = libreadstat.la
test_sav_date_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99
test_double_decimals_SOURCES = \
src/bin/write/double_decimals.c \
src/test/test_double_decimals.c
test_double_decimals_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99
TESTS = test_readstat test_dta_days test_sav_date test_double_decimals
EXTRA_PROGRAMS = \
generate_corpus
generate_corpus_SOURCES = \
src/fuzz/generate_corpus.c \
src/test/test_buffer.c \
src/test/test_write.c \
src/test/test_read.c \
src/test/test_buffer_io.c \
src/test/test_error.c \
src/test/test_dta.c \
src/test/test_sas.c \
src/test/test_sav.c
generate_corpus_LDADD = libreadstat.la
generate_corpus_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99
EXTRA_PROGRAMS += \
fuzz_compression_sas_rle \
fuzz_compression_sav \
fuzz_format_dta \
fuzz_format_por \
fuzz_format_sav \
fuzz_format_sas7bcat \
fuzz_format_sas7bdat \
fuzz_format_xport \
fuzz_format_sas_commands \
fuzz_format_spss_commands \
fuzz_format_stata_dictionary \
fuzz_grammar_dta_timestamp \
fuzz_grammar_por_double \
fuzz_grammar_sav_date \
fuzz_grammar_sav_time \
fuzz_grammar_spss_format \
fuzz_grammar_xport_format
# Force C++ linking for fuzz targets
nodist_EXTRA_fuzz_compression_sas_rle_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_compression_sav_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_dta_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_por_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_sav_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_sas7bcat_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_sas7bdat_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_xport_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_sas_commands_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_spss_commands_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_format_stata_dictionary_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_dta_timestamp_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_por_double_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_sav_date_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_sav_time_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_spss_format_SOURCES = dummy.cxx
nodist_EXTRA_fuzz_grammar_xport_format_SOURCES = dummy.cxx
fuzz_grammar_dta_timestamp_SOURCES = \
src/fuzz/fuzz_grammar_dta_timestamp.c
fuzz_grammar_dta_timestamp_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_dta_timestamp_LDFLAGS = -static
fuzz_grammar_dta_timestamp_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_grammar_por_double_SOURCES = \
src/fuzz/fuzz_grammar_por_double.c
fuzz_grammar_por_double_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_por_double_LDFLAGS = -static
fuzz_grammar_por_double_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_grammar_sav_date_SOURCES = \
src/fuzz/fuzz_grammar_sav_date.c
fuzz_grammar_sav_date_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_sav_date_LDFLAGS = -static
fuzz_grammar_sav_date_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_grammar_sav_time_SOURCES = \
src/fuzz/fuzz_grammar_sav_time.c
fuzz_grammar_sav_time_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_sav_time_LDFLAGS = -static
fuzz_grammar_sav_time_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_grammar_spss_format_SOURCES = \
src/fuzz/fuzz_grammar_spss_format.c
fuzz_grammar_spss_format_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_spss_format_LDFLAGS = -static
fuzz_grammar_spss_format_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_grammar_xport_format_SOURCES = \
src/fuzz/fuzz_grammar_xport_format.c
fuzz_grammar_xport_format_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_grammar_xport_format_LDFLAGS = -static
fuzz_grammar_xport_format_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_dta_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_dta.c \
src/test/test_buffer_io.c
fuzz_format_dta_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_dta_LDFLAGS = -static
fuzz_format_dta_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_por_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_por.c \
src/test/test_buffer_io.c
fuzz_format_por_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_por_LDFLAGS = -static
fuzz_format_por_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_sas7bcat_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_sas7bcat.c \
src/test/test_buffer_io.c
fuzz_format_sas7bcat_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_sas7bcat_LDFLAGS = -static
fuzz_format_sas7bcat_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_sas7bdat_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_sas7bdat.c \
src/test/test_buffer_io.c
fuzz_format_sas7bdat_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_sas7bdat_LDFLAGS = -static
fuzz_format_sas7bdat_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_sav_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_sav.c \
src/test/test_buffer_io.c
fuzz_format_sav_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_sav_LDFLAGS = -static
fuzz_format_sav_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_xport_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_xport.c \
src/test/test_buffer_io.c
fuzz_format_xport_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_xport_LDFLAGS = -static
fuzz_format_xport_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_sas_commands_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_sas_commands.c \
src/test/test_buffer_io.c
fuzz_format_sas_commands_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_sas_commands_LDFLAGS = -static
fuzz_format_sas_commands_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_spss_commands_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_spss_commands.c \
src/test/test_buffer_io.c
fuzz_format_spss_commands_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_spss_commands_LDFLAGS = -static
fuzz_format_spss_commands_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_format_stata_dictionary_SOURCES = \
src/fuzz/fuzz_format.c \
src/fuzz/fuzz_format_stata_dictionary.c \
src/test/test_buffer_io.c
fuzz_format_stata_dictionary_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_format_stata_dictionary_LDFLAGS = -static
fuzz_format_stata_dictionary_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_compression_sas_rle_SOURCES = \
src/fuzz/fuzz_compression_sas_rle.c
fuzz_compression_sas_rle_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_compression_sas_rle_LDFLAGS = -static
fuzz_compression_sas_rle_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@
fuzz_compression_sav_SOURCES = \
src/fuzz/fuzz_compression_sav.c
fuzz_compression_sav_LDADD = libreadstat.la @LIB_FUZZING_ENGINE@
fuzz_compression_sav_LDFLAGS = -static
fuzz_compression_sav_CFLAGS = -g -Wall @EXTRA_WARNINGS@ -Werror -pedantic-errors -std=c99 @SANITIZERS@