如何在automake中一次指定多个源文件
有什么办法可以避免在 automake 脚本中指定我手动创建的每个源文件吗?
我尝试了多种使用 find -name *.cc
等指定源文件的方法。我还尝试在 autoconf 中找到该列表并将其替换到 Makefile.am 中,但 automake 抗议说这是不允许的。
如果我必须手动维护列表,我可能会一直忘记将新创建的文件添加到列表中。我宁愿不必这样做。有什么办法可以自动为我选择新文件吗?
任何帮助表示赞赏。
Is there any way around having to specify every sourcefile I create manually in my automake scripts?
I've tried several ways of specifying sourcefiles using find -name *.cc
or the like. I've also tried finding the list in autoconf and substituting it into the Makefile.am, but automake protested that this is not allowed.
If I have to maintain the list by hand, I'm likely to keep forgetting to add newly created files to the list. I'd rather not have to do that. Is there any way to have new files selected for me automatically?
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
Makefile.am:
将
foo_SOURCES
的定义放入srcs.am
中。然后要更新源列表,请执行make new-src;制作
。不过,这似乎是一个非常糟糕的主意。一旦你的项目建立起来,你就很少会改变文件列表,而且你仍然会有神奇的包袱。
Try this:
Makefile.am:
Put the definition of
foo_SOURCES
insrcs.am
. Then to update the source list, domake new-src; make
.This seems like a really bad idea, though. Once your project is established, you'll rarely change the file list anyway and you'll still have magic baggage hanging around.