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

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 18 Sep 2016 09:41:14 +0200

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?

+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? 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.

+       AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
+       AddVariableToScript $(script) : hostCC : $(HOST_C++) ;
+       AddVariableToScript $(script) : defines : "$(DEFINES)" ;
+       AddVariableToScript $(script) : includePaths : "hello" ;
+
+       local mainScript = generate_kernel_arg_sizes ;
+       SEARCH on $(mainScript) = [ FDirName $(HAIKU_TOP) build scripts ] ;
+
+       Depends $(1) : $(mainScript) $(script) ;
+       KernelArgSizes1 $(1) : $(mainScript) $(script) ;
+}
+
+actions KernelArgSizes1
+{
+       $(2[1]) $(2[2-])
+       $(RM) $(2[2-])
+}

CU, Ingo


Other related posts: