The gcc compilation parameters in linux are described in detail.
Reference URL: 1 http://hi.baidu.com/zengzhaonong/item/f1f9383565fa5c302e0f8125 gcc usage Summary
2. Differences of gcc parameters for http://s99f.blog.163.com/blog/static/35118365201311261453629/
3 http://blog.csdn.net/ruglcc/article/details/7814546 makefile tutorial
I just got started with C Programming in linux. I used to work on a project, but recently I found that c Programs, especially when writing large projects, are also divided into three layers: control layer interface layer Module layer.
Then, during compilation, you need to use makefile for compilation. At this time, you can re-view the gcc compilation and Makefile. Some details are found when you refer to other people's Makefile.
1 gcc-I-L-l-r-E-S-o-O-Wall-c-m-g detailed description:-I (uppercase letter I) use the specified directory as the first directory to find the header file
-L use the specified directory as the first directory to find the library file
-L (lower case l) uses the specified directory as the first directory to search for dynamic link library files.
-E: pre-process the. c file as a. I file.
-S: Compile the. I file into a. s file.
-O: Convert the. s file
-O optimizes program compilation and linking. With this option, the entire source code is optimized during compilation and linking. This improves the execution efficiency of executable files, however, the compilation and link speed is correspondingly slower.
-Wall: displays all warning information during compilation.
-C is only compiled and does not link to an executable file. The compiler is only input. c and other source code file generation. o is a target file with a suffix. It is usually used to compile a subroutine file that does not contain the main program.
-G generate the symbolic information required by the GNU gdb tool. To debug the source code, we must add this option.