Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use breakpoint in Makefile?

I am trying to debug on very big Makefiles. I asked this same question here: http://www.edaboard.com/thread324433.html The thing that I'm not sure about is if there is any way to debug using breakpoints?

If the answer given to me is right, could someone please let me know more exactly how I can use breakpoints in Makefile?

like image 696
Carter Avatar asked Oct 28 '25 23:10

Carter


1 Answers

You can't use 'breakpoints' and "step through" a Makefile. There are several recommended methods for debugging:

  • insert $(info) statements to display values of variables
  • insert $(warning) statements - it is better than info, because it shows the line number
  • replace $(eval) temporarily with $(info) to see what $(eval) expands to
  • study the output of make parsing the makefiles - use make -p
  • study the output of the whole make run: use make --debug
  • use 'GNU Make shell hack' (Google it) to log information when rules are executed
  • use ElectricCloud make - it has much more extensive debugging facilities than standard Make, but it is expensive (and worth every penny!)

I understand you are a newbie and want to know exactly how to do the above, but I am not going to tell you. I just outlined the steps above for you and you must go and study yourself. There is no other way. A few years ago I also had to study this and while I was doing that, I was asking a lot of silly questions. There is no other way to learn.

like image 131
Mark Galeck Avatar answered Nov 01 '25 09:11

Mark Galeck