This is a collection of notes I have accumulated while working with make. The make manual is a good place to start looking for answers.
info command can be used to dump information from makefile.
Similarly one can use the
warning commands can be used for debugging.
Remake http://bashdb.sourceforge.net/remake/ is a enhanced version of GNUMake with enhanced tracing and a builtin debugger. I have been using remake as a replacement for make on my development machine and am yet to run into any issues.
Now you can use
to get better information on why a target is being built/rebuilt.
-B option of remake triggers an unconditional rebuild of a specified target.
To ensure the
-j N flag is used when doing recursive make, use
invoking the submake. This ensures that the gmake jobserver is used correctly. Otherwise
you might see warnings such as
make: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
When one of the dependencies is a symbolic link, make checks the modification time of the file referenced by the link. This is sensible behaviour and probably the reason it is not called out in the gnu make manual.
There is also the “-L” option which causes make to consider the modification time of the symlink as well. This is option is useful when one wants to “touch symlink” and run make.
On systems that support symbolic links, this option causes make to consider the timestamps
on any symbolic links in addition to the timestamp on the file referenced by those links.
When this option is provided, the most recent timestamp among the file and the symbolic
links is taken as the modification time for this target file.