[Cook] Recipe for Gentle Compiler

Henderson, Michael D michael.d.henderson at lmco.com
Wed Sep 22 02:51:55 EST 2004


Just to prove that I'm not crazy, here are the rules that I'm using to compile the files. This assumes that they are in the current directory and the source file is calc.g.

/*=======================================================
 * rule to force a C source file to compile in the current directory
 */
%0%.o: %0%.c: [collect c_incl -api [inc_all] %0%.c]
{
  [c++] [c++_flags] -c %0%.c -o [target];
}

/*=======================================================
 * rule to compile a gentle file in the correct directory
 */
calc.y calc.c gen.lit gen.tkn gen.h: calc.g:
{
  [cmd_gentle] calc.g;
  mv gen.y calc.y;
}

/*=======================================================
 * rule to reflex a file in the correct directory
 */
calc.l: calc.g gen.lit gen.tkn Number.t:
{
  [cmd_reflex];
  mv gen.l calc.l;
}

/*=======================================================
 * run lex against reflex output
 */
lex.yy.c: calc.l
{
  [lex] calc.l;
}

/*=======================================================
 * run yacc against gentle output
 */
y.tab.c: calc.y
{
  [yacc] calc.y;
}




More information about the Cook-users mailing list