According to documentation dependency rules for C/C++ files could be generated
with -M compiler flag. But -M flag generates dependency rule, which contains, among
others, system include files in prerequisite list. On Unix system These prerequisites
start usually with " /usr/include/" prefix. Normally system includes are not so important
for application project, and -MM compiler flag is more suitable as it ends up with shorter
1) So the suggestion is to replace "-M" compiler flag to "-MM" one.
My second suggestion for this chapter concerns the recipe of rule for generating
dependency file. The current rule is redundantly complex.
Modern GCC compiler, when it is used for dependency generation, allows to specify output file name with -MF. Also it is possible to specify target name for generated rules with -MT flag. The -MT flag can be used multiple times in single command.
2) The second suggestion is to replace example rule for dependency generation: