[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What about the name of the second prerequisite?
From: |
Henrik Carlqvist |
Subject: |
Re: What about the name of the second prerequisite? |
Date: |
Sat, 15 Jun 2019 11:00:46 +0200 |
On Sat, 15 Jun 2019 08:35:13 +0800
Dan Jacobson <address@hidden> wrote:
> (info "(make) Automatic Variables") has
>
> '$<' The name of the first prerequisite...
> '$?' The names of all the prerequisites that are newer than the
> target...'$^' The names of all the prerequisites, with spaces between
> them...'$+' This is like '$^', but prerequisites listed more than once
> are...'$|' The names of all the order-only prerequisites...
>
> OK, OK, OK, OK, OK!
>
> But it really should also mention the official recommended way to (drum
> roll)...
>
> Get the name of the second prerequisite.
I would use the function word for that:
-8<--------------------------
all: dummy
dummy: dummy1 dummy2 dummy3
echo first: $< second: $(word 2, $^) third: $(word 3, $^)
dummy%:
touch $@
-8<--------------------------
regards Henrik