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

  • From: David McPaul <dlmcpaul@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 29 Mar 2009 19:54:41 +1100

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.
>>
>> 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
>>
>> --
>> Cheers
>> David
>>
>>
>
>  yasm -f elf -o $(2) $(1)
>
> 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.

-- 
Cheers
David

Other related posts: