[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make manual and +/- as prefix character

From: Luke Shumaker
Subject: Re: make manual and +/- as prefix character
Date: Wed, 29 Dec 2010 03:49:05 -0500

On Wed, 2010-12-29 at 10:12 +0330, ali hagigat wrote:
> Would you please explain the use of +/- as a prefix character? How
> they are used and what make will do based on these characters?
> Why the manual does not explain them clearly and separately?

`-' is explained in section 5.5: Errors in Recipes
> To ignore errors in a recipe line, write a ‘-’ at the beginning of the
> line's text (after the initial tab). The ‘-’ is discarded before the
> line is passed to the shell for execution.
> For example,
>      clean:
>              -rm -f *.o
> This causes make to continue even if rm is unable to remove a file.

`+' is explained in section 9.3: Instead of Executing Recipes
> The ‘-n’, ‘-t’, and ‘-q’ options do not affect recipe lines that begin
> with ‘+’ characters or contain the strings ‘$(MAKE)’ or ‘${MAKE}’.
> Note that only the line containing the ‘+’ character or the strings
> ‘$(MAKE)’ or ‘${MAKE}’ is run regardless of these options. Other lines
> in the same rule are not run unless they too begin with ‘+’ or contain
> ‘$(MAKE)’ or ‘${MAKE}’ (See How the MAKE Variable Works.)

+ is also mentioned in section 5.7.1: How the MAKE Variable Works

They are a little hard to find in the manual if you don't know what
you're looking for.

~ LukeShu

reply via email to

[Prev in Thread] Current Thread [Next in Thread]