问题
If if use, for example
foo_SOURCES = bar.l
then, automake generates via flex file bar.c
. But, if I provide prefix AM_LFLAGS=-Psome_prefix
, it generates lex.some_prefix.c
, which is not known by other
compilation rules, so it fails with bar.c: No such file or directory
. Where is my mistake and how can I work around it? I really need prefix.
回答1:
I think the only way around this is to write your own rule for the .l->.c translation. Something like:
x_SOURCES = lex.some_prefix.c
lex.some_prefix.c: lex.l
... rule here
You may also need a tweak to ensure you distribute the .l file.
来源:https://stackoverflow.com/questions/12569547/automake-flex-output-naming