[openbeos] Re: building not so custom targets

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Thu, 25 Dec 2003 23:47:04 +0100

On 2003-12-25 at 22:25:14 [+0100], Andrew Bachmann wrote:
> 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 ;

No, that's definitely not the best way. GenFile should be used in cases 
where the command to execute is itself a target of the build system, like 
for instance Matthijs' resources compiler in our build system. GenFile 
makes it a dependency of the target to generate.

CU, Ingo

Other related posts: