Go to the previous, next section.

Quick Reference

This appendix summarizes the directives, text manipulation functions, and special variables which GNU make understands. See section Special Built-in Target Names, section Catalogue of Implicit Rules, and section Summary of Options, for other summaries.

Here is a summary of the directives GNU make recognizes:

@
@

Define a multi-line, recursively-expanded variable. See section Defining Canned Command Sequences.

@
@
@
@
@
@
@
@
@
@

Conditionally evaluate part of the makefile. See section Conditional Parts of Makefiles.

@

Include another makefile. See section Including Other Makefiles.

@
@
@
@
@

Define a variable, overriding any previous definition, even one from the command line. @xref{Override Directive, ,The

}override Directive}.

@

Tell make to export all variables to child processes by default. @xref{Variables/Recursion, , Communicating Variables to a Sub

}make}.

@
@
@
@
@
Tell make whether or not to export a particular variable to child processes. @xref{Variables/Recursion, , Communicating Variables to a Sub

}make}.

@
Specify a search path for files matching a `%' pattern. @xref{Selective Search, , The

}vpath Directive}.

@
Remove all search paths previously specified for pattern.

@
Remove all search paths previously specified in any vpath directive.

Here is a summary of the text manipulation functions (see section Functions for Transforming Text):

@
Replace from with to in text. See section Functions for String Substitution and Analysis.

@
Replace words matching pattern with replacement in text. See section Functions for String Substitution and Analysis.

@
Remove excess whitespace characters from string. See section Functions for String Substitution and Analysis.

@
Locate find in text. See section Functions for String Substitution and Analysis.

@
Select words in text that match one of the pattern words. See section Functions for String Substitution and Analysis.

@
Select words in text that do not match any of the pattern words. See section Functions for String Substitution and Analysis.

@
Sort the words in list lexicographically, removing duplicates. See section Functions for String Substitution and Analysis.

@
Extract the directory part of each file name. See section Functions for File Names.

@
Extract the non-directory part of each file name. See section Functions for File Names.

@
Extract the suffix (the last `.' and following characters) of each file name. See section Functions for File Names.

@
Extract the base name (name without suffix) of each file name. See section Functions for File Names.

@
Append suffix to each word in names. See section Functions for File Names.

@
Prepend prefix to each word in names. See section Functions for File Names.

@
Join two parallel lists of words. See section Functions for File Names.

@
Extract the nth word (one-origin) of text. See section Functions for File Names.

@
Count the number of words in text. See section Functions for File Names.

@
Extract the first word of names. See section Functions for File Names.

@
Find file names matching a shell file name pattern (not a `%' pattern). @xref{Wildcard Function, ,The Function

}wildcard}.

@

Execute a shell command and return its output. @xref{Shell Function, , The

}shell Function}.

@

Return a string describing how the make variable variable was defined. @xref{Origin Function, , The

}origin Function}.

@

Evaluate text with var bound to each word in words, and concatenate the results. @xref{Foreach Function, ,The

}foreach Function}.

Here is a summary of the automatic variables. See section Automatic Variables, for full information.

@
The file name of the target.

@
The target member name, when the target is an archive member.

@
The name of the first dependency.

@
The names of all the dependencies that are newer than the target, with spaces between them. For dependencies which are archive members, only the member named is used (see section Using make to Update Archive Files).

@
@
The names of all the dependencies, with spaces between them. For dependencies which are archive members, only the member named is used (see section Using make to Update Archive Files). The value of $^ omits duplicate dependencies, while $+ retains them and preserves their order.

@
The stem with which an implicit rule matches (see section How Patterns Match).

@
@
The directory part and the file-within-directory part of $@.

@
@
The directory part and the file-within-directory part of $*.

@
@
The directory part and the file-within-directory part of $%.

@
@
The directory part and the file-within-directory part of $<.

@
@
The directory part and the file-within-directory part of $^.

@
@
The directory part and the file-within-directory part of $+.

@
@
The directory part and the file-within-directory part of $?.

These variables are used specially by GNU make:

@

Makefiles to be read on every invocation of make. @xref{MAKEFILES Variable, ,The Variable

}MAKEFILES}.

@

Directory search path for files not found in the current directory. @xref{General Search, ,

}VPATH Search Path for All Dependencies}.

@

The name of the system default command interpreter, usually `/bin/sh'. You can set SHELL in the makefile to change the shell used to run commands. See section Command Execution.

@

The name with which make was invoked. Using this variable in commands has special meaning. @xref{MAKE Variable, ,How the

}MAKE Variable Works}.

@

The number of levels of recursion (sub-makes). See section Communicating Variables to a Sub-make.

@

The flags given to make. You can set this in the environment or a makefile to set flags. @xref{Options/Recursion, ,Communicating Options to a Sub

}make}.

@

The default list of suffixes before make reads any makefiles.

Go to the previous, next section.