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: Erik Cato
Subject: Re: Preprocessing files with make
Date: 28 Aug 2004 06:36:11 -0700

Michael Chastain <mec.gnu@mindspring.com> wrote in message 
news:<mailman.1963.1092932135.2011.help-gnu-utils@gnu.org>...
> 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

Yes, you have the quesion right! Now does anyone have a solution?

/Erik


reply via email to

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