user5184385
user5184385

Reputation:

Not able to disable SUFFIXES in makefile

From the docs:

If you wish to eliminate the default known suffixes instead of just adding to them, write a rule for '.SUFFIXES' with no prerequisites. By special dispensation, this eliminates all existing prerequisites of '.SUFFIXES'. You can then write another rule to add the suffixes you want. For example,

 .SUFFIXES:            # Delete the default suffixes
 .SUFFIXES: .c .o .h   # Define our suffix list

Trying the following makefile:

.c.o:
    @echo done

.SUFFIXES::

all.o: phony

all.c:

.PHONY: phony

Running Make, i get:

done

Even though, I disabled suffixes, by .SUFFIXES::.

By the way, for some reason, it works in version 3.81, where I get:

make: Nothing to be done for `all.o'.

Upvotes: 0

Views: 70

Answers (1)

MadScientist
MadScientist

Reputation: 101081

Documentation says: .SUFFIXES:

You wrote: .SUFFIXES::

Remove the extra colon and it will work.

Upvotes: 1

Related Questions