[Cook] Problem with dependencies

Henderson, Michael D michael.d.henderson at lmco.com
Mon Nov 14 13:58:51 EST 2005


I am having an issue with getting the build order straight for a couple
of libraries I am using. It may not be the smartest approach in the
world, but I have a couple of class libraries hanging under my source
tree (eg, [prjRoot]/src/bar). As part of the build rule for my
libraries, they install themselves to [prjRoot]/lib and their header
files to [prjRoot]/include/[libName]/ (where libName would be bar in
this case). I have a global cc flag option of -I[prjRoot]/include to
point my other files there (they do something like #include
<bar/bar.hpp>).

The problem is that when I first do a cook on a clean source tree it
builds the hpp_dep files. Since the libraries are built after that the
hpp_dep files don't point to the right include file - in fact they
ignore my [prjRoot]/include. That seems logical since that directory
doesn't hold the includes until after the libraries are built. But it
means that cook doesn't recognize that the files actually do depend on
these new header files.

My workaround is to specifically make the libraries first (cook
lib/libbar.a etc). The library and includes are installed. I then do a
recursive delete of all of my hpp_dep files. When they're recreated they
point to the right include file and everything builds properly.

I don't update the libraries too often or run cook clobber very often
either. It's just that everytime I do I forget to do the workaround.
That's something I don't think anyone can help me with :)

I guess that what I'm trying to figure out is if there is a way to build
the libraries first then automatically rebuild all of the hpp_dep files
so they'll pick up the dependency. I think that the first half of that
question is as simple as adding in [all_libraries] as a dependency in my
[prjRoot]/bin/%: rule. Can anyone point me to where in the manual I can
start to track down the answer to the second part?

Thanks,
Mike

.i le temci cu denpa no lo prenu
	- Jessica Shewell Brockway

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


More information about the Cook-users mailing list