make: Splitting Lines

1 
1 3.1.1 Splitting Long Lines
1 --------------------------
1 
1 Makefiles use a "line-based" syntax in which the newline character is
1 special and marks the end of a statement.  GNU 'make' has no limit on
1 the length of a statement line, up to the amount of memory in your
1 computer.
1 
1    However, it is difficult to read lines which are too long to display
1 without wrapping or scrolling.  So, you can format your makefiles for
1 readability by adding newlines into the middle of a statement: you do
1 this by escaping the internal newlines with a backslash ('\') character.
1 Where we need to make a distinction we will refer to "physical lines" as
1 a single line ending with a newline (regardless of whether it is
1 escaped) and a "logical line" being a complete statement including all
1 escaped newlines up to the first non-escaped newline.
1 
1    The way in which backslash/newline combinations are handled depends
1 on whether the statement is a recipe line or a non-recipe line.
11 Handling of backslash/newline in a recipe line is discussed later (⇒
 Splitting Recipe Lines).
1 
1    Outside of recipe lines, backslash/newlines are converted into a
1 single space character.  Once that is done, all whitespace around the
1 backslash/newline is condensed into a single space: this includes all
1 whitespace preceding the backslash, all whitespace at the beginning of
1 the line after the backslash/newline, and any consecutive
1 backslash/newline combinations.
1 
1    If the '.POSIX' special target is defined then backslash/newline
1 handling is modified slightly to conform to POSIX.2: first, whitespace
1 preceding a backslash is not removed and second, consecutive
1 backslash/newlines are not condensed.
1