<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Palatino Linotype" size=4></FONT> </DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>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</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype"
size=4></FONT></SPAN> </DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>/*
create a list of dependencies from the .o to the .cpp</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>loop
local cppName = [match_mask %0%.cpp [manifest]] {</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>
/* grab the basename of the file */</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>
objName = [basename [cppName]];</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>
/* create a dependency */</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>
[objName]_cpp = [cppName];<BR>}<BR></DIV></FONT></SPAN>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>%.o:
%.o_cpp {</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype" size=4>
echo [target];</FONT></SPAN></DIV>
<DIV><SPAN class=237473621-07022008><FONT face="Palatino Linotype"
size=4>}</DIV></FONT></SPAN>
<DIV><FONT face="Palatino Linotype" size=4></FONT> </DIV>
<DIV><FONT face="Palatino Linotype" size=4>Mike</FONT> </DIV>
<P><FONT face="Courier New" size=1>2008 - The Year of The Rockies</FONT> </P>
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
cook-users-bounces+michael.d.henderson=lmco.com@auug.org.au
[mailto:cook-users-bounces+michael.d.henderson=lmco.com@auug.org.au] <B>On
Behalf Of </B>Ryan Thompson<BR><B>Sent:</B> Thursday, February 07, 2008 4:27
PM<BR><B>To:</B> cook-users@auug.org.au<BR><B>Subject:</B> [Cook] wildcard
question<BR><BR></FONT></DIV>Hi,<BR><BR>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/ <BR><BR>At this point
in my file I have variables set up like this<BR><BR><BR>manifest = File1.cpp
../module/File2.cpp subdir/File3.cpp<BR><BR>obj = obj/File1.o obj/File2.o
obj/File3.o<BR><BR>%0%.o: <BR>{<BR> test1 =
[match_mask %.cpp [manifest]];<BR> echo
test1;<BR>}<BR><BR><BR>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. <BR><BR>I would like to be able to do something with
a wildcard inside the recipe, like: <BR> test1 =
[match_mask *%.cpp [manifest]];<BR><BR>Is this possible? Is there another
approach I should try? <BR><BR>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,<BR><BR>-Ryan Thompson<BR></BODY></HTML>