[Cook] stupid questions

Aryeh M. Friedman aryeh at m-net.arbornet.org
Tue Dec 17 00:13:34 EST 2002


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?



More information about the Cook-users mailing list