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

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

Re: How to Create Pattern Rule in GNUmake for Source from Multiple Place


From: Eli Zaretskii
Subject: Re: How to Create Pattern Rule in GNUmake for Source from Multiple Places?
Date: Thu, 25 Oct 2001 12:01:34 +0200

On 24 Oct 2001, Hon-Chi Ng wrote:

> My C source files are scattered in multiple locations, and I want to
> compile them in a single location.
> 
> How can I create pattern rule in GNUmake to ensure correct rule for
> source-object dependency without explicitly write each rule?

Is VPATH or vpath what you are looking for?

If your GNUmakefile says

  VPATH = /aaa/bbb/ccc:/ddd/eee/fff:/ggg/hhh/iii

then for any prerequisite file it cannot find in the current
directory, GNU Make will look in the directories on that list.

If you want this search to be limited to *.c files only, use vpath,
like this:

  vpath %.c /aaa/bbb/ccc:/ddd/eee/fff:/ggg/hhh/iii




reply via email to

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