3

I'm reading GCC's source code and have some questions. It's obvious that GCC is build with autotools. But I couldn't find the Makefile.am files required by automake. Is GCC's Makefile.in files written by hand? And if they are written by hand, where can I find the documents describing the syntax of a Makefile.in?

A similar question: Makefile.in without Makefile.am in projects

Community
  • 1
  • 1
noinput
  • 411
  • 3
  • 12
  • This is a GNU tool, so if Makefile.in was generated from something, that something would have to be available as well. You have access to the ChangeLog, you can see that changes to Makefile.in appear as "change bla bla", not "regenerate" like configure. You can conclude. – Marc Glisse Jan 21 '17 at 13:55
  • Yes. But on the other hand, the Makefile.in is really big and hard to read. I've ever doubted that such file was generated automatically by some private maintainer-scripts... – noinput Jan 21 '17 at 14:01

1 Answers1

3

Makefile.am is a later addition to Autotools family and not all projects use it. GCC in particular does not use it. The top-level Makefile.in is generated from Makefile.tpl using autogen (see here for details). Other Makefile.in's are written by hand according to Autoconf rules.

yugr
  • 19,769
  • 3
  • 51
  • 96
  • 1
    The top-most directory uses a Makefile.tpl template file. But I couldn't find a similar template file in other subdirectories, for instance, libcpp, there is only Makefile.in. Is this file written 'by hand'? – noinput Jan 21 '17 at 13:45
  • 1
    Yes, these other `Makefile.in`s are edited by hand (according to [Autoconf rules](https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Makefile-Substitutions.html#Makefile-Substitutions)). – yugr Jan 21 '17 at 14:05
  • @noinput Was this answer helpful? – yugr Jan 27 '17 at 11:38
  • Yes. Thank you! I'm not sure about some internals of GCC. Your answer helps me. I think GCC needs more documentations for beginners to hack, to research. – noinput Jan 27 '17 at 13:33
  • Yeah, it's a rough learning curve (but LLVM isn't easy either). – yugr Jan 27 '17 at 13:53