【发布时间】:2017-08-18 22:42:31
【问题描述】:
这里有两个独立的问题。
首先,是否可以修改 makefile 以生成 GDB 可读的 a.out?其次,在makefile中,如何禁用屏幕输出的所有警告信息?
这是makefile的内容:
ALL: timefield eqloc3d getdat
timefield: timefield.c common.c common.h getpar.c time_3d.c modresample.c eq.c eq.h
cc timefield.c common.c getpar.c time_3d.c modresample.c eq.c ./libgeo.a -lsunmath -lm -g -o timefield
eqloc3d: deri.c eqloc3d.c getpar.c main.c modresample.c common.h common.c modifyxy.c modifyxyz.c eqloc3d.h eq.c eq.h model.h initeqloc.h initeqloc.c
cc deri.c eqloc3d.c getpar.c main.c modresample.c common.c modifyxy.c modifyxyz.c eq.c initeqloc.c ./libgeo.a -lsunmath -lm -xlic_lib=sunperf -g -o eqloc3d
getdat: eq.c eq.h getdat.c
cc -g eq.c getdat.c -o getdat libgeo.a -lm
如果我运行 makefile,它会创建三个二进制可执行文件:timefield、eqloc3d、getdat。一旦程序没有产生正确的输出,我就没有 a.out 以便我可以使用 GDB 来跟踪异常。
【问题讨论】:
-
您想知道如何抑制来自编译器的警告消息,以及如何启用调试器。想一想。