
Terminal - Debug your makefile
make -d | egrep --color -i '(considering|older|newer|remake)'
This is sample output - yours may be different.
$ make -d | egrep --color -i '(considering|older|newer|remake)'
Considering target file `Makefile'.
No need to remake target `Makefile'.
Considering target file `hffcmprss'.
Considering target file `hffcmprss.o'.
Considering target file `common/common_types.h'.
No need to remake target `common/common_types.h'.
Considering target file `gnrcheap/gnrcheap.o'.
Considering target file `gnrcheap/gnrcheap.c'.
No need to remake target `gnrcheap/gnrcheap.c'.
Considering target file `gnrcheap/gnrcheap.h'.
No need to remake target `gnrcheap/gnrcheap.h'.
Prerequisite `gnrcheap/gnrcheap.c' is older than target `gnrcheap/gnrcheap.o'.
Prerequisite `gnrcheap/gnrcheap.h' is older than target `gnrcheap/gnrcheap.o'.
Prerequisite `Makefile' is older than target `gnrcheap/gnrcheap.o'.
No need to remake target `gnrcheap/gnrcheap.o'.
Considering target file `gnrcqueue/gnrcqueue.o'.
Considering target file `gnrcqueue/gnrcqueue.c'.
No need to remake target `gnrcqueue/gnrcqueue.c'.
Considering target file `gnrcqueue/gnrcqueue.h'.
No need to remake target `gnrcqueue/gnrcqueue.h'.
Prerequisite `gnrcqueue/gnrcqueue.c' is older than target `gnrcqueue/gnrcqueue.o'.
Prerequisite `gnrcqueue/gnrcqueue.h' is older than target `gnrcqueue/gnrcqueue.o'.
Prerequisite `Makefile' is older than target `gnrcqueue/gnrcqueue.o'.
No need to remake target `gnrcqueue/gnrcqueue.o'.
Considering target file `gnrclist/gnrclist.o'.
Considering target file `gnrclist/gnrclist.c'.
No need to remake target `gnrclist/gnrclist.c'.
Considering target file `gnrclist/gnrclist.h'.
No need to remake target `gnrclist/gnrclist.h'.
Prerequisite `gnrclist/gnrclist.c' is older than target `gnrclist/gnrclist.o'.
Prerequisite `gnrclist/gnrclist.h' is older than target `gnrclist/gnrclist.o'.
Prerequisite `Makefile' is older than target `gnrclist/gnrclist.o'.
No need to remake target `gnrclist/gnrclist.o'.
Considering target file `gnrctree/gnrctree.o'.
Considering target file `gnrctree/gnrctree.c'.
No need to remake target `gnrctree/gnrctree.c'.
Considering target file `gnrctree/gnrctree.h'.
No need to remake target `gnrctree/gnrctree.h'.
Prerequisite `gnrctree/gnrctree.c' is newer than target `gnrctree/gnrctree.o'.
Prerequisite `gnrctree/gnrctree.h' is older than target `gnrctree/gnrctree.o'.
Prerequisite `Makefile' is older than target `gnrctree/gnrctree.o'.
Must remake target `gnrctree/gnrctree.o'.
gnrctree/gnrctree.c: In function ?gnrctree_bfs?:
gnrctree/gnrctree.c:99: warning: suggest parentheses around assignment used as truth value
Considering target file `hfftypes.h'.
No need to remake target `hfftypes.h'.
Considering target file `hffcmprss.h'.
No need to remake target `hffcmprss.h'.
Considering target file `hffcmprss.c'.
No need to remake target `hffcmprss.c'.
Prerequisite `common/common_types.h' is older than target `hffcmprss.o'.
Prerequisite `gnrcheap/gnrcheap.o' is older than target `hffcmprss.o'.
Prerequisite `gnrcqueue/gnrcqueue.o' is older than target `hffcmprss.o'.
Prerequisite `gnrclist/gnrclist.o' is older than target `hffcmprss.o'.
Prerequisite `gnrctree/gnrctree.o' is newer than target `hffcmprss.o'.
Prerequisite `hfftypes.h' is older than target `hffcmprss.o'.
Prerequisite `hffcmprss.h' is newer than target `hffcmprss.o'.
Prerequisite `hffcmprss.c' is older than target `hffcmprss.o'.
Prerequisite `Makefile' is older than target `hffcmprss.o'.
Must remake target `hffcmprss.o'.
Prerequisite `hffcmprss.o' is newer than target `hffcmprss'.
Prerequisite `Makefile' is older than target `hffcmprss'.
Must remake target `hffcmprss'.
Debug your makefile
Say your dependencies specified in your Makefile (or dates on your source files) is causing 'make' to
skip some source-files (that it should not) or on the other other end, if it is causing make to always build some source-files regardless of dates of target, then above command is handy to find out what 'make' thinks of your date v/s target date-wise or what dependencies are in make's view-point.
The egrep part removes the extra noise, that you might want to avoid.
Brilliant. Simple and effective.
If you want to look at all of make's output, you can add "|$" to the end of the grep clause.
This will syntax-highlight the words and leave the rest of the text intact.
make -d | egrep --color -i '(considering|older|newer|remake|$)'