linux基础学习之 GCC

GCC


gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] 
[-Wwarn...] [-pedantic]
[-Idir...] [-Ldir..]
[-Dmacro[=defn]...] [-Umacro]
[-foption...] [mmachine-option...]
[-o output] [@file] infile...




  -v                       Display the programs invoked by the compiler
  -###                     Like -v but options quoted and commands not executed
  -E                       Preprocess only; do not compile, assemble or link
  -S                       Compile only; do not assemble or link
  -c                       Compile and assemble, but do not link
  -o <file>                Place the output into <file>




  --help                   Display this information
  --target-help            Display target specific command line options
  --help={target|optimizers|warnings|params|[^]{joined|separate|undocumented}}[,...]
                           Display specific types of command line options








-c compile or assemble the source files,but do not link.the linking stage is not done.


-s stop after the stage of compilation proper;do not assemble.


-E stop after the preprocessing stage;do not run the compiler proper.


-o file place output in file.


-v print the commands executed to run the stages of compilation.


-w inhibit all warning messages


-Werror make all warnings into errors.


-g produce debugging information in the operating system's natie format.


-pg generate extra code to write profile information suitable for the analysis program 


gprof. you must use this option when compiling the source files you want data anout , and 


you must also use it when linking.


-ftime-report makes the compiler print some statistics about the time consumed by each 


pass when it finishes.


-fmem-report makes the compiler print some statistics about permanent memory allocation 


when it finishes.


-I dir add the directory dir to the list of directory to be seachered for header files. 


-M instead of outputing the result of preprocessing , output a rule suitable for make 


describing the dependencies of the main source file.


-MM like -M but do not mention header files that are found in system header 


directories, nor header files that are included,directly or indirectly,from such a header.


-l library seacher the library named library when linking.

你可能感兴趣的:(linux基础学习之 GCC)