Skip to contentSkip to conversation

Makefile: Fix config-devices.mak not regenerated when Kconfig updated

PATCH Superseded Philippe Mathieu-Daudé 2 participants 4 messages Nov 4, 2019 – Nov 5, 2019 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Fix config-devices.mak not regenerated when Kconfig updated

When hw/$DIR/Kconfig is changed, the corresponding generated hw/$DIR/config-devices.mak is not being updated.
Fix this by including all the hw/*/Kconfig files to the prerequisite names of the rule generating the config-devices.mak files.

Fixes e0e312f3525a (build: switch to Kconfig)

---
If OK, I plan to include this fix in the "hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge" pull request.

---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Makefile +4 -1
index 0e994a275d..c1461b21e8 100644
@@ -384,7 +384,10 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \
+                   $(patsubst %,$(SRC_PATH)/hw/%,$(shell sed -ne \
+                                                    's/source \(.*\)/\1/p' \
+                                                    < $(SRC_PATH)/hw/Kconfig))
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_INPUTS) $(BUILD_DIR)/config-host.mak
Signature · 1 line
2.21.0
#1 lore raw
Quoted 20 lines · Philippe Mathieu-Daudé

When hw/$DIR/Kconfig is changed, the corresponding generated hw/$DIR/config-devices.mak is not being updated.
Fix this by including all the hw/*/Kconfig files to the prerequisite names of the rule generating the config-devices.mak files.

Fixes e0e312f3525a (build: switch to Kconfig)

---
If OK, I plan to include this fix in the "hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge" pull request.

---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Makefile +0 -0
index 0e994a275d..c1461b21e8 100644

Makefile MINIKCONF_ARGS = \ · line 390

Quoted 8 lines
Makefile +4 -1
@@ -384,7 +384,10 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \
+                   $(patsubst %,$(SRC_PATH)/hw/%,$(shell sed -ne \
+                                                    's/source \(.*\)/\1/p' \
+                                                    < $(SRC_PATH)/hw/Kconfig))

Why can't we use the simpler wildcard statement:

   $(wildcard $(SRC_PATH)/hw/*/Kconfig)

instead of reading the file names from the hw/Kconfig file ?

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#2 lore raw
Quoted 32 lines · Daniel P. Berrangé
Quoted 20 lines · Philippe Mathieu-Daudé

When hw/$DIR/Kconfig is changed, the corresponding generated hw/$DIR/config-devices.mak is not being updated.
Fix this by including all the hw/*/Kconfig files to the prerequisite names of the rule generating the config-devices.mak files.

Fixes e0e312f3525a (build: switch to Kconfig)

---
If OK, I plan to include this fix in the "hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge" pull request.

---
  Makefile | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
Makefile +0 -0
index 0e994a275d..c1461b21e8 100644

Makefile MINIKCONF_ARGS = \ · line 390

Quoted 8 lines
Makefile +4 -1
@@ -384,7 +384,10 @@ MINIKCONF_ARGS = \
      CONFIG_LINUX=$(CONFIG_LINUX) \
      CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \
+                   $(patsubst %,$(SRC_PATH)/hw/%,$(shell sed -ne \
+                                                    's/source \(.*\)/\1/p' \
+                                                    < $(SRC_PATH)/hw/Kconfig))

Why can't we use the simpler wildcard statement:

Quoted 3 lines
    $(wildcard $(SRC_PATH)/hw/*/Kconfig)

instead of reading the file names from the hw/Kconfig file ?

You might have uncommited Kconfig files, but this shouldn't be a problem, make is only interested in checking the modification time of these files.

Thanks for reviewing, I'll respin.

#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 5 lines · Philippe Mathieu-Daudé

When hw/$DIR/Kconfig is changed, the corresponding generated hw/$DIR/config-devices.mak is not being updated.
Fix this by including all the hw/*/Kconfig files to the prerequisite names of the rule generating the config-devices.mak files.

You can see this tread where Peter reported the failure:
https://lists.gnu.org/archive/html/qemu-devel/2019-11/msg00125.html

How to reproduce:

  $  git checkout next_branch
  $  make i386-softmmu/all
  $  git checkout prev_branch
  $ make clean
  $ make i386-softmmu/all
    # error
  $  make print-MINIKCONF_INPUTS
Quoted 29 lines
Fixes e0e312f3525a (build: switch to Kconfig)

---
If OK, I plan to include this fix in the "hw/i386/pc: Split PIIX3 southbridge from i440FX northbridge" pull request.

---
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Makefile +4 -2
index 0e994a275d..c1461b21e8 100644
@@ -384,7 +384,10 @@ MINIKCONF_ARGS = \
     CONFIG_LINUX=$(CONFIG_LINUX) \
     CONFIG_PVRDMA=$(CONFIG_PVRDMA)
 
-MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig
+MINIKCONF_INPUTS = $(SRC_PATH)/Kconfig.host $(SRC_PATH)/hw/Kconfig \
+                   $(patsubst %,$(SRC_PATH)/hw/%,$(shell sed -ne \
+                                                    's/source \(.*\)/\1/p' \
+                                                    < $(SRC_PATH)/hw/Kconfig))
 MINIKCONF = $(PYTHON) $(SRC_PATH)/scripts/minikconf.py \
 
 $(SUBDIR_DEVICES_MAK): %/config-devices.mak: default-configs/%.mak $(MINIKCONF_INPUTS) $(BUILD_DIR)/config-host.mak
--

2.21.0