14 GNU make
Only after it has tried to find a way to remake a makefile and failed, will make diagnose the
missing makefile as a fatal error.
If you want make to simply ignore a makefile which does not exist or cannot be remade,
with no error message, use the -include directive instead of include, like this:
-include filenames...
This acts like include in every way except that there is no error (not even a warning)
if any of the filenames (or any prerequisites of any of the filenames) do not exist or cannot
be remade.
For compatibility with some other make implementations, sinclude is another name for
-include.
3.4 The Variable MAKEFILES
If the environment variable MAKEFILES is defined, make considers its value as a list of
names (separated by whitespace) of additional makefiles to be read before the others. This
works much like the include directive: various directories are searched for those files (see
Section 3.3 [Including Other Makefiles], page 13). In addition, the default goal is never
taken from one of these makefiles (or any makefile included by them) and it is not an error
if the files listed in MAKEFILES are not found.
The main use of MAKEFILES is in communication between recursive invocations of make
(see Section 5.7 [Recursive Use of make], page 50). It usually is not desirable to set the
environment variable before a top-level invocation of make, because it is usually better not
to mess with a makefile from outside. However, if you are running make without a specific
makefile, a makefile in MAKEFILES can do useful things to help the built-in implicit rules
work better, such as defining search paths (see Section 4.4 [Directory Search], page 25).
Some users are tempted to set MAKEFILES in the environment automatically on login,
and program makefiles to expect this to be done. This is a very bad idea, because such
makefiles will fail to work if run by anyone else. It is much better to write explicit include
directives in the makefiles. See Section 3.3 [Including Other Makefiles], page 13.
3.5 How Makefiles Are Remade
Sometimes makefiles can be remade from other files, such as RCS or SCCS files. If a makefile
can be remade from other files, you probably want make to get an up-to-date version of the
makefile to read in.
To this end, after reading in all makefiles, make will consider each as a goal target and
attempt to update it. If a makefile has a rule which says how to update it (found either
in that very makefile or in another one) or if an implicit rule applies to it (see Chapter 10
[Using Implicit Rules], page 111), it will be updated if necessary. After all makefiles have
been checked, if any have actually been changed, make starts with a clean slate and reads
all the makefiles over again. (It will also attempt to update each of them over again, but
normally this will not change them again, since they are already up to date.)
If you know that one or more of your makefiles cannot be remade and you want to keep
make from performing an implicit rule search on them, perhaps for efficiency reasons, you
can use any normal method of preventing implicit rule look-up to do so. For example,
Comentários a estes Manuais