15.8 How Does it Work?

The standard makefile body examines the target variable and property definitions and creates new makefile fragments from them. Each makefile use defines how to create rules for a target that includes that use.[1] When the fragment is included into the makefile body, make learns how to deal with that target and goes off building the files. This is relatively easily adapted to allow any tool to make arbitrary modifications to the build process. A primary example of this is the Logiscope support. See Appendix G, ``Details on Tools'' for details.

This process is what creates the various .makefrag files into your directories. They are maintained by the release tools; you should never need to touch them. If for some reason things go wrong, you may need to delete these files. Under normal circumstances there should rarely be a need to do so.

configure scripts communicate information to the standard makefile body via the .makestate files. These record the settings the configure script detected or was told by the user on the command line. For example, the $(srcdir) setting is communicated via .makestate. You should never delete these files; building the distlcean target removes them, and you should remove them accidentally, you must recreate them before running make. To recreate the files you must run configure (config.status also knows how to recreate them if the .makestate.in is still around).

Notes

[1]

Yes, you read that right: makefile uses rarely define any rules themselves. Usually they only create rules for a target. This is one reason why you must state all the uses the target needs: otherwise the appropriate rules will not be created into the makefile fragment and make will not know what to do.