help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNU make: multiple patterns for prerequisites


From: bocadillodeatun
Subject: GNU make: multiple patterns for prerequisites
Date: Mon, 16 Nov 2009 09:25:18 -0800 (PST)
User-agent: G2/1.0

Hi.

I could not find how to do this on the manual, so any help would be
appreciated.

Given a VPATH variable, if I have somethign like this:

  one.o two.o : %.o :%.c

..."make" will search in the VPATH folders for files named "one.c" and
"two.c" and
compile them.

However, some of my source files can be either ".c" or ".S".

So... is there any way to tell "make" to look in VPATH for files that
match either
one or another ?

Options:

1) one.o two.o : %.o : %.c %.s

    Won't works because "make" will look for "one.c" AND "one.S",
    and only one of them exists.

2) one.o two.o : %.o : %.{c,S}

    Looks good, but "make" won't accept it :)


I know I could first "filter" my files in two groups, and then create
two rules... I was just wondering if this feature can be accessed
by a single rule.

Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]