Timmmm
Timmmm

Reputation: 97008

How to get GNU Make to tell me why it is rebuilding a target

Is there a way to tell make to show me a list of inputs to a target and which ones are triggering a rebuild because they have been modified?

Upvotes: 0

Views: 550

Answers (1)

reza ostadi
reza ostadi

Reputation: 197

Yes, you can use the -d option in make to show detailed information about the dependencies and the commands being executed. For example, if you run make -d , make will show a list of the dependencies of the target, as well as the commands being executed and their output.

Additionally, you can use the -n option to show what make would do, without actually executing any commands. This is useful to see which targets would be rebuilt because their dependencies have been modified. For example, if you run make -n , make will show the dependencies of the target and the commands that would be executed, without actually executing them.

Upvotes: 1

Related Questions