0

I am trying to find a way to better understand a complex make structure we have for our project. It includes multiple recursive make files with multiple separate invocations of make inside them.

How to trace which targets/prerequisites are being processed live? I tried putting warning messages before the target name, before the prereq names, and as a first rule.

Unfortunately, because make first preprocess those files the warnings will always showup. Not until you start executing the rules of the target then you see that warning.

But what I really want to see is the time when these targets are first referenced (before their prereqs are being called and before the rules are being executed).

Is there a way to do that?

SFbay007
  • 1,917
  • 1
  • 20
  • 39
  • See, for example, [How do I force make/gcc to show me the commands?](//stackoverflow.com/q/5820303). – Joseph Quinsey Jan 09 '19 at 02:31
  • That still doesnt show me which targets/prereqs are being handled. – SFbay007 Jan 09 '19 at 02:36
  • 1
    Add `$(info $^ --> $@)` in all your recipes? – Renaud Pacalet Jan 09 '19 at 06:37
  • Running `make -d` will give you all the info. You can get more specific info (limit the output) by using one or more of the options to `make --debug`. See the docs. – MadScientist Jan 09 '19 at 15:58
  • Thanks Renaud Pacalet, is there a way to print target/deps names "unevaluated"? – SFbay007 Jan 10 '19 at 02:24
  • take a look at http://bashdb.sourceforge.net/remake/ - you can use it like gdb, i.e. set breakpoints and interactively examine targets etc. It's awesome :) – boyvinall Jan 10 '19 at 22:43
  • Thanks for the suggestion. The problem is, the make I am dealing with is very complicated and in many places uses the explicit $(make) commands to invoke other make processes which expand to the internal make. How do you suggest I change all that to use the remake version that I downloaded? – SFbay007 Jan 12 '19 at 03:10

0 Answers0