Skip to content
Myr

Support building with --disable-maintainer-mode and source != build dir (#3518)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

If --disable-maintainer-mode is enabled, then the rules for generating parser.[ch] and lexer.[ch] did nothing. This worked fine if the source and build directories are the same as the pre-generated parser.c and lexer.c files would suffice. However, if the build directory is not the same as the source directory, then the rest of the Make rules expect parser.[ch] and lexer.[ch] to have been created in the build directory if their source files (parser.y and lexer.l) are newer than the target files, which can happen in case the source is fetched using Git. Avoid the problem by copying the files to the build directory if needed.

authored by Peter Kjellerstedt · committed by GitHub · parent 69785bf · Browse files · 1 file+7 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Co-authored-by: Peter Kjellerstedt <pkj@axis.com>

Diff stats

1 file+7 added−2 removed

  • other:+7 added−2 removed

1 file+7 added−2 removed

modified:Makefile.am+7 added-2 removed
39 unmodified lines
40src/lexer.h: src/lexer.c41else42BUILT_SOURCES = src/builtin.inc src/config_opts.inc src/version.h43.y.c:44 $(AM_V_YACC) echo "NOT building parser.c!"44 $(AM_V_YACC) [ "$(<D)" = "$(@D)" ] || cp $(<D)/$(@F) $@45 $(AM_V_YACC) [ "$(<D)" = "$(@D)" ] || cp $(<D)/$(*F).h $*.h46 $(AM_V_YACC) touch $@ $*.h4748.l.c:46 $(AM_V_LEX) echo "NOT building lexer.c!"49 $(AM_V_LEX) [ "$(<D)" = "$(@D)" ] || cp $(<D)/$(@F) $@50 $(AM_V_LEX) [ "$(<D)" = "$(@D)" ] || cp $(<D)/$(*F).h $*.h51 $(AM_V_LEX) touch $@ $*.h52endif5354# Tell YACC (Bison) autoconf macros that you want a header file created.55# If the --warnings=all fails, you probably have an old version of Bison
203 unmodified lines