From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files To: Bob Feng ,devel@edk2.groups.io From: "PierreGondois" X-Originating-Location: Cambridge, England, GB (86.177.220.244) X-Originating-Platform: Mac Chrome 77 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sun, 15 Dec 2019 16:33:56 -0800 References: <08650203BA1BD64D8AD9B6D5D74A85D161580924@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D161580924@SHSMSX104.ccr.corp.intel.com> Message-ID: <31102.1576456436915029176@groups.io> Content-Type: multipart/alternative; boundary="4bMmxWqb3dHFzT39B6er" --4bMmxWqb3dHFzT39B6er Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Bob, > I think if we can describe the dependency between source files in INF fi= le. For example, > [Sources.IA32] >=C2=A0 =C2=A0asl_source.asl >=C2=A0 =C2=A0c_source.c | asl_source.asl This looks good to me! Would it be possible to have multiple dependencies = on one file (1), or would it be limited to one file only (2)? Maybe having multiple dependencies like in (1) would make it easier to rea= d: Example (1): [Sources.IA32] asl_source_1.asl asl_source_2.asl c_source.c | asl_source_1.asl | asl_source_2.asl Example (2): [Sources.IA32] asl_source_1.asl asl_source_2.asl | asl_source_1.asl c_source.c | asl_source_2 > The build tool will generate the dependency that says c_source.c depend = on the output of asl_source.asl in Makefile? > What do you think? Would there be a rule in the Makefile on c_source.c or on c_source.obj? An= d how can we describe a dependency on the output of asl_source.asl? What I thought was that the resulting Makefile dependencies would look lik= e this: (a) c_source.obj: asl_source.aml The dependencies between the source files would be converted to Makefile d= ependencies between their corresponding output format (cf edk2/BaseTools/Co= nf/build_rule.template). E.g.: a dependency on a '.dts' file would be converted to a dependency on = a '.dtb' file. Dependencies on file extensions without output format would trigger an err= or. E.g.: no dependency on '.h' would be allowed. The issue with what I am suggesting is that in my case, I am compiling a '= .asl' file into a '.hex' file using the iASL compiler with the '-tc' option= . This '.hex' file is included in a '.c' file. This means that the dependen= cy is actually between the output of the compiled '.asl' file (so the '.hex= ' file), and the '.c' file. I.e.: the 'true' dependency is (b) c_source.c: asl_source.hex However, making edk2 know that the asl_source.asl will produce asl_source.= hex will lead to modification to the Conf/build_rule.txt, wich is not a goo= d idea neither I believe. Having (a) instead of (b) should be simpler to obtain, even though less co= rrect. I don't know what you think about what format should have/ * the target of the Makefile rule (c_source.c or c_source.obj?) * the prerequisites of the Makefile rule (asl_source.?) > Would you submit a BZ to track this issue? Yes, I will do it at the beginning of the week. Please tell me what do you think, Regards, Pierre --4bMmxWqb3dHFzT39B6er Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hello Bob,
 
> I think if we can describe the dependency between source files i= n INF file. For example,
> [Sources.IA32]
>   asl_source.asl
>   c_source.c | asl_source.asl
This looks good to me! Would it be possible to have multiple dependen= cies on one file (1), or would it be limited to one file only (2)?
Maybe having multiple dependencies like in (1) would make it easier t= o read:
 
Example (1):
[Sources.IA32]
  asl_source_1.asl
  asl_source_2.asl
  c_source.c | asl_source_1.asl | asl_source_2.asl
 
Example (2):
  [Sources.IA32]
  asl_source_1.asl
  asl_source_2.asl | asl_source_1.asl
  c_source.c | asl_source_2
 
 
> The build tool will generate the dependency that says c_source.c= depend on the output of asl_source.asl in Makefile?
> What do you think?
Would there be a rule in the Makefile on c_source.c or on c_source.ob= j? And how can we describe a dependency on the output of asl_source.asl?
 
What I thought was that the resulting Makefile dependencies would loo= k like this:
(a) c_source.obj: asl_source.aml
 
The dependencies between the source files would be converted to Makef= ile dependencies between their corresponding output format (cf edk2/BaseToo= ls/Conf/build_rule.template).
E.g.: a dependency on a '.dts' file would be converted to a dependenc= y on a '.dtb' file.
 
Dependencies on file extensions without output format would trigger a= n error.
E.g.: no dependency on '.h' would be allowed.
 
The issue with what I am suggesting is that in my case, I am compilin= g a '.asl' file into a '.hex' file using the iASL compiler with the '-tc' o= ption. This '.hex' file is included in a '.c' file. This means that the dep= endency is actually between the output of the compiled '.asl' file (so the = '.hex' file), and the '.c' file.
I.e.: the 'true' dependency is
(b) c_source.c: asl_source.hex
However, making edk2 know that the asl_source.asl will produce asl_so= urce.hex will lead to modification to the Conf/build_rule.txt, wich is not = a good idea neither I believe.
 
Having (a) instead of (b) should be simpler to obtain, even though le= ss correct.
I don't know what you think about what format should have/
* the target of the Makefile rule (c_source.c or c_source.obj?)
* the prerequisites of the Makefile rule (asl_source.?)
 
> Would you submit a BZ to track this issue?
Yes, I will do it at the beginning of the week.
 
Please tell me what do you think,
 
Regards,
Pierre
--4bMmxWqb3dHFzT39B6er--