Commit c1865bbd166eed8913afe3b66c8b28b7c83a46fc

Authored by Simon Glass
Committed by Bin Meng
1 parent 5e99fde34a

x86: Avoid writing temporary asl files into the source tree

At present the iasl tool (Intel ACPI (Advanced Configuration and Power
Interface) Source Language Compiler) is called in such a way that it uses
the source directory for its temporary files.

This means we end up with these files when building x86 boards:

   board/dfi/dfi-bt700/dsdt.aml
   board/dfi/dfi-bt700/dsdt.asl.tmp

Update the code to put temporary files in the target directory instead.

The iasl tool is quite confusing since it generates files with different
extensions and does not allow these to be individually specified. Add some
documentation to help with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: remove dsdt.hex from 'make clean' rules and correct U-Boot spelling]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>

Showing 1 changed file with 14 additions and 3 deletions Side-by-side Diff

scripts/Makefile.lib
... ... @@ -395,11 +395,22 @@
395 395  
396 396 # ACPI
397 397 # ---------------------------------------------------------------------------
  398 +#
  399 +# This first sends the file (typically dsdt.asl) through the preprocessor
  400 +# resolve includes and any CONFIG options used. This produces dsdt.asl.tmp
  401 +# which is pure ASL code. The Intel ASL (ACPI (Advanced Configuration and Power
  402 +# Interface) Source Language compiler (iasl) then converts this ASL code into a
  403 +# C file containing the hex data to build into U-Boot. This file is called
  404 +# dsdt.hex (despite us setting the prefix to .../dsdt.asl.tmp) so must be
  405 +# renamed to dsdt.c for consumption by the build system.
  406 +ASL_TMP = $(patsubst %.c,%.asl.tmp,$@)
  407 +
398 408 quiet_cmd_acpi_c_asl= ASL $<
399 409 cmd_acpi_c_asl= \
400   - $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) -o $<.tmp $<; \
401   - iasl -p $< -tc $<.tmp $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
402   - mv $(patsubst %.asl,%.hex,$<) $@
  410 + $(CPP) -x assembler-with-cpp -D__ASSEMBLY__ -P $(UBOOTINCLUDE) \
  411 + -o $(ASL_TMP) $< && \
  412 + iasl -p $@ -tc $(ASL_TMP) $(if $(KBUILD_VERBOSE:1=), >/dev/null) && \
  413 + mv $(patsubst %.c,%.hex,$@) $@
403 414  
404 415 $(obj)/dsdt.c: $(src)/dsdt.asl
405 416 $(call cmd,acpi_c_asl)