sth*_*sth 10
引用手册页gcc:
-M Instead of outputting the result of preprocessing, output a rule
suitable for make describing the dependencies of the main source
file. The preprocessor outputs one make rule containing the object
file name for that source file, a colon, and the names of all the
included files, including those coming from -include or -imacros
command line options.
Run Code Online (Sandbox Code Playgroud)
这基本上做你想要的.还有其他几个相关选项(均以...开头-M)为您提供此输出的不同变体.