本文介绍了Automake Flex输出命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果使用

foo_SOURCES = bar.l

foo_SOURCES = bar.l

然后,自动制作通过弹性文件 bar.c 生成.但是,如果我提供前缀 AM_LFLAGS = -Psome_prefix ,则会生成 lex.some_prefix.c ,其他人不知道编译规则,因此它失败并显示 bar.c:没有这样的文件或目录.我的错误在哪里,我该如何解决?我真的需要前缀.

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 othercompilation 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.

推荐答案

我认为解决此问题的唯一方法是为.l->.c翻译编写自己的规则.像这样:

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

您可能还需要进行一些调整以确保您分发.l文件.

You may also need a tweak to ensure you distribute the .l file.

这篇关于Automake Flex输出命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 10:23