[Cook] recursive descent cook problem

Mike Mayers mmayers at jaleco.com
Fri Aug 15 13:59:29 EST 2003


Im having trouble getting my recursive descent cookfile working
I also need per platform configurable output paths

I currently get this error (on linux or cygwin)
cook: src/util/math_expression.obj dont know how
cook: cookfile: 29 "magnum" not derived due to errors deriving
"src/util/math_expression.obj"

i guess the problem is this rule:
[ObjDir]/%0%.obj: [SrcDir]/%0%.cpp

I also tried these rules 
%.obj: %.cpp
and
[ObjDir]/%.obj: [SrcDir]/%0%.cpp

begin cook file
///////////////////////////////////////////////////////////////////
Platform = ;
SrcDir = src;
ObjDir = obj;

SourceTree = [stripdot [collect find [SrcDir] -print] ];
CPPSources = [match_mask %0%.cpp [SourceTree]];
CPPSources = [fromto %0%.cpp %0%.obj [CPPSources]];
CPPObjects = [patsubst [SrcDir]/%.obj [ObjDir]/%.obj [CPPSources]];
MagnumDir  = /projects/magnum;

Includes = -I [MagnumDir] -I [MagnumDir]/src -I ExtInc/STLPort-4.5.3/stlport
-I ExtInc;
Options = -g -O0 -fpermissive -fno-rtti -fno-common -w -D
BUILDING_GRANNY_STATIC;

CPPFlags = [Includes] [Options];

function compile_cpp = 
{
	src = [@1];
	obj = [@2];
	gcc [CPPFlags] -c [src] -o [obj];
}

[ObjDir]/%0%.obj: [SrcDir]/%0%.cpp
/*%.obj: %.cpp*/	
{
	[compile_cpp [SrcDir]/%0%.cpp [target]];
}

magnum: [CPPObjects]
{
	gcc [CPPObjects] -o magnum;
}

all:
	magnum;
///////////////////////////////////////////////////////////////////
End cookfile	

thanks,

mtm

Michael T. Mayers
Senior Engineer
Jaleco Entertainment
mmayers at jaleco.com
michael at tweakoz.com 



More information about the Cook-users mailing list