Appendix B: Errors Generated by Make 173
Appendix B Errors Generated by Make
Here is a list of the more common errors you might see generated by make, and some
information about what they mean and how to fix them.
Sometimes make errors are not fatal, especially in the presence of a - prefix on a recipe
line, or the -k command line option. Errors that are fatal are prefixed with the string ***.
Error messages are all either prefixed with the name of the program (usually ‘make’),
or, if the error is found in a makefile, the name of the file and line number containing the
problem.
In the table below, these common prefixes are left off.
‘[foo] Error NN’
‘[foo] signal description’
These errors are not really make errors at all. They mean that a program that
make invoked as part of a recipe returned a non-0 error code (‘Error NN’), which
make interprets as failure, or it exited in some other abnormal fashion (with a
signal of some type). See Section 5.5 [Errors in Recipes], page 49.
If no *** is attached to the message, then the sub-process failed but the rule
in the makefile was prefixed with the - special character, so make ignored the
error.
‘missing separator. Stop.’
‘missing separator (did you mean TAB instead of 8 spaces?). Stop.’
This means that make could not understand much of anything about the make-
file line it just read. GNU make looks for various separators (:, =, recipe prefix
characters, etc.) to indicate what kind of line it’s parsing. This message means
it couldn’t find a valid one.
One of the most common reasons for this message is that you (or perhaps
your oh-so-helpful editor, as is the case with many MS-Windows editors) have
attempted to indent your recipe lines with spaces instead of a tab character.
In this case, make will use the second form of the error above. Remember
that every line in the recipe must begin with a tab character (unless you set
.RECIPEPREFIX; see Section 6.14 [Special Variables], page 73). Eight spaces do
not count. See Section 4.1 [Rule Syntax], page 21.
‘recipe commences before first target. Stop.’
‘missing rule before recipe. Stop.’
This means the first thing in the makefile seems to be part of a recipe: it begins
with a recipe prefix character and doesn’t appear to be a legal make directive
(such as a variable assignment). Recipes must always be associated with a
target.
The second form is generated if the line has a semicolon as the first non-
whitespace character; make interprets this to mean you left out the "target:
prerequisite" section of a rule. See Section 4.1 [Rule Syntax], page 21.
Kommentare zu diesen Handbüchern