Products
and Services Support
and Docs Training Partner Programs About Red
Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation

Quick Reference Contents|Index|Previous|Next
Quick reference

This documentation summarizes the directives, text manipulation functions, and special variables which GNU make understands. See Special built-in target names, Catalogue of implicit rules, and Summary of options for other discusssions.

The following is a summary of the directives GNU make recognizes.
 

    define variable
    endef

    ifdef variable
    ifndef variable
    ifeq (a,b)
    ifeq "a" "b"
    ifeq 'a' 'b'
    ifneq (a,b)
    ifneq "a" "b"
    ifneq 'a' 'b'
    else
    endif

    include file

    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. See The override directive.

    export

    export variable
    export variable= value
    export variable:= value
    export variable+= value
    unexport variable

    vpath pattern path

    vpath pattern

      Remove all search paths previously specified for pattern.

    vpath

      Remove all search paths previously specified in any vpath directive.
     

    $(subst from, to, text)

    $(patsubst pattern, replacement, text)

    $(strip string)

    $(findstring find, text)

    $(filter pattern...,text)

    $(filter-out pattern...,text)

    $(sort list)

    $(dir names...)

    $(notdir names...)

    $(suffix names...)

    $(basename names...)

    $(addsuffix suffix, names...)

    $(addprefix prefix, names...)

    $(join list1, list2)

    $(word n, text)

    $(words text)

    $(firstword names ...)

    $(wildcard pattern ...)

    $(shell command)

    $(origin variable)

      Return a string describing how the make variable, variable, was defined. See The origin function.

    $(foreach var, words, text)

      Evaluate text with var bound to each word in words, and concatenate the results. See The foreach function.
     
      The following is a summary of the automatic variables. See 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 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 Using make to update archive files). The value of $ˆ omits duplicate dependencies while $+ retains them and preserves their order.

    $*

    $(@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 $?.
     
The following variables are used specially by GNU make

Top|Contents|Index|Previous|Next

 

 


 
© 2001 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat