GCC -M,-MM,-MMD,-MF,-MT

GCC的命令参数有很多,下面主要介绍几个M相关的:
###-M
生成文件关联的信息。包含目标文件所依赖的所有源代码,下面是测试log:

jack@jxes-VirtualBox:~/samba_share/tmp$ vim test.c
jack@jxes-VirtualBox:~/samba_share/tmp$ gcc -M test.c
test.o: test.c /usr/include/stdc-predef.h /usr/include/stdio.h \
 /usr/include/features.h /usr/include/i386-linux-gnu/sys/cdefs.h \
 /usr/include/i386-linux-gnu/bits/wordsize.h \
 /usr/include/i386-linux-gnu/gnu/stubs.h \
 /usr/include/i386-linux-gnu/gnu/stubs-32.h \
 /usr/lib/gcc/i686-linux-gnu/5/include/stddef.h \
 /usr/include/i386-linux-gnu/bits/types.h \
 /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \
 /usr/include/_G_config.h /usr/include/wchar.h \
 /usr/lib/gcc/i686-linux-gnu/5/include/stdarg.h \
 /usr/include/i386-linux-gnu/bits/stdio_lim.h \
 /usr/include/i386-linux-gnu/bits/sys_errlist.h

###-MM
和上面的那个一样,但是它将忽略由#include造成的依赖关系。

jack@jxes-VirtualBox:~/samba_share/tmp$ gcc -MM t

你可能感兴趣的:(GCC -M,-MM,-MMD,-MF,-MT)