*Note Sequences::.`ifdef VARIABLE' `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.`include FILE' Include another makefile.`override VARIABLE = VALUE' `override VARIABLE := VALUE' `override VARIABLE += VALUE' `override define VARIABLE' `endef' Define a variable, overriding any previous definition, even one from the command line. `export' Tell `make' to export all variables to child processes by default.`export VARIABLE' `export VARIABLE = VALUE' `export VARIABLE := VALUE' `export VARIABLE += VALUE' `unexport VARIABLE' Tell `make' whether or not to export a particular variable to child processes. `vpath PATTERN PATH' Specify a search path for files matching a `%' pattern. *Note The `vpath' Directive: Selective Search.`vpath PATTERN' Remove all search paths previously specified for PATTERN.`vpath' Remove all search paths previously specified in any `vpath' directive. 6.2.函數 `$(subst FROM,TO,TEXT)' Replace FROM with TO in TEXT.`$(patsubst PATTERN,REPLACEMENT,TEXT)' Replace Words matching PATTERN with REPLACEMENT in TEXT.`$(strip STRING)' Remove excess whitespace characters from STRING.`$(findstring FIND,TEXT)' Locate FIND in TEXT.`$(filter PATTERN...,TEXT)' Select words in TEXT that match one of the PATTERN words.`$(filter-out PATTERN...,TEXT)' Select words in TEXT that *do not* match any of the PATTERN words.`$(sort LIST)' Sort the words in LIST lexicographically, removing duplicates.`$(dir NAMES...)' Extract the directory part of each file name.`$(notdir NAMES...)' Extract the non-directory part of each file name.`$(suffix NAMES...)' Extract the suffix (the last `.' and following characters) of each file name.`$(basename NAMES...)' Extract the base name (name without suffix) of each file name.`$(addsuffix SUFFIX,NAMES...)' Append SUFFIX to each word in NAMES.`$(addprefix PREFIX,NAMES...)' Prepend PREFIX to each word in NAMES.`$(join LIST1,LIST2)' Join two parallel lists of words.`$(word N,TEXT)' Extract the Nth word (one-origin) of TEXT.`$(words TEXT)' Count the number of words in TEXT.`$(firstword NAMES...)' Extract the first word of NAMES.`$(wildcard PATTERN...)' Find file names matching a shell file name pattern (*not* a `%' pattern).`$(shell COMMAND)' Execute a shell command and return its output.`$(origin VARIABLE)' Return a string describing how the `make' variable VARIABLE was defined.`$(foreach VAR,WORDS,TEXT)' Evaluate TEXT with VAR bound to each word in WORDS, and
concatenate the results. 6.3.自動變量 `$@' 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 with spaces between them. For dependencies which are archive members, only the member named is used `$^' `$+' The names of all the dependencies, with spaces between them. For dependencies which are archive members, only the member named is used. The value of `$^' omits duplicate dependencies, while `$+' retains them and preserves their order.`$*' The stem with which an implicit rule matches `$(@D)' `$(@F)' The directory part and the file-within-directory part of `$@'.`$(*D)' `$(*F)' The directory part and the file-within-directory part of `$*'.`$(%D)' `$(%F)' The directory part and the file-within-directory part of `$%'`$(<D)' `$(<F)' The directory part and the file-within-directory part of `$<'`$(^D)' `$(^F)' The directory part and the file-within-directory part of `$^'`$(+D)' `$(+F)' The directory part and the file-within-directory part of `$+'`$(?D)' `$(?F)' The directory part and the file-within-directory part of `$?' 6.4.非凡變量 `MAKEFILES' Makefiles to be read on every invocation of `make'.`VPATH' Directory search path for files not found in the current directory.`SHELL' 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. `MAKE' The name with which `make' was invoked. Using this variable in commands has special meaning. `MAKELEVEL' The number of levels of recursion (sub-`make's).`MAKEFLAGS' The flags given to `make'. You can set this in the environment or a makefile to set flags.`SUFFIXES' The default list of suffixes before `make' reads any makefiles.