[openbeos] Re: building not so custom targets

  • From: "Andrew Bachmann" <shatty@xxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 25 Dec 2003 13:25:14 -0800 PST

BTW Jérôme,

There are two alternative solutions you could also pursue.  One is to
use the File rule to copy the original input and use the copy as the
source for one of the addons.  I think that's a little yucky, although it
is simple.

The second solution is to use a rule that will apply the macro 
pre-processor to your input file and generate another file that
is already pre-processed, and use that as your source for the
addons.  The easiest way to do that would probably be to use the
GenFile rule, although I don't know if it is the best way:

GenFile prog1-file.c : gcc -E -DPROG1 prog.c
R5KernelAddon prog1 : bin : prog1-file.c ;

GenFile prog2-file.c : gcc -E -DPROG2 prog.c
R5KernelAddon prog2 : bin : prog2-file.c ;

I don't usually go about using the macro pre-processor alone
so perhaps the invokation is improper.


Other related posts: