[Cook] How to clobber temp files

Henderson, Michael D michael.d.henderson at lmco.com
Fri Jan 19 12:34:19 EST 2007


I am using lemon to generate a parser. When I run lemon against a .y
file, it creates some files (a .c, .h, and .out) that I would like to
delete when I run a cook clobber. My clobber looks like
	clobber:
	{
	  clean_list = [pkg_binaries] [pkg_dependencies]
[pkg_libraries];
	  if [count [clean_list]] then delete [clean_list] set silent;
	}

I use a loop to add the .y files into my dependency list for programs
that need it
	  [var_bin]_y   = [match_mask src/[var_name]/%0%.y
[MANIFEST]];
	  if [count [[var_bin]_y]] then {
	    [var_bin]_src = [stringset [[var_bin]_src] [fromto %0%.y
%0%.c [[var_bin]_y]]];
	  }

I think that I can create a misc_clean variable and add the .c, .h, and
.out files to it. Something like
	[msc_clean] += [fromto %0%.y  %0%.c  [[var_bin]_y]];
	[msc_clean] += [fromto %0%.y  %0%.h  [[var_bin]_y]];
	[msc_clean] += [fromto %0%.y  %0%.out  [[var_bin]_y]];

And then add [msc_clean] to my clean_list. Does that seem like a safe
and sane thing to do?

Thanks,
Mike Henderson

There are 10 types of people in the world - those who understand the
binary numbering system and those who don't.
	- Unknown





More information about the Cook-users mailing list