Karl
Karl

Reputation: 3113

How can i get second variable in gnu make targets

Currently i have this

test.%:
        echo $*

I want to do something like

test.%.%:
        echo $1 && echo $2

Is it possible to fo like that

Upvotes: 0

Views: 54

Answers (1)

teadotjay
teadotjay

Reputation: 1455

You can only have one wildcard per pattern, but you can further process the pattern to extract the information you want. For your example above, this would work:

test.%:
    echo $(basename $*) && echo $(subst .,,$(suffix $*))

Upvotes: 2

Related Questions