Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get make to show line number on error

I have a makefile, which is missing an ldflag. I know how to fix it, but I don't know which line in the makefile the error is generated on.

+ 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

How do I get make to print out the line the error is on?

(If anybody is wondering, it is a makefile from the libass project in the test directory.)

like image 986
rhlee Avatar asked Jul 27 '12 18:07

rhlee


1 Answers

Try using remake to see if it helps.

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

Heres an example obtained from the link above:

enter image description here

Hope this helps!

like image 199
Dayan Avatar answered Sep 23 '22 16:09

Dayan