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: 18 Aug 2004 22:52:09 -0700

"Gisle Vanem" <giva@users.sourceforge.net> wrote in message 
news:<412344cb$1@news.broadpark.no>...
> "Erik Cato" wrote:
> 
> > Im trying to preprocess a group o files with the help of make but
> > I have no luck. I think I may have overlooked some very important
> > issue.
> > 
> > What i have is a group of souce files (.c and .h) organizied somewhat
> > like this:
> > 
> > +-Source -+- Dir1
> >           +- Dir2
> >           +- Dir3
> > 
> > What I want to do is to search the directorys for C files and
> > preprocess them to get a new set of files in a new directory
> > "proprocessed" or similar.
> 
> Have a look at the powerful builtin functions in GNU make.
> E.g.
>   SRC = $(wildcard Source/Dir1/*.c) \
>            $(wildcard Source/Dir2/*.c) \
>            $(wildcard Source/Dir3/*.c)
> 
> gets you the files. To make a list of preprocessed files (whatever 
> that means in your case):
>   PP_SRC = $(addprefix preprocessed/, $(notdir $(SRC)))
> 
> --gv


Thanks for the reply but perhaps I was a little unclear. The problem I have is 
to make the rule to preprocess the files. 

E.i what i want is this
source/dir1/source.c -> preprocessed/source.d

The easy party is to construct a variable wich contain the source files
and preprocessed files but i dont know how to use them.

I hope my intent is clear now. I think this is a trivial task for someone 
with a great knowledge of make then I have.

Thanks,
Erik


reply via email to

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