[Cook] wildcard question

Henderson, Michael D michael.d.henderson at lmco.com
Fri Feb 8 08:42:52 EST 2008


 
Ryan, my druthers are to put the .o files in the source because I tend
to use the same .cpp name a lot. For example, I always use ctor.cpp and
dtor.cpp for constructors and destructors. But you can separate the two.
Something like
 
/* create a list of dependencies from the .o to the .cpp
loop local cppName = [match_mask %0%.cpp [manifest]] {
  /* grab the basename of the file */
  objName = [basename [cppName]];
  /* create a dependency */
  [objName]_cpp = [cppName];
}

%.o: %.o_cpp {
  echo [target];
}
 
Mike 

2008 - The Year of The Rockies 

-----Original Message-----
From: cook-users-bounces+michael.d.henderson=lmco.com at auug.org.au
[mailto:cook-users-bounces+michael.d.henderson=lmco.com at auug.org.au] On
Behalf Of Ryan Thompson
Sent: Thursday, February 07, 2008 4:27 PM
To: cook-users at auug.org.au
Subject: [Cook] wildcard question


Hi,

I am a new user of cook, trying to get a simple build set up. I have
.cpp sources coming from various directories, but I would like to keep
all my .o files in one place, in ./obj/ 

At this point in my file I have variables set up like this


manifest = File1.cpp ../module/File2.cpp subdir/File3.cpp

obj = obj/File1.o obj/File2.o obj/File3.o

%0%.o: 
{
       test1 = [match_mask %.cpp [manifest]];
       echo test1;
}


If I do 'cook obj/File1.o' the recipe works as expected. For the other
two, match_mask doesn't match the .cpp file name with a path on the
front of the file name. 

I would like to be able to do something with a wildcard inside the
recipe, like: 
      test1 = [match_mask *%.cpp [manifest]];

Is this possible? Is there another approach I should try? 

I know I can just keep the obj files in SRCDIR/obj but I want to know if
the above is possible. Thanks for any help,

-Ryan Thompson

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20080207/b717e57b/attachment.htm>


More information about the Cook-users mailing list