<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>RE: [Cook] Problem with dependencies</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>
<P><FONT SIZE=2>> -----Original Message-----<BR>
> From: cook-users-bounces+jpendergraft=sjm.com@auug.org.au on behalf of Henderson, Michael D<BR>
> Sent: Sun 13-Nov-05 20:58<BR>
> To: cook-users@auug.org.au<BR>
> Subject: [Cook] Problem with dependencies<BR>
<BR>
> I am having an issue with getting the build order straight for a couple<BR>
> of libraries I am using. It may not be the smartest approach in the<BR>
> world, but I have a couple of class libraries hanging under my source<BR>
> tree (eg, [prjRoot]/src/bar). As part of the build rule for my<BR>
> libraries, they install themselves to [prjRoot]/lib and their header<BR>
> files to [prjRoot]/include/[libName]/ (where libName would be bar in<BR>
> this case). I have a global cc flag option of -I[prjRoot]/include to<BR>
> point my other files there (they do something like #include<BR>
> <bar/bar.hpp>).<BR>
<BR>
> The problem is that when I first do a cook on a clean source tree it<BR>
> builds the hpp_dep files. Since the libraries are built after that the<BR>
> hpp_dep files don't point to the right include file - in fact they<BR>
> ignore my [prjRoot]/include. That seems logical since that directory<BR>
> doesn't hold the includes until after the libraries are built. But it<BR>
> means that cook doesn't recognize that the files actually do depend on<BR>
> these new header files.<BR>
You have identified the problem in the hpp_dep files. You probably need to generate (as cascade dependencies if not already) you dep file such that they reference the includes in their installed location. You then need a recipe to install them separate from the library build rule. By having the cascade dependencies saying that<BR>
lib/lib%1.a : obj/%1/file1.o obj/%1/file2.o<BR>
obj/%1/%2.o : src/%1/%2.cpp<BR>
src/%1/%2.cpp : include/%1/xxx.hpp<BR>
<BR>
The latter being what you generate in the dep files as the cascade form.<BR>
<BR>
Once you have that then cook will generate the dep files first, then see that before compiling any objects it must install the hpp file over in include and invoke that recipe to do so. Only then will it compile anything, and since it needs all the objects before making a library it will do that in the right order too. The key is to *always* express products in terms of their components so cook knows it has to build the components before invoking the recipe for the product.<BR>
<BR>
> Thanks,<BR>
> Mike<BR>
<BR>
hope that helps<BR>
<BR>
> .i le temci cu denpa no lo prenu<BR>
> - Jessica Shewell Brockway<BR>
<BR>
Jerry Pendergraft voice:651-523-6935<BR>
St.Jude Medical mobil:651-491-0163<BR>
Atrial Fibrillation Division email:jpendergraft@sjm.com<BR>
1350 Energy Lane<BR>
St.Paul, MN 55108<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
</FONT>
</P>
</BODY>
</HTML>