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

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

Re: Preprocessing files with make


From: Michael Chastain
Subject: Re: Preprocessing files with make
Date: Thu, 19 Aug 2004 12:11:18 -0400
User-agent: nail 10.8 6/28/04

erik.cato@japro.se (Erik Cato) wrote:
> #------------------------------------------------------
> VPATH    = $(COMMON_SRC_DIRS) 
> SRCS     = $(foreach dir,$(VPATH),$(wildcard $(dir)/*.c))
> PREPROCS = $(notdir $(patsubst %.c,%.d,$(SRCS)))

So far so good.

Now you have a list of SRCS, such as "alpha.c beta.c gamma.c"
and a list of PREPROCS, such as "alpha.d beta.d gamma.d".
And you want "make" to behave as if you had these dependencies:

  alpha.d: alpha.c
  beta.d: beta.c
  gamma.d: gamma.c

I don't know how to do that either.  If anybody does know,
I'd like to know, too!

Gnu Make supports pattern rules with '%' in them:

  %.d: %.c

However this is not as flexible, and pattern rules interact poorly
if you have another dependency rules for the same files.

Michael




reply via email to

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