Skip to contentSkip to conversation

build: remove unnecessary assignments from Makefile.target

PATCH In review Paolo Bonzini 3 participants 3 messages Feb 15, 2019 – Feb 18, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: remove unnecessary assignments from Makefile.target

It is only necessary to clear block-obj-y because Makefile.objs uses "+=" instead of "="; fix that and remove the assignment. The other variables need not be cleared at all.

---
 Makefile.objs   | 2 +-
 Makefile.target | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)
Makefile.objs +1 -1
index c3a2354..e5cc928 100644
@@ -22,7 +22,7 @@ slirp-obj-$(CONFIG_SLIRP) = slirp/
 #######################################################################
 # block-obj-y is code used by both qemu system emulation and qemu-img
 
-block-obj-y += nbd/
+block-obj-y = nbd/
 block-obj-y += block.o blockjob.o job.o
 block-obj-y += block/ scsi/
 block-obj-y += qemu-io-cmds.o
Makefile.target +0 -4
index a56a72f..06b44c0 100644
@@ -174,10 +174,6 @@ endif # CONFIG_SOFTMMU
 dummy := $(call unnest-vars,,obj-y)
 all-obj-y := $(obj-y)
 
-block-obj-y :=
-common-obj-y :=
-chardev-obj-y :=
-slirp-obj-y :=
 include $(SRC_PATH)/Makefile.objs
 dummy := $(call unnest-vars,.., \
                block-obj-y \
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Paolo Bonzini

It is only necessary to clear block-obj-y because Makefile.objs uses "+=" instead of "="; fix that and remove the assignment. The other variables need not be cleared at all.

Quoted 34 lines
---
  Makefile.objs   | 2 +-
  Makefile.target | 4 ----
  2 files changed, 1 insertion(+), 5 deletions(-)
Makefile.objs +1 -1
index c3a2354..e5cc928 100644
@@ -22,7 +22,7 @@ slirp-obj-$(CONFIG_SLIRP) = slirp/
  #######################################################################
  # block-obj-y is code used by both qemu system emulation and qemu-img
 
-block-obj-y += nbd/
+block-obj-y = nbd/
  block-obj-y += block.o blockjob.o job.o
  block-obj-y += block/ scsi/
  block-obj-y += qemu-io-cmds.o
Makefile.target +0 -4
index a56a72f..06b44c0 100644
@@ -174,10 +174,6 @@ endif # CONFIG_SOFTMMU
  dummy := $(call unnest-vars,,obj-y)
  all-obj-y := $(obj-y)
 
-block-obj-y :=
-common-obj-y :=
-chardev-obj-y :=
-slirp-obj-y :=
  include $(SRC_PATH)/Makefile.objs
  dummy := $(call unnest-vars,.., \
                 block-obj-y \