f78
Quick Reference
The following is a summary of the directives GNU
The following is a summary of the text manipulation functions (see
The following is a summary of the automatic variables. See
$+
$(@F)
$(*F)
$(%F)
$(<F)
$(ˆF)
$(+F)
$(?F)
The following variables are used specially by GNU
MAKEFILES
See
endef
Define a multi-line, recursively-expanded variable.
See Defining Canned Command Sequences.
ifndef variable
ifeq (a,b)
ifeq “a” “b”
ifeq ’a’ ’b’
ifneq (a,b)
ifneq “a” “b”
ifneq ’a’ ’b’
else
endif
Conditionally evaluate part of the makefile. See Conditional Parts of Makefiles.
Include another makefile. See Including Other Makefiles.
override variable:= value
override variable+= value
override define variable
endef
Define a variable, overriding any previous definition, even one from the
command line. See The override Directive.
Tell make to export all variables to child processes by default. See Communicating Variables to a Sub-make.
export variable= value
export variable:= value
export variable+= value
unexport variable
Tell make whether or not to export a particular variable to child processes. See Communicating Variables to a Sub-make.
Specify a search path for files matching a ‘%’ pattern. See The vpath Directive.
Remove all search paths previously specified for pattern.
Remove all search paths previously specified in any vpath directive.
Replace from with to in text. See Functions for String Substitution and Analysis.
Replace words matching pattern wi
ffb
th replacement in text. See Functions for String Substitution and Analysis.
Remove excess whitespace characters from string. See Functions for String Substitution and Analysis.
Locate find in text. See Functions for String Substitution and Analysis.
Select words in text that match one of the pattern words. See Functions for String Substitution and Analysis.
Select words in text that do not match any of the pattern words. See Functions for String Substitution and Analysis.
Sort the words in list lexicographically, removing duplicates. See Functions for String Substitution and Analysis.
Extract the directory part of each file name. See Functions for File Names.
Extract the non-directory part of each file name. See Functions for File Names.
Extract the suffix (the last ‘.’ and following characters) of each file name. See Functions for File Names.
Extract the base name (name without suffix) of each file name. See Functions for File Names.
Append suffix to each word in names. See Functions for File Names.
Prepend prefix to each word in names. See Functions for File Names.
Join two parallel lists of words. See Functions for File Names.
Extract the nth word (one-origin) of text. See Functions for File Names.
Count the number of words in text. Functions for File Names.
Extract the first word of names. See Functions for File Names.
Find file names matching a shell file name, pattern (not a ‘%’ pattern). See The Function, wildcard.
Execute a shell command and return its output. See The shell Function.
Return a string describing how the make variable, variable, was defined. See The origin Function.
Evaluate text with var bound to each word in words, and concatenate the results. See The foreach Function.
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 Using make to Update Archive Files).
The stem with which an implicit rule matches (see 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 $ˆ.
Directory search path for files not found in the current directory.
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 Command Execution.
The name with which make was invoked. Using this variable in commands has special meaning. See How the MAKE Variable Works.
The number of levels of recursion (sub-makes). See Communicating Variables to a Sub-make.
The flags given to make. You can set this in the environment or a makefile to set flags. Communicating Variables to a Sub-make.
The default list of suffixes before make reads any makefiles.