[Cook] to enhance cook

Pendergraft, Jerry JPendergraft at sjm.com
Thu Dec 8 04:16:12 EST 2005


The easiest thing to do for your erlang files is to use sed or perl to filter them such that
-include ("../include/cmmc_config.hrl").     <---------
becomes
#include "../include/cmmc_config.hrl"

Then pipe that through c_incl to create your cascade dep file. So the recipe might be something like (untested):
%0%.erl.d : %0%.erl
{
     perl -ne [quote 'if( m!^-include\s+\(([^\)])\)! ) { print "#include $1\n"; }'] 
      | c_incl [c_incl_args] - > [target];
}
Note that c_incl cares nothing about any lines but include, so you can ignore everything else in your sources.

Jerry Pendergraft                              voice:651-523-6935
St.Jude Medical                                mobil:651-491-0163
Atrial Fibrillation Division                email:jpendergraft at sjm.com
1350 Energy Lane
St.Paul, MN  55108

-----Original Message-----
From: cook-users-bounces+jpendergraft=sjm.com at auug.org.au on behalf of Dietmar Schaefer
Sent: Wed 07-Dec-05 02:47
To: cook-users at auug.org.au
Subject: [Cook] to enhance cook
 
Hi !


O.K. your last tips worked !

Now I would like to enhance cook to  be able to handle  erlang  files !


I had  short look into the c  receipe .

Can someone tell me where I need to change things to get a new erl_incl 
command which can be used by cook ?

Here is a short example of erlang code


-module(cmmc_4dp).

-vsn("1.0").
-export([startall/0,stopall/0,stop/0,start/0]).
-import(cmmc_util,[msleep/1]).


-include ("../include/cmmc_config.hrl").     <---------



-define(MAX_RESTARTS,3).
-define(RESTART_INTERVAL,20).


Should it be possible to write such "helper programs" like c_incl in 
other languages than c ? for example in ruby,perl,python ?


Best regards

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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20051207/f9bab54c/attachment.htm>


More information about the Cook-users mailing list