# What is in all in a Makefile?

1. Mar 17, 2008

### Eus

What is "::" in "all::" in a Makefile?

Hi Ho!

Executing GNU Make:

If Makefile only contains the following lines,

Code (Text):

all:
echo $@ it will produce Code (Text): echo all all If Makefile only contains the following lines, Code (Text): all:: echo$@

it will still produce

Code (Text):

echo all
all

But, if Makefile only contains the following lines,

Code (Text):

all:::
echo \$@

it will produce

Code (Text):

Makefile:1: *** missing target pattern.  Stop.

all: is just the usual way. all::: is an error.
all:: is the mystery that I don't know.

I know, all:| exists for order-only execution.
But, all:: is not documented in GNU Make texinfo.

Does any of you know what the use of all:: is?

Thank you.

Best regards,
Eus

2. Mar 17, 2008

### mgb_phys

I think it is being intepreted as "all:" followed by an empty target "blank:"
but "all:::" would have 2 targets "blank:" targets the same.

3. Mar 17, 2008

### D H

Staff Emeritus
all: is an ordinary (i.e., single-colon) rule. You can have only one 'all:' rule in a makefile (exception: you can have multiple dependency-only rules for the same target). all:: is a double-colon rule. You can have as many of these as you want in a makefile, but you cannot mix ordinary and double-colon rules.

'man make' doesn't say much. Use 'info make' instead. This is the make.info section on double-colon rules (type 'info make double-colon' on the UNIX command line):

Last edited: Mar 17, 2008
4. Mar 18, 2008

### Eus

Yes, you are right! Thank you very much for telling me that it is called double-colon rule and it is documented in the texinfo file.

Best regards,
Eus