- 论坛徽章:
- 0
|
gnu的编译前先有预处理阶段,把好多文件加载进来,很多宏定义、inline函数等展开。
−E Stop after the preprocessing stage; do not run the compiler proper. The output is in the form of preprocessed
source code, which is sent to the standard output.
Input files which don’t require preprocessing are ignored.
然后可以只生产目标文件,注意这样可以实现多文件的书写代码,然后最后link到一起,期间可能会link一些标准库之类的
−c Compile or assemble the source files, but do not link. The linking stage simply is not done. The ultimate
output is in the form of an object file for each source file.
By default, the object file name for a source file is made by replacing the suffix .c, .i, .s, etc., with .o.
Unrecognized input files, not requiring compilation or assembly, are ignored.
当然gcc也支持翻译到汇编代码
−S Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler
code file for each non-assembler input file specified.
By default, the assembler file name for a source file is made by replacing the suffix .c, .i, etc., with .s.
Input files that don’t require compilation are ignored.
可能我讲的有点乱,而且浮于表面
具体可以参考gcc文档 |
|