I am working on linux binutils-2.29.
In the parent directory there is not Makefile.am, but in all the sub directories there is Makefile.am.
In the parent directory these are the Makefiles present:
Makefile Makefile.def Makefile.in Makefile.tpl
In side Makefile.tpl there is a comment which says Makefile is generated from Makefile.tpl by autogen Makefile.def
but inside subdirectories there is not Makefile.def, when I run autoreconf && automake it generates Makefile from Makefile.am
What exactly is the difference between Makefile.def and Makefile.am?
Let's look at GCC, large project which is using
binutilsas well. Quoting Regenerating GCC Configuration:So the difference is really about how and where you want to store parts of the input files that
autogenwill work on. In case of GCC, itMakefile.tplstores a template (for generating the output Makefile, whereasMakefile.defstores definitions, which will be used by autogen.For example, inside
Makefile.tplyou will find this template for fillingHOST_LIB_PATHvariable (note it useshost_modulesvariable):And inside
Makefile.defthere is a definition forhost_modules: