gcc 的参数文件
在 Linux 上,有没有办法将参数从文件传递给 gcc。就是给compile.args这样的文件
% cat compile.args
-g3
-ggdb
-pedantic
-pedantic-errors
-Wall
-Werror
-O0
vec1.cpp
-o vec1
,然后把这个文件给g++/gcc。我可以使用 catcompile.args | 来做到这一点xargs g++,还有其他方式吗? gcc 支持吗?
谢谢。
On Linux, is there a way to pass arguments to gcc from a file. That is to gave file like compile.args
% cat compile.args
-g3
-ggdb
-pedantic
-pedantic-errors
-Wall
-Werror
-O0
vec1.cpp
-o vec1
and then give this file to g++/gcc. I can do this using cat compile.args | xargs g++, is they any other way? Does gcc support this?
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,只需运行
gcc @compile.args
Yes, just run
gcc @compile.args
为了冗长,类似的东西也应该起作用(取决于正在运行的 shell)
或
For verbosity, also something like this should work (depending on running shell)
or