Page 1 of 1

GNU make error: "multiple target patterns"

Posted: Sun Nov 03, 2013 4:59 pm
by ^rooker
[PROBLEM]
I tried to add targets to a makefile for ffmpeg's FATE test suite, when I ran into the problem that "make fate" refused my changes with the following error message:
"multiple target patterns"
[SOLUTION]
In my code I had copy/pasted some lines that create Makefile targets, which ended with a trailing backslash because they were multiline statements.

The following code block was the culprit:

Code: Select all

FATE_FFV1_LEVEL1 := $(FATE_FFV1_LEVEL1:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL1:%=fate-ffv1-dec-%) \
FATE_FFV1_LEVEL3 := $(FATE_FFV1_LEVEL3:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL3:%=fate-ffv1-dec-%) \
To fix this problem, either add a blank line between these 2 variable assignments:

Code: Select all

FATE_FFV1_LEVEL1 := $(FATE_FFV1_LEVEL1:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL1:%=fate-ffv1-dec-%) \

FATE_FFV1_LEVEL3 := $(FATE_FFV1_LEVEL3:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL3:%=fate-ffv1-dec-%) \
...or remove the trailing backslash at the end of each statement's last line.

Code: Select all

FATE_FFV1_LEVEL1 := $(FATE_FFV1_LEVEL1:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL1:%=fate-ffv1-dec-%)
FATE_FFV1_LEVEL3 := $(FATE_FFV1_LEVEL3:%=fate-ffv1-enc-%) \
                    $(FATE_FFV1_LEVEL3:%=fate-ffv1-dec-%)