Reputation: 1947
I have a following problem. Basically I have a really long Makefile which calls many complex commands. It uses environment variables, methods included from other Makefiles, really hard to read bash magic. So for example I have a command (cannot put the real one here, sorry) like this:
foo ${bar} (sort ...) [...]
I am analysing this Makefile and I want to know what exactly gets executed when I run it. The thing I want to achieve is this command in a text representation, so all the stuff gets evaluated and I can actually see what exactly is being executed like gcc something -Isomethingmore
(so the command foo ${bar} (sort ...) [...]
actually means gcc something -Isomethingmore
) etc. Is there a way to do that? So I can for example echo it and see what am I dealing with?
Upvotes: 0
Views: 255
Reputation: 29050
By default make prints the recipes it executes. So you should see the exact command in the standard output. Use grep
maybe to isolate the one you are interested in. If make does not print the recipes it may be:
@
, which tells make to be silent for this recipe,.SILENT
special target that silences all recipes.Remove one or the other and you should see the recipe when it is executed.
Upvotes: 2