[Cook] stupid questions

Jerry Pendergraft jerry at endocardial.com
Tue Dec 17 01:09:24 EST 2002


I think the key component to your solution it to introduce
"results" recipe[s] and dependencies. 
Here is example for running unit test.

%0%/lib%1.a : res/lib%1.ES
{  /bin/sh -c "\'lib%1/unit_test\;echo $? > [target]\'"; }

libA/foo.o : res/libA.ES;
libB/ack.o : res/libB.ES;

And similar for other "test" dependencies.

Having said that, it seems there must be a more straightforward way to do
what you want. 
You mentioned that each step depends on information gathered by previous
steps. If so store that in a file and make successive step both read and
be dependant on that file. 
Of course using a naming convention such that pattern recipes can deal with it.

Another idea is to use "cascade" dependencies, possibly generated on the fly.
You can probably completely eliminate the need to concatenate the .h files
by using cascade dependencies.

On Mon, 16 Dec 2002, Aryeh M. Friedman wrote:

> 
> There is something that it seems like cook whould be able to do but
> I can not figure out how:
> 
> Files:
> 
> src/libA
> 	foo.cpp
> 	unit_test.cpp
> 
> src/libB
> 	ack.cpp (includes include/libA.h)
> 	unit_test.cpp
> 
> prog/progA
> 	progA.cpp (includes include/libA.h and include/libB.h)
> 	testA.cpp
> 
> include
> 	foo.h
> 	ack.h
> 
> What cook needs to do (in this EXACT order):
> 
> 1) compile libA/foo.cpp
> 2) compile libA/unit_test.cpp into libA/unit_test and run libA/unit_test if 
>    it has an exit status except 0 terminate cook
> 3) build/install the libA.a file from foo.o and put it in lib/libA.a
> 4) concatinate all header files for libA (include/foo.h) into include/libA.h
> 
> then and ONLY then do:
> 
> 5) compile libB/ack.cpp
> 6) compile libB/unit_test.cpp into libB/unit_test and run libB/unit_test if 
>    it has an exit status except 0 terminate cook
> 7) build/install the libB.a file from ack.o and put it in lib/libB.a
> 8) concatinate all header files for libB (include/ack.h) into include/libA.h
> 
> finally:
> 
> 9) compile progA/progA.cpp
> 10) link progA/progA.o against lib/libA.a and lib/libB.a produce progA/porgA
>    and copy it to bin/progA
> 11) repeat step 9 and 10 for progA/testA
> 12) run bin/testA and if it has exit status other then 0 terminate cook
> 
> steps 10 onwards other tasks
> 
> Now here are the issues:
> 
> 1) I can hardcode the above just fine but ANY attempt to softcode any of
> the linkage between steps 1-4 and 5-8 causes the steps to go 1->5->3->7->4->8
> .... as I said they MUST BE DONE in the EXACT order as listed above because
> some of the files (namely include/libA.h and include/libB.h components
> are made based on data already known from previous recipes which CAN NOT
> be known if the recipes are done out of order)
> 
> 2) The only algrothemically provable linkage between lib/libA.a and lib/libB.a
> is lib/libA.h
> 
> 3) All components of libB will tail if libA is not complete constructed
> 
> How do I solve these 3 issyes?


> _______________________________________________
> Cook-users mailing list
> Cook-users at auug.org.au
> http://www.auug.org.au/mailman/listinfo/cook-users
> 


-- 
Jerry Pendergraft                        jerry.pendergraft at endocardial.com
Endocardial Solutions                    voice: 651-523-6935
1350 Energy Lane, Suite 110                fax: 651-644-7897
St Paul, MN 55108-5254






More information about the Cook-users mailing list