GNU make error: "multiple target patterns"

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

GNU make error: "multiple target patterns"

Post 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-%)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply