When a target is a file, it needs to be recompiled or relinked if any of its prerequisites change.
Targets that do not refer to files but are just actions are called phony targets.
====================================================================
Cited from 2.3 How make Processes a Makefile
By default, make starts with the first target. This is called the default goal.
====================================================================
Cited from 2.6 Another Style of Makefile
When the objects of a makefile are created only by implicit rules, an alternative style of makefile is possible. In this style of makefile, you group entries by their prerequisites instead of by their targets.
====================================================================
Cited from 3.1 What Makefiles Contain
Makefiles contain five kinds of things: explicit rules, implicit rules, variable definitions, directives, and comments.
An implicit rule says when and how to remake a class of files based on their names. It describes how a target may depend on a file with a name similar to the target and gives a recipe to create or update such a target.
- Reading another makefile
- Deciding (based on the values of variables) whether to use or ignore a part of the makefile (see Conditional Parts of Makefiles).
- Defining a variable from a verbatim string containing multiple lines (see Defining Multi-Line Variables).
====================================================================
Cited from 3.1.1 Splitting Long Lines
The way in which backslash/newline combinations are handled depends on whether the statement is a recipe line or a non-recipe line. Handling of backslash/newline in a recipe line is discussed later (see Splitting Recipe Lines).
Cited from 3.1.1 Splitting Long Lines
The way in which backslash/newline combinations are handled depends on whether the statement is a recipe line or a non-recipe line. Handling of backslash/newline in a recipe line is discussed later (see Splitting Recipe Lines).
====================================================================
Cited from 3.2 What Name to Give Your Makefile
By default, when make looks for the makefile, it tries the following names, in order: GNUmakefile, makefile and Makefile.
====================================================================
Cited from 3.3 Including Other Makefiles
Cited from 3.3 Including Other Makefiles
include filenames…
filenames can contain shell file name patterns. If filenames is empty, nothing is included and no error is printed. If the file names contain any variable or function references, they are expanded.
If the specified name does not start with a slash, and the file is not found in the current directory, several other directories are searched. First, any directories you have specified with the ‘-I’ or ‘--include-dir’ option are searched (see Summary of Options). Then the following directories (if they exist) are searched, in this order: prefix/include (normally /usr/local/include)/usr/gnu/include, /usr/local/include, /usr/include.
filenames can contain shell file name patterns. If filenames is empty, nothing is included and no error is printed. If the file names contain any variable or function references, they are expanded.
If you want
message, use the -include directive instead of include, like this:
-include filenames…
For compatibility with some other make implementations, sinclude is another name for -include.
====================================================================
Cited from 3.7 How make Reads a Makefile
make
to simply ignore a makefile which does not exist or cannot be remade, with no errormessage, use the -include directive instead of include, like this:
-include filenames…
For compatibility with some other make implementations, sinclude is another name for -include.
====================================================================
Cited from 3.7 How make Reads a Makefile
====================================================================
Cited from 3.8 Secondary Expansion
No comments:
Post a Comment