获取make以显示错误的行号

rhl*_*lee 5 makefile gnu-make

我有一个makefile,缺少ldflag.我知道如何修复它,但我不知道生成错误的makefile中的哪一行.

+ make
  CCLD   test
test-test.o: In function `write_png':
/home/lenovo/scratch/libass/test/test.c:52: undefined reference to `png_create_write_struct'
...
/home/lenovo/scratch/libass/test/test.c:57: undefined reference to `png_destroy_write_struct'
collect2: ld returned 1 exit status
make: *** [test] Error 1
Run Code Online (Sandbox Code Playgroud)

如何打印出错误所在的行?

(如果有人想知道,它是测试目录中libass项目的makefile.)

Day*_*yan 5

尝试使用remake,看它是否有帮助.

http://static.usenix.org/events/lisa11/tech/full_papers/Bernstein.pdf

以下是从上面的链接获得的一个例子:

在此输入图像描述

希望这可以帮助!