[Cook] How can I make my cook file stop always generatingdependency files? -- LONG --
Pendergraft, Jerry
JPendergraft at sjm.com
Wed Aug 24 00:44:14 EST 2005
I believe your problem is due to a couple simple things:
1) #include-cooked [pkg_dependencies] should be:
#include-cooked-nowarn [pkg_dependencies]
2) On the dep file recipes
set no-cascade should be
set nocascade
There are also some simplifications you could easily do.
First you don't need 2 recipes for the dep files. You can combine them into one using another pattern match. The following would work for both .cpp .hpp plus .hxx .C .c or anything.
%0%.%1_dep: %0%.%1
set nocascade
{
function Say-Why [__FILE__] [__LINE__];
c_incl --no-cache --no-recurs %0%.%1
-I[dirname %0%.%1] [cpp_incl]
"--prefix='cascade %0%.%1 = '"
"--suffix=';'"
-o [target]
set silent;
}
Second your loop where you define the variables could be:
/* turn the list of packages into a list of libraries */
loop local var_name = [pkg_names]
{
local var_lib = [prepost lib/lib .a [var_name]];
[var_lib]_src = [match_mask [var_name]/%0%.cpp [MANIFEST]];
[var_lib]_hdr = [match_mask [var_name]/%0%.hpp [MANIFEST]];
[var_lib]_xml = [match_mask [var_name]/%0%.xml [MANIFEST]];
[var_lib]_obj = [fromto %0%.cpp %0%.o [[var_lib]_src]];
[var_lib]_dep = [addsuffix _dep [[var_lib]_src]] [[var_lib]_hdr]];
;
function print [var_lib]_src is [[var_lib]_src];
function print [var_lib]_dep is [[var_lib]_dep];
if [count [[var_lib]_obj]] then
{
pkg_libraries += [var_lib];
pkg_dependencies += [[var_lib]_dep];
}
}
Jerry Pendergraft voice:651-523-6935
St.Jude Medical mobil:651-491-0163
Atrial Fibrillation Division email:jpendergraft at sjm.com
1350 Energy Lane
St.Paul, MN 55108
-----Original Message-----
From: cook-users-bounces+jpendergraft=sjm.com at auug.org.au on behalf of Henderson, Michael D
Sent: Mon 22-Aug-05 19:59
To: cook-users at auug.org.au
Subject: [Cook] How can I make my cook file stop always generatingdependency files? -- LONG --
I'm trying to create a cook book based on the sample that uses dependency files in the user's guide. I've got it working, but there are a few things that I don't understand. The cook file is attached, it's long but I don't know which parts to cut out and still make it understandable.
1. When I run a "cook what" to create a dump of my variables so that I can verify what I'm doing, it always re-creates all of my _dep files. I'm pretty sure it's because of this line
#include-cooked [pkg_dependencies]
Is there a way to make that conditional?
2. The sample had the cpp_dep files created with "set no-cascade" and the hpp_dep files created without that. I've tried it both ways and it seems to work, so I guess that I'm not understanding what it is that the no-cascade option does. I've looked at the manual but remain utterly clueless.
3. Why does the hpp_dep rule look at dirname %0%.cpp? Shouldn't it look at %0%.hpp or since it's doing a dirname, does it even matter?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20050823/52518504/attachment.htm>
More information about the Cook-users
mailing list