# flags # do *not* add CXXFLAGS here, add them in configure.ac AM_CXXFLAGS = $(CXXFLAGSDEFAULT) RE2CFLAGS = -b # binary bin_PROGRAMS = re2c RE2C = re2c$(EXEEXT) # sources SRC_HDR = \ src/code/bitmap.h \ src/code/emit.h \ src/code/go.h \ src/code/input_api.h \ src/code/label.h \ src/code/output.h \ src/code/print.h \ src/conf/msg.h \ src/conf/opt.h \ src/conf/ver_to_vernum.h \ src/conf/warn.h \ src/adfa/action.h \ src/adfa/adfa.h \ src/adfa/dump.h \ src/dfa/cfg/cfg.h \ src/dfa/determinization.h \ src/dfa/dfa.h \ src/dfa/dump.h \ src/dfa/tag_history.h \ src/dfa/tagver_table.h \ src/dfa/tcmd.h \ src/nfa/nfa.h \ src/re/encoding/case.h \ src/re/encoding/enc.h \ src/re/encoding/range_suffix.h \ src/re/encoding/utf8/utf8.h \ src/re/encoding/utf8/utf8_regexp.h \ src/re/encoding/utf8/utf8_range.h \ src/re/encoding/utf16/utf16_range.h \ src/re/encoding/utf16/utf16_regexp.h \ src/re/encoding/utf16/utf16.h \ src/re/empty_class_policy.h \ src/re/re.h \ src/re/rule.h \ src/re/tag.h \ src/compile.h \ src/skeleton/path.h \ src/skeleton/skeleton.h \ src/ast/ast.h \ src/ast/input.h \ src/ast/parser.h \ src/ast/scanner.h \ src/ast/unescape.h \ src/util/allocate.h \ src/util/attribute.h \ src/util/c99_stdint.h \ src/util/counter.h \ src/util/forbid_copy.h \ src/util/free_list.h \ src/util/hash32.h \ src/util/local_increment.h \ src/util/lookup.h \ src/util/range.h \ src/util/s_to_n32_unsafe.h \ src/util/slab_allocator.h \ src/util/smart_ptr.h \ src/util/static_assert.h \ src/util/string_utils.h \ src/util/u32lim.h \ src/util/uniq_vector.h \ src/util/wrap_iter.h SRC = \ src/code/bitmap.cc \ src/code/emit_action.cc \ src/code/emit_dfa.cc \ src/code/label.cc \ src/code/go_construct.cc \ src/code/go_destruct.cc \ src/code/go_emit.cc \ src/code/go_used_labels.cc \ src/code/input_api.cc \ src/code/output.cc \ src/code/print.cc \ src/conf/msg.cc \ src/conf/opt.cc \ src/conf/warn.cc \ src/nfa/dump.cc \ src/nfa/estimate_size.cc \ src/nfa/re_to_nfa.cc \ src/adfa/adfa.cc \ src/adfa/dump.cc \ src/adfa/prepare.cc \ src/dfa/cfg/cfg.cc \ src/dfa/cfg/compact.cc \ src/dfa/cfg/dce.cc \ src/dfa/cfg/dump.cc \ src/dfa/cfg/freeze.cc \ src/dfa/cfg/interfere.cc \ src/dfa/cfg/liveanal.cc \ src/dfa/cfg/normalize.cc \ src/dfa/cfg/optimize.cc \ src/dfa/cfg/rename.cc \ src/dfa/cfg/varalloc.cc \ src/dfa/closure.cc \ src/dfa/closure_leftmost.cc \ src/dfa/closure_posix.cc \ src/dfa/dead_rules.cc \ src/dfa/determinization.cc \ src/dfa/dump.cc \ src/dfa/fallback_tags.cc \ src/dfa/fillpoints.cc \ src/dfa/find_state.cc \ src/dfa/minimization.cc \ src/dfa/posix_precedence.cc \ src/dfa/tag_history.cc \ src/dfa/tagver_table.cc \ src/dfa/tcmd.cc \ src/re/encoding/enc.cc \ src/re/encoding/range_suffix.cc \ src/re/encoding/utf8/utf8_regexp.cc \ src/re/encoding/utf8/utf8_range.cc \ src/re/encoding/utf8/utf8.cc \ src/re/encoding/utf16/utf16_regexp.cc \ src/re/encoding/utf16/utf16.cc \ src/re/encoding/utf16/utf16_range.cc \ src/re/ast_to_re.cc \ src/re/default_tags.cc \ src/re/fixed_tags.cc \ src/re/nullable.cc \ src/re/rule.cc \ src/re/split_charset.cc \ src/re/tag.cc \ src/compile.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/main.cc \ src/ast/ast.cc \ src/ast/input.cc \ src/ast/normalize.cc \ src/ast/scanner.cc \ src/ast/unescape.cc \ src/ast/validate.cc \ src/util/s_to_n32_unsafe.cc \ src/util/range.cc re2c_SOURCES = \ $(SRC_HDR) \ $(SRC) # autogenerated sources AUTOGEN_LEX = src/ast/lex.cc AUTOGEN_VERTOVERNUM = src/conf/ver_to_vernum.cc AUTOGEN_PARSER = src/ast/parser.cc AUTOGEN_PARSER_HDR = src/ast/y.tab.h AUTOGEN_HELP = src/conf/help.cc AUTOGEN = \ $(AUTOGEN_LEX) \ $(AUTOGEN_PARSER) \ $(AUTOGEN_PARSER_HDR) \ $(AUTOGEN_VERTOVERNUM) \ $(AUTOGEN_HELP) \ src/ast/lex_conf.cc \ src/conf/parse_opts.cc nodist_re2c_SOURCES = $(AUTOGEN) # bootstrap sources BOOTSTRAP_PARSER = bootstrap/src/ast/parser.cc BOOTSTRAP_PARSER_HDR = bootstrap/src/ast/y.tab.h BOOTSTRAP_DOC = bootstrap/doc/re2c.1 BOOTSTRAP_HELP = bootstrap/src/conf/help.cc BOOTSTRAP = \ $(BOOTSTRAP_DOC) \ $(BOOTSTRAP_HELP) \ $(BOOTSTRAP_PARSER) \ $(BOOTSTRAP_PARSER_HDR) \ bootstrap/src/ast/lex.cc \ bootstrap/src/ast/lex_conf.cc \ bootstrap/src/conf/parse_opts.cc \ bootstrap/src/conf/ver_to_vernum.cc # custom sources CUSTOM_PARSER = src/ast/parser.ypp CUSTOM_HELP = doc/help.rst CUSTOM = \ $(CUSTOM_PARSER) \ $(CUSTOM_HELP) \ src/ast/lex.re \ src/ast/lex_conf.re \ src/conf/parse_opts.re \ src/conf/ver_to_vernum.re # docs SRC_DOC = doc/manpage.rst SRC_DOC_EXT = \ doc/manual/contributors.rst_ \ doc/manual/syntax/rules.rst_ \ doc/manual/syntax/interface.rst_ \ doc/manual/syntax/configurations.rst_ \ doc/manual/syntax/named_definitions.rst_ \ doc/manual/syntax/regular_expressions.rst_ \ doc/manual/warnings/warnings_list.rst \ doc/manual/warnings/warnings_general.rst \ doc/manual/features/generic_api/generic_api.rst_ \ doc/manual/features/conditions/conditions.rst_ \ doc/manual/features/state/state.rst_ \ doc/manual/features/submatch/submatch.rst_ \ doc/manual/features/encodings/encodings.rst_ \ doc/manual/options/options_list.rst DOC = doc/re2c.1 man_MANS = $(DOC) EXTRA_DIST = \ $(BOOTSTRAP) \ $(CUSTOM) \ $(SRC_DOC_EXT) \ CHANGELOG \ NO_WARRANTY \ README \ autogen.sh \ genhelp.sh \ doc/loplas.ps \ doc/sample.bib \ doc/tdfa/tdfa.pdf \ examples \ test CLEANFILES = \ $(AUTOGEN) \ $(DOC) $(AUTOGEN_PARSER): $(CUSTOM_PARSER) $(AM_V_at)$(MKDIR_P) $(@D) $(AM_V_GEN) if test $(BISON) = "no"; \ then \ cp $(top_srcdir)/$(BOOTSTRAP_PARSER) $@ && \ cp $(top_srcdir)/$(BOOTSTRAP_PARSER_HDR) $(AUTOGEN_PARSER_HDR); \ else \ $(BISON) \ --output=$@ \ --defines=$(AUTOGEN_PARSER_HDR) \ $(top_srcdir)/$(CUSTOM_PARSER); \ fi # lexer depends on bison-generated header # so bison rule must be triggered before lexer rule $(AUTOGEN_LEX): $(AUTOGEN_PARSER) $(BOOTSTRAP_PARSER): $(CUSTOM_PARSER) # target directory exists (as part of source file tree) $(AM_V_GEN) test $(BISON) = "no" || \ $(BISON) \ --output=$(top_srcdir)/$@ \ --defines=$(top_srcdir)/$(BOOTSTRAP_PARSER_HDR) \ --no-lines \ $(top_srcdir)/$(CUSTOM_PARSER); .re.cc: $(AM_V_at)$(MKDIR_P) $(@D) $(AM_V_GEN) if test -x $(RE2C); \ then \ $(top_builddir)/$(RE2C) $(RE2CFLAGS) -o $@ $< && \ cp $@ $(top_srcdir)/bootstrap/$@; \ else \ cp $(top_srcdir)/bootstrap/$@ $@; \ fi # rebuild all re2c sources using newly built re2c .PHONY: bootstrap bootstrap: all rm $(AUTOGEN) $(MAKE) all .PHONY: docs if REBUILD_DOCS docs: $(DOC) $(AUTOGEN_HELP) $(DOC): $(SRC_DOC) $(SRC_DOC_EXT) $(AM_V_at)$(MKDIR_P) $(@D) $(RST2MAN) $(top_builddir)/$(SRC_DOC) > $@ cp $@ $(top_srcdir)/$(BOOTSTRAP_DOC) $(AUTOGEN_HELP): $(CUSTOM_HELP) $(AM_V_at)$(MKDIR_P) $(@D) $(RST2MAN) $(top_builddir)/$(CUSTOM_HELP) > $@.1 $(top_srcdir)/genhelp.sh $@.1 $@ cp $@ $(top_srcdir)/$(BOOTSTRAP_HELP) else docs: $(DOC) $(AUTOGEN_HELP) @echo "Reconfigure to rebuild docs: ./configure --enable-docs" $(DOC): $(BOOTSTRAP_DOC) $(AM_V_at)$(MKDIR_P) $(@D) cp $(top_srcdir)/$(BOOTSTRAP_DOC) $@ $(AUTOGEN_HELP): $(BOOTSTRAP_HELP) $(AM_V_at)$(MKDIR_P) $(@D) cp $(top_srcdir)/$(BOOTSTRAP_HELP) $@ endif all-local: docs $(BOOTSTRAP_PARSER) # tests TST_SUITE = run_tests.sh .PHONY: tests tests: all $(TST_SUITE) $(top_builddir)/$(TST_SUITE) .PHONY: vtests vtests: all $(TST_SUITE) $(top_builddir)/$(TST_SUITE) --valgrind .PHONY: wtests wtests: all $(TST_SUITE) $(top_builddir)/$(TST_SUITE) --wine -j1 TST_RANGE = testrange testrange_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 \ src/util/static_assert.h TST_S_TO_N32_UNSAFE = testston32unsafe testston32unsafe_SOURCES = \ src/test/s_to_n32_unsafe/test.cc \ src/util/s_to_n32_unsafe.cc TST_VERTOVERNUM = testvertovernum testvertovernum_SOURCES = \ src/test/ver_to_vernum/test.cc \ $(AUTOGEN_VERTOVERNUM) check_PROGRAMS = \ $(TST_RANGE) \ $(TST_S_TO_N32_UNSAFE) \ $(TST_VERTOVERNUM) TESTS = $(TST_SUITE) $(check_PROGRAMS)