diff mbox

[3/9] pc: rebuild ACPI hex files if included *.dsl are touched

Message ID 1388269852-21198-4-git-send-email-imammedo@redhat.com
State New
Headers show

Commit Message

Igor Mammedov Dec. 28, 2013, 10:30 p.m. UTC
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/i386/Makefile.objs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Michael S. Tsirkin Jan. 8, 2014, 5:47 p.m. UTC | #1
On Sat, Dec 28, 2013 at 11:30:46PM +0100, Igor Mammedov wrote:
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  hw/i386/Makefile.objs | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> index 09ac433..edf5256 100644
> --- a/hw/i386/Makefile.objs
> +++ b/hw/i386/Makefile.objs
> @@ -16,7 +16,12 @@ iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
>  
>  ifdef IASL
>  #IASL Present. Generate hex files from .dsl
> -hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py
> +DSL_DEPS = $(SRC_PATH)/hw/i386/%.dsl \
> +	$(SRC_PATH)/scripts/acpi_extract_preprocess.py \
> +	$(SRC_PATH)/scripts/acpi_extract.py \
> +	$(SRC_PATH)/hw/i386/acpi-dsdt-*.dsl
> +
> +hw/i386/%.hex: $(DSL_DEPS)
>  	$(call quiet-command, cpp -P $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
>  	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, "  ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i")
>  	$(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ,"  IASL $(TARGET_DIR)$*.dsl.i")

It's generally nasty to have rules that generate files already in
the source tree. In partuclar people expect make clean to get
back the original tree.
How about only doing this when some variable is defined?

> -- 
> 1.8.4.2
Igor Mammedov Jan. 9, 2014, 9:25 a.m. UTC | #2
On Wed, 8 Jan 2014 19:47:03 +0200
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Sat, Dec 28, 2013 at 11:30:46PM +0100, Igor Mammedov wrote:
> > Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> > ---
> >  hw/i386/Makefile.objs | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
> > index 09ac433..edf5256 100644
> > --- a/hw/i386/Makefile.objs
> > +++ b/hw/i386/Makefile.objs
> > @@ -16,7 +16,12 @@ iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
> >  
> >  ifdef IASL
> >  #IASL Present. Generate hex files from .dsl
> > -hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py
> > +DSL_DEPS = $(SRC_PATH)/hw/i386/%.dsl \
> > +	$(SRC_PATH)/scripts/acpi_extract_preprocess.py \
> > +	$(SRC_PATH)/scripts/acpi_extract.py \
> > +	$(SRC_PATH)/hw/i386/acpi-dsdt-*.dsl
> > +
> > +hw/i386/%.hex: $(DSL_DEPS)
> >  	$(call quiet-command, cpp -P $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
> >  	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, "  ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i")
> >  	$(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ,"  IASL $(TARGET_DIR)$*.dsl.i")
> 
> It's generally nasty to have rules that generate files already in
> the source tree. In partuclar people expect make clean to get
> back the original tree.
> How about only doing this when some variable is defined?
I'm not sure if I get you, %.hex files in source tree are always rebuilt if IASL
present (i.e. it's just cached copy for IASL-less case).
From my POV as developer if I touched included file then dependent files
must be rebuild even without 'make clean'. Otherwise it would break bisection
for example where stale table is used due to lack of deps.

Patch just fixes a bug in build process, i.e. adds deps on included files.
It's crude but still an improvement over current behavior.

All that said, I don't care much about this patch and can drop it.

> 
> > -- 
> > 1.8.4.2
diff mbox

Patch

diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs
index 09ac433..edf5256 100644
--- a/hw/i386/Makefile.objs
+++ b/hw/i386/Makefile.objs
@@ -16,7 +16,12 @@  iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \
 
 ifdef IASL
 #IASL Present. Generate hex files from .dsl
-hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py
+DSL_DEPS = $(SRC_PATH)/hw/i386/%.dsl \
+	$(SRC_PATH)/scripts/acpi_extract_preprocess.py \
+	$(SRC_PATH)/scripts/acpi_extract.py \
+	$(SRC_PATH)/hw/i386/acpi-dsdt-*.dsl
+
+hw/i386/%.hex: $(DSL_DEPS)
 	$(call quiet-command, cpp -P $< -o $*.dsl.i.orig, "  CPP $(TARGET_DIR)$*.dsl.i.orig")
 	$(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, "  ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i")
 	$(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ,"  IASL $(TARGET_DIR)$*.dsl.i")