[haiku-development] Re: Change of kernel args struct size...

  • From: Jessica Hamilton <jessica.l.hamilton@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 18 Sep 2016 07:50:55 +0000

On Sun, 18 Sep 2016 7:41 pm Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:

On 09/18/2016 07:59 AM, Jessica Hamilton wrote:
Getting much closer now; I can invoke the script, pass a few variables
along, but I'm stuck at how do I pass on all the include paths and
defines needed to compile correctly?

I missed most of the thread, so I'm not sure what you intend to do, but
if you want to compile stuff, why not use jam?


I have absolutely no idea how to achieve a solution just using jam.

I want a loop from 1 to max kernel arg version, and compute the size of the
kernel args struct for each value.

+rule KernelArgSizes
+{
+       # Usage KernelArgSizes <outputFile> ;
+
+       local outputFile = $(1:D)$(1:B)$(1:S) ;

A shorter version would be "$(1:DBS)". But what are you trying to do?
Remove the grist?


Yes, that's what I'm trying to do. Else the shell script gets horribly
confused.

The grist is part of the target name and at least
MakeLocateDebug requires the correct target name.

+       MakeLocateDebug $(outputFile) ;
+
+       HAIKU_KERNEL_ARG_SIZES_INIT_VARIABLES_SCRIPT =
+               <kernel>generate_kernel_arg_sizes.init ;
+       local script = $(HAIKU_KERNEL_ARG_SIZES_INIT_VARIABLES_SCRIPT) ;
+       MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ;
+       Always $(script) ;
+
+       AddVariableToScript $(script) : sourceFile : $(outputFile) ;

Given that you call MakeLocateDebug for it, this apparently is supposed
to be a target. If so, its path needs to be bound/resolved at some
point. There's AddTargetVariableToScript which would do that, but would
also make the generated script depend on that target. So you might want
to pass it as a first parameter of the actions instead. If it is just a
temporary file produced by the script, I wouldn't declare any target
here, though, but simply choose an appropriate name and location (pass a
directory path, if necessary) in the script itself.


Mm, I was just trying to make the file end up in a reasonable location.
Still don't quite understand how this stuff works :p

Other related posts: