forked from skvadrik/re2c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.am
626 lines (579 loc) · 17 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
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
SUBDIRS = .
# stdlib directory
stdlibdir = $(datadir)/re2c/stdlib
# do not add compiler options/warnings here, add them in configure.ac
AM_CXXFLAGS = $(CXXFLAGSDEFAULT)
AM_CXXFLAGS += -DRE2C_STDLIB_DIR='"$(stdlibdir)/"'
if DEBUG
AM_CXXFLAGS += -DRE2C_DEBUG
endif
RE2CFLAGS = -b -W -Wno-match-empty-string --no-generation-date
# binary
bin_PROGRAMS = re2c
noinst_PROGRAMS =
# sources
re2c_HDR = \
src/constants.h \
src/codegen/code.h \
src/codegen/output.h \
src/codegen/helpers.h \
src/options/opt.h \
src/options/symtab.h \
src/adfa/adfa.h \
src/cfg/cfg.h \
src/dfa/closure_leftmost.h \
src/dfa/closure_posix.h \
src/dfa/determinization.h \
src/dfa/dfa.h \
src/dfa/posix_precedence.h \
src/dfa/tag_history.h \
src/dfa/tagver_table.h \
src/dfa/tcmd.h \
src/nfa/nfa.h \
src/encoding/ebcdic.h \
src/encoding/enc.h \
src/encoding/range_suffix.h \
src/encoding/utf8.h \
src/encoding/utf16.h \
src/msg/location.h \
src/msg/msg.h \
src/msg/ver_to_vernum.h \
src/msg/warn.h \
src/regexp/regexp.h \
src/regexp/rule.h \
src/regexp/tag.h \
src/skeleton/mtag_trie.h \
src/skeleton/path.h \
src/skeleton/skeleton.h \
src/parse/ast.h \
src/parse/input.h \
src/debug/debug.h \
src/util/allocator.h \
src/util/attribute.h \
src/util/containers.h \
src/util/check.h \
src/util/file_utils.h \
src/util/forbid_copy.h \
src/util/hash32.h \
src/util/nowarn_in_bison.h \
src/util/range.h \
src/util/string_utils.h \
src/util/u32lim.h
re2c_SRC = \
src/codegen/helpers.cc \
src/codegen/output.cc \
src/codegen/pass1_analyze.cc \
src/codegen/pass2_generate.cc \
src/codegen/pass3_fixup.cc \
src/codegen/pass4_render.cc \
src/options/opt.cc \
src/options/symtab.cc \
src/nfa/re_to_nfa.cc \
src/adfa/adfa.cc \
src/debug/dump_adfa.cc \
src/debug/dump_cfg.cc \
src/debug/dump_dfa.cc \
src/debug/dump_dfa_tree.cc \
src/debug/dump_interf.cc \
src/debug/dump_nfa.cc \
src/cfg/cfg.cc \
src/cfg/compact.cc \
src/cfg/dce.cc \
src/cfg/freeze.cc \
src/cfg/interfere.cc \
src/cfg/liveanal.cc \
src/cfg/normalize.cc \
src/cfg/optimize.cc \
src/cfg/rename.cc \
src/cfg/varalloc.cc \
src/dfa/closure.cc \
src/dfa/dead_rules.cc \
src/dfa/determinization.cc \
src/dfa/fallback_tags.cc \
src/dfa/fillpoints.cc \
src/dfa/find_state.cc \
src/dfa/minimization.cc \
src/dfa/tagver_table.cc \
src/dfa/tcmd.cc \
src/encoding/ebcdic.cc \
src/encoding/enc.cc \
src/encoding/range_suffix.cc \
src/encoding/utf8.cc \
src/encoding/utf16.cc \
src/msg/msg.cc \
src/msg/warn.cc \
src/regexp/ast_to_re.cc \
src/regexp/default_tags.cc \
src/regexp/fixed_tags.cc \
src/regexp/nullable.cc \
src/regexp/regexp.cc \
src/regexp/split_charset.cc \
src/skeleton/control_flow.cc \
src/skeleton/generate_code.cc \
src/skeleton/generate_data.cc \
src/skeleton/maxpath.cc \
src/skeleton/skeleton.cc \
src/parse/ast.cc \
src/parse/input.cc \
src/util/file_utils.cc \
src/util/string_utils.cc \
src/util/range.cc
re2c_SOURCES = \
src/main.cc \
$(re2c_HDR) \
$(re2c_SRC)
# autogenerated sources
re2c_GEN_HELP = src/msg/help.cc
re2c_GEN_SRC = \
$(re2c_GEN_HELP) \
src/msg/ver_to_vernum.cc \
src/options/parse_opts.cc \
src/parse/lexer.cc \
src/parse/parser.cc \
src/parse/conf_lexer.cc \
src/parse/conf_parser.cc \
src/default_syntax_c.cc \
src/default_syntax_d.cc \
src/default_syntax_go.cc \
src/default_syntax_haskell.cc \
src/default_syntax_java.cc \
src/default_syntax_js.cc \
src/default_syntax_ocaml.cc \
src/default_syntax_python.cc \
src/default_syntax_rust.cc \
src/default_syntax_v.cc \
src/default_syntax_zig.cc
re2c_GEN_HDR = \
src/options/parser.h \
src/options/conf_parser.h \
src/options/syntax_parser.h \
src/parse/lex.h
re2c_GEN = \
$(re2c_GEN_SRC) \
$(re2c_GEN_HDR)
nodist_re2c_SOURCES = $(re2c_GEN)
# custom rules create headers and must go before normal rules
BUILT_SOURCES = $(re2c_GEN_SRC)
# bootstrap sources
re2c_BOOT_DOC_C = bootstrap/doc/re2c.1
re2c_BOOT_DOC_GO = bootstrap/doc/re2go.1
re2c_BOOT_DOC_RUST = bootstrap/doc/re2rust.1
re2c_BOOT_HELP = bootstrap/src/msg/help.cc
re2c_BOOT = \
$(re2c_BOOT_DOC_C) \
$(re2c_BOOT_DOC_GO) \
$(re2c_BOOT_DOC_RUST) \
$(re2c_BOOT_HELP) \
bootstrap/src/msg/ver_to_vernum.cc \
bootstrap/src/options/parse_opts.cc \
bootstrap/src/parse/lexer.cc \
bootstrap/src/parse/lexer.h \
bootstrap/src/parse/parser.cc \
bootstrap/src/parse/parser.h \
bootstrap/src/parse/conf_lexer.cc \
bootstrap/src/parse/conf_parser.h \
bootstrap/src/parse/conf_parser.cc \
bootstrap/src/default_syntax_c.cc \
bootstrap/src/default_syntax_d.cc \
bootstrap/src/default_syntax_go.cc \
bootstrap/src/default_syntax_haskell.cc \
bootstrap/src/default_syntax_java.cc \
bootstrap/src/default_syntax_js.cc \
bootstrap/src/default_syntax_ocaml.cc \
bootstrap/src/default_syntax_python.cc \
bootstrap/src/default_syntax_rust.cc \
bootstrap/src/default_syntax_v.cc \
bootstrap/src/default_syntax_zig.cc
# custom sources
re2c_CUSTOM_HELP = doc/help.rst
re2c_CUSTOM = \
$(re2c_CUSTOM_HELP) \
src/msg/ver_to_vernum.re \
src/options/parse_opts.re \
src/parse/lexer.re \
src/parse/parser.ypp \
src/parse/conf_lexer.re \
src/parse/conf_parser.ypp
# docs
re2c_SRC_DOC = doc/manpage.rst
re2c_SRC_DOC_EXT = \
doc/manual/api/interface.rst_ \
doc/manual/conditions/blocks.rst_ \
doc/manual/conditions/conditions.rst_ \
doc/manual/configurations/configurations.rst_ \
doc/manual/directives/directives.rst_ \
doc/manual/dot/dot.rst_ \
doc/manual/encodings/encodings.rst_ \
doc/manual/eof/01_sentinel.rst_ \
doc/manual/eof/02_bounds_checking.rst_ \
doc/manual/eof/03_eof_rule.rst_ \
doc/manual/eof/04_generic_api.rst_ \
doc/manual/eof/eof.rst_ \
doc/manual/fill/01_fill.rst_ \
doc/manual/fill/02_fill.rst_ \
doc/manual/fill/fill.rst_ \
doc/manual/headers/headers.rst_ \
doc/manual/includes/includes.rst_ \
doc/manual/options/debug.rst_ \
doc/manual/options/internal.rst_ \
doc/manual/options/options.rst_ \
doc/manual/regexps/regular_expressions.rst_ \
doc/manual/reuse/reuse.rst_ \
doc/manual/skeleton/skeleton.rst_ \
doc/manual/state/state.rst_ \
doc/manual/submatch/submatch_example_mtags.rst_ \
doc/manual/submatch/submatch_example_posix.rst_ \
doc/manual/submatch/submatch_example_stags_fill.rst_ \
doc/manual/submatch/submatch_example_stags.rst_ \
doc/manual/submatch/submatch.rst_ \
doc/manual/synopsis.rst_ \
doc/manual/syntax/api1.rst_ \
doc/manual/syntax/api2_c.rst_ \
doc/manual/syntax/api2_go.rst_ \
doc/manual/syntax/api2_rust.rst_ \
doc/manual/syntax/api3.rst_ \
doc/manual/syntax/intro.rst_ \
doc/manual/syntax/syntax.rst_ \
doc/manual/warnings/warnings_general.rst_ \
doc/manual/warnings/warnings_list.rst_ \
examples/c/01_basic.re \
examples/c/01_basic.c \
examples/c/conditions/parse_u32_blocks.re \
examples/c/conditions/parse_u32_conditions.re \
examples/c/encodings/unicode_identifier.re \
examples/c/eof/01_sentinel.re \
examples/c/eof/02_bounds_checking.re \
examples/c/eof/03_eof_rule.re \
examples/c/eof/04_fake_sentinel.re \
examples/c/fill/01_fill.re \
examples/c/fill/02_fill.re \
examples/c/headers/header.re \
examples/c/headers/lexer/state.h \
examples/c/includes/include.re \
examples/c/includes/definitions.h \
examples/c/reuse/reuse.re \
examples/c/reuse/usedir.re \
examples/c/state/push.re \
examples/c/submatch/01_stags_fill.re \
examples/c/submatch/01_stags.re \
examples/c/submatch/02_mtags.re \
examples/c/submatch/03_captures.re \
examples/c/submatch/04_posix_captures.re \
examples/go/01_basic.re \
examples/go/01_basic.go \
examples/go/conditions/parse_u32_blocks.re \
examples/go/conditions/parse_u32_conditions.re \
examples/go/encodings/unicode_identifier.re \
examples/go/eof/01_sentinel.re \
examples/go/eof/02_bounds_checking.re \
examples/go/eof/03_eof_rule.re \
examples/go/eof/04_fake_sentinel.re \
examples/go/fill/01_fill.re \
examples/go/fill/02_fill.re \
examples/go/headers/header.re \
examples/go/headers/lexer/state.go \
examples/go/includes/include.re \
examples/go/includes/definitions.go \
examples/go/reuse/reuse.re \
examples/go/reuse/usedir.re \
examples/go/state/push.re \
examples/go/submatch/01_stags_fill.re \
examples/go/submatch/01_stags.re \
examples/go/submatch/02_mtags.re \
examples/go/submatch/03_captures.re \
examples/go/submatch/04_posix_captures.re \
examples/rust/01_basic.re \
examples/rust/01_basic.rs \
examples/rust/conditions/parse_u32_blocks.re \
examples/rust/conditions/parse_u32_conditions.re \
examples/rust/encodings/unicode_identifier.re \
examples/rust/eof/01_sentinel.re \
examples/rust/eof/02_bounds_checking.re \
examples/rust/eof/03_eof_rule.re \
examples/rust/eof/04_fake_sentinel.re \
examples/rust/fill/01_fill.re \
examples/rust/fill/02_fill.re \
examples/rust/headers/header.re \
examples/rust/headers/lexer/state.rs \
examples/rust/includes/include.re \
examples/rust/includes/definitions.rs \
examples/rust/reuse/reuse.re \
examples/rust/reuse/usedir.re \
examples/rust/state/push.re \
examples/rust/submatch/01_stags_fill.re \
examples/rust/submatch/01_stags.re \
examples/rust/submatch/02_mtags.re \
examples/rust/submatch/03_captures.re \
examples/rust/submatch/04_posix_captures.re
DOC_C = doc/re2c.1
DOCS = $(DOC_C)
if WITH_GOLANG
DOC_GO = doc/re2go.1
DOCS += $(DOC_GO)
endif
if WITH_RUST
DOC_RUST = doc/re2rust.1
DOCS += $(DOC_RUST)
endif
man_MANS = $(DOCS)
# include files (stdlib)
dist_stdlib_DATA = \
include/syntax/c \
include/syntax/d \
include/syntax/go \
include/syntax/haskell \
include/syntax/java \
include/syntax/js \
include/syntax/ocaml \
include/syntax/python \
include/syntax/rust \
include/syntax/v \
include/syntax/zig \
include/unicode_categories.re
BAZELFILES := \
BUILD.bazel \
WORKSPACE \
bazel
CMAKEFILES := \
CMakeLists.txt \
CMakePresets.json \
cmake
EXTRA_DIST = \
$(re2c_BOOT) \
$(re2c_CUSTOM) \
$(re2c_SRC_DOC_EXT) \
$(BAZELFILES) \
$(CMAKEFILES) \
BUILD.md \
CHANGELOG \
CONTRIBUTING.md \
IDEAS.md \
LICENSE \
MAINTAINERS.md \
NO_WARRANTY \
README.md \
autogen.sh \
build \
examples \
test
CLEANFILES = \
$(re2c_GEN) \
$(DOCS)
if REBUILD_SYNTAX
STX2CPP = $(top_srcdir)/build/stx2cpp.py
# generate C++ sources from syntax configs and update bootstrap files
src/default_syntax_%.cc : $(top_srcdir)/include/syntax/% $(STX2CPP)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(STX2CPP) $< $@
$(AM_V_GEN)cp -f $@ $(top_srcdir)/bootstrap/$@
else
# copy bootstrap files
src/default_syntax_%.cc : bootstrap/src/default_syntax_%.cc
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/bootstrap/$@ $(@D)
$(AM_V_at)echo "Reconfigure with --enable-syntax to regenerate $@"
endif
if REBUILD_LEXERS
# generate lexer and update bootstrap files
.re.cc:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(RE2C_FOR_BUILD) $(RE2CFLAGS) -o $@ $<
$(AM_V_GEN)cp $(@:cc=[ch]*) $(top_srcdir)/bootstrap/$(@D)
else
# copy bootstrap files
.re.cc:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/bootstrap/$(@:cc=*) $(@D)
$(AM_V_at)echo "Reconfigure with --enable-lexers to regenerate $@"
endif
if REBUILD_PARSERS
# generate lexer and update bootstrap files
.ypp.cc:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(BISON) --warnings --output=$@ --defines=$(@:cc=h) $<
$(AM_V_GEN)cp $@ $(@:cc=h) $(top_srcdir)/bootstrap/$(@D)
else
# copy bootstrap files
.ypp.cc:
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/bootstrap/$(@:cc=*) $(@D)
$(AM_V_at)echo "Reconfigure with --enable-parsers to regenerate $@"
endif
# re2c-generated lexer depends on bison-generated parser header (generated by the parser rule)
src/parse/lexer.cc : src/parse/parser.cc
src/parse/conf_lexer.cc : src/parse/conf_parser.cc
# rebuild all re2c sources using newly built re2c
.PHONY: bootstrap
bootstrap: all
rm $(re2c_GEN)
$(MAKE) all
.PHONY: docs
if REBUILD_DOCS
docs: $(DOCS) $(re2c_GEN_HELP)
RST2TXT = $(top_srcdir)/build/rst2txt.py
RST2MAN = $(top_srcdir)/build/rst2man.py
SPLITMAN = $(top_srcdir)/build/split_man.py
# generate manpage for C
$(DOC_C): $(re2c_SRC_DOC) $(re2c_SRC_DOC_EXT) $(SPLITMAN) $(RST2MAN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(SPLITMAN) $(top_builddir)/$(re2c_SRC_DOC) $(top_builddir)/$(re2c_SRC_DOC).c c \
&& $(PYTHON) $(RST2MAN) --tab-width=4 $(top_builddir)/$(re2c_SRC_DOC).c > $@ \
&& cp $@ $(top_srcdir)/$(re2c_BOOT_DOC_C) \
&& rm $(top_builddir)/$(re2c_SRC_DOC).c
# generate manpage for Go
$(DOC_GO): $(re2c_SRC_DOC) $(re2c_SRC_DOC_EXT) $(SPLITMAN) $(RST2MAN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(SPLITMAN) $(top_builddir)/$(re2c_SRC_DOC) $(top_builddir)/$(re2c_SRC_DOC).go go \
&& $(PYTHON) $(RST2MAN) --tab-width=4 $(top_builddir)/$(re2c_SRC_DOC).go > $@ \
&& cp $@ $(top_srcdir)/$(re2c_BOOT_DOC_GO) \
&& rm $(top_builddir)/$(re2c_SRC_DOC).go
# generate manpage for Rust
$(DOC_RUST): $(re2c_SRC_DOC) $(re2c_SRC_DOC_EXT) $(SPLITMAN) $(RST2MAN)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(SPLITMAN) $(top_builddir)/$(re2c_SRC_DOC) $(top_builddir)/$(re2c_SRC_DOC).rust rust \
&& $(PYTHON) $(RST2MAN) --tab-width=4 $(top_builddir)/$(re2c_SRC_DOC).rust > $@ \
&& cp $@ $(top_srcdir)/$(re2c_BOOT_DOC_RUST) \
&& rm $(top_builddir)/$(re2c_SRC_DOC).rust
# generate help
$(re2c_GEN_HELP): $(re2c_CUSTOM_HELP) $(re2c_SRC_DOC_EXT) $(RST2TXT)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)$(PYTHON) $(RST2TXT) --variable-name=help $(top_builddir)/$(re2c_CUSTOM_HELP) $@ \
&& cp $@ $(top_srcdir)/$(re2c_BOOT_HELP)
else
docs: $(DOCS) $(re2c_GEN_HELP)
$(AM_V_at)echo "Reconfigure with --enable-docs to rebuild docs"
# copy bootstrap manpage for C
$(DOC_C): $(re2c_BOOT_DOC_C)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/$(re2c_BOOT_DOC_C) $@
# copy bootstrap manpage for Go
$(DOC_GO): $(re2c_BOOT_DOC_GO)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/$(re2c_BOOT_DOC_GO) $@
# copy bootstrap manpage for Rust
$(DOC_RUST): $(re2c_BOOT_DOC_RUST)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/$(re2c_BOOT_DOC_RUST) $@
# copy bootstrap help
$(re2c_GEN_HELP): $(re2c_BOOT_HELP)
$(AM_V_at)$(MKDIR_P) $(@D)
$(AM_V_GEN)cp $(top_srcdir)/$(re2c_BOOT_HELP) $@
endif
all-local: docs $(re2c_BOOT_PARSER)
# tests
re2c_TESTSUITE = run_tests.py
.PHONY: tests
tests: all $(re2c_TESTSUITE)
$(PYTHON) $(top_builddir)/$(re2c_TESTSUITE)
.PHONY: vtests
vtests: all $(re2c_TESTSUITE)
$(PYTHON) $(top_builddir)/$(re2c_TESTSUITE) --valgrind
.PHONY: wtests
wtests: all $(re2c_TESTSUITE)
$(PYTHON) $(top_builddir)/$(re2c_TESTSUITE) --wine -j1
re2c_test_list_SOURCES = \
src/test/list/test.cc
re2c_test_range_SOURCES = \
src/test/range/test-impl.h \
src/test/range/test.cc \
src/test/range/test.h \
src/util/range.cc \
src/util/range.h
re2c_test_s_to_n32_unsafe_SOURCES = \
src/test/s_to_n32_unsafe/test.cc \
src/util/string_utils.cc
re2c_test_ver_to_vernum_SOURCES = \
src/test/ver_to_vernum/test.cc \
src/msg/ver_to_vernum.cc
re2c_test_argsubst_SOURCES = \
src/test/argsubst/test.cc
check_PROGRAMS = \
re2c_test_list \
re2c_test_range \
re2c_test_s_to_n32_unsafe \
re2c_test_ver_to_vernum \
re2c_test_argsubst
TESTS = \
$(re2c_TESTSUITE) \
$(check_PROGRAMS)
# benchmarks
if WITH_BENCHMARKS
SUBDIRS += benchmarks/submatch_dfa_aot
EXTRA_DIST += benchmarks/submatch_dfa_aot
endif
# libre2c
if WITH_LIBS
ACLOCAL_AMFLAGS = -I m4
lib_LTLIBRARIES =
include $(top_srcdir)/Makefile.lib.am
endif
# re2d
if WITH_DLANG
bin_PROGRAMS += re2d
re2d_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::D -DRE2C_PROG=\"re2d\"
re2d_SOURCES = $(re2c_SOURCES)
nodist_re2d_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2go
if WITH_GOLANG
bin_PROGRAMS += re2go
re2go_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::GO -DRE2C_PROG=\"re2go\"
re2go_SOURCES = $(re2c_SOURCES)
nodist_re2go_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2hs
if WITH_HASKELL
bin_PROGRAMS += re2hs
re2hs_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::HASKELL -DRE2C_PROG=\"re2hs\"
re2hs_SOURCES = $(re2c_SOURCES)
nodist_re2hs_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2java
if WITH_JAVA
bin_PROGRAMS += re2java
re2java_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::JAVA -DRE2C_PROG=\"re2java\"
re2java_SOURCES = $(re2c_SOURCES)
nodist_re2java_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2js
if WITH_JS
bin_PROGRAMS += re2js
re2js_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::JS -DRE2C_PROG=\"re2js\"
re2js_SOURCES = $(re2c_SOURCES)
nodist_re2js_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2ocaml
if WITH_OCAML
bin_PROGRAMS += re2ocaml
re2ocaml_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::OCAML -DRE2C_PROG=\"re2ocaml\"
re2ocaml_SOURCES = $(re2c_SOURCES)
nodist_re2ocaml_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2py
if WITH_PYTHON
bin_PROGRAMS += re2py
re2py_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::PYTHON -DRE2C_PROG=\"re2py\"
re2py_SOURCES = $(re2c_SOURCES)
nodist_re2py_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2rust
if WITH_RUST
bin_PROGRAMS += re2rust
re2rust_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::RUST -DRE2C_PROG=\"re2rust\"
re2rust_SOURCES = $(re2c_SOURCES)
nodist_re2rust_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2v
if WITH_VLANG
bin_PROGRAMS += re2v
re2v_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::V -DRE2C_PROG=\"re2v\"
re2v_SOURCES = $(re2c_SOURCES)
nodist_re2v_SOURCES = $(nodist_re2c_SOURCES)
endif
# re2zig
if WITH_ZIG
bin_PROGRAMS += re2zig
re2zig_CXXFLAGS = $(AM_CXXFLAGS) -DRE2C_LANG=Lang::ZIG -DRE2C_PROG=\"re2zig\"
re2zig_SOURCES = $(re2c_SOURCES)
nodist_re2zig_SOURCES = $(nodist_re2c_SOURCES)
endif