[haiku-development] Re: adding yasm to jam rules

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 29 Mar 2009 16:41:34 +0200

On 2009-03-29 at 10:54:41 [+0200], David McPaul <dlmcpaul@xxxxxxxxx> wrote:
> 2009/3/29 PulkoMandy <pulkomandy@xxxxxxxxx>:
> > 2009/3/29 David McPaul <dlmcpaul@xxxxxxxxx>:
> >> I am trying to add yasm to the jam rules so I can compile asm sources 
> >> using it.

In the context of Haiku's build system?

> >> I added a actions like so
> >>
> >> actions assemble_yasm
> >> {
> >>  yasm -f elf -o $(1) $(2)
> >> }
> >>
> >> then  added to the case statement in Objects
> >> case .nasm : assemble_yasm $(<) : $(>) ;
> >>
> >> $(1) is fine (the output dir/file)
> >> but $(2) seems to be the output dir/source file
> >>
> >> How do I get $(2) to be the source dir/file
[...]
> > what's the problem ? :)
> 
> $(1) has the filename Assembly.o and
> $(2) has the filename Assembly.nasm
> but both $(1) and $(2) point to the generated directory so neither is
> useful as an input file since neither points to the source directory.
> 
> But anyway I worked it out.
> 
> Apparently the trick is to have a rule with the same name as the actions
> The rule get the correct values for $(1) and $(2) and passes them to
> the actions properly.

Actually the only trick is to set the SEARCH and LOCATE variables correctly 
on the source respectively output target. Jam will then invoke the actions 
with the resolved paths.

CU, Ingo

Other related posts: