[Cook] two questions

Brendan J Simon brendan.simon at bigpond.com
Wed Oct 30 09:56:56 EST 2002


Aryeh M. Friedman wrote:

>First keep in mind I am very new to cook (have had it for 2 days but
>just now figured out how to customize the whole project cooked recipes
>to my project... BTW even though I still a total newbie even for a small
>subset of my project it has proven MANY MANY times smarter then make [I
>got sick of forgeting what libs needed to be recombiled if I modifed some
>deeply nested dependcy in a very low level lib).  I have some questions:
>
I too am not a cook expert.  In defense of GNU Make, surely the problem 
is specifiying the dependencies correctly then all dependencies should 
get built automatically.  This is true also of cook.  You have to 
specify the dependencies correctly to have correct builds.

>1) My project has a "main" project and a set of "coding tools" as a 
>secondary project (all the source code in both projects is unique to
>my project) and the cooked process of the "main" project requires that
>the tools be present.  How do I tell "recursive" to cook the tools FIRST 
>then main project (the two dirs are tools and src respectivally).
>
Specify that the main project depends ton your coding tools and cook 
will make sure they are built first before builing your main project.

BTW, Recursively calling Cook (or Make or any other DMT) is genereally 
considered bad.  Have a look at Peter Miller's short paper titled 
"Recursive Make Considered Harmful".

>2) Preferable I whould like to have one top level Howto.cook that does
>not need to call other cooks recursively.  One reason I am not doing this
>for .o files I can not figure out how to tell it that C files (.c) ARE NOT
>the same as (.cpp) files [something like c_src = [fromto %0%.c %0%.o ...]
>and cpp_src = [fromto %0%.cpp %0%.o ...] but neither seems to work the
>way I expect them to])
>
>	A) If at all possible I want to make this a "included" file so
>	that I can just put a stub Howto.cook in each dir that will just
>	cook that dir [using the SAME recipes as the "master" cook does].
>	I.e. make it so all recipes are guernteed to work as they whould
>	in "real life" except just for a subproject.
>
I haven't done this with Cook, but with Make I have a makefile fragment 
(module.mk) in each directory which is included by the SINGLE top level 
Makefile.  I've set it up so that I can have a Makefile in any directory 
and it will include module.mk which will control including any 
subdirectory module.mk files and so on.  Alternatively, my subdirectory 
makefiles can workout the dependencies (eg. "make all" includes all 
module.mk files and sets the ALL variable), figures out the real top 
level Makefile and calls it as "make $(ALL)".

I'm sure a similar thing can be done with cook.  There maybe even a 
smarter "cook" way of doing this ??

Regards,
Brendan Simon.




More information about the Cook-users mailing list