Skip to contentSkip to conversation

Makefile: Let the 'help' target list the helper targets

PATCH Applied Philippe Mathieu-Daudé 3 participants 5 messages Apr 23, 2020 – Aug 18, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Let the 'help' target list the helper targets

List the name of the helper targets when calling 'make help', along with the tool targets:

  $ make help
  [...]

Helper targets:

    fsdev/virtfs-proxy-helper      - Build virtfs-proxy-helper
    scsi/qemu-pr-helper            - Build qemu-pr-helper
    qemu-bridge-helper             - Build qemu-bridge-helper
    vhost-user-gpu                 - Build vhost-user-gpu
    virtiofsd                      - Build virtiofsd

Tools targets:

    qemu-ga                        - Build qemu-ga tool
    qemu-keymap                    - Build qemu-keymap tool
    elf2dmp                        - Build elf2dmp tool
    ivshmem-client                 - Build ivshmem-client tool
    ivshmem-server                 - Build ivshmem-server tool
    qemu-nbd                       - Build qemu-nbd tool
    qemu-storage-daemon            - Build qemu-storage-daemon tool
    qemu-img                       - Build qemu-img tool
    qemu-io                        - Build qemu-io tool
    qemu-edid                      - Build qemu-edid tool
---
 configure | 5 +++--
 Makefile  | 9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
configure +3 -2
index 23b5e93752..caf880c38e 100755
@@ -6374,7 +6374,7 @@ if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
     if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
       virtfs=yes
-      tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
+      helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)"
     else
       if test "$virtfs" = yes; then
         error_exit "VirtFS requires libcap-ng devel and libattr devel"
@@ -6389,7 +6389,7 @@ if test "$softmmu" = yes ; then
       fi
       mpath=no
     fi
-    tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+    helpers="$helpers scsi/qemu-pr-helper\$(EXESUF)"
   else
     if test "$virtfs" = yes; then
       error_exit "VirtFS is supported only on Linux"
@@ -7630,6 +7630,7 @@ else
   QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
 fi
 
+echo "HELPERS=$helpers" >> $config_host_mak
 echo "TOOLS=$tools" >> $config_host_mak
 echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
Makefile +7 -2
index 8a9113e666..021a0cd491 100644
@@ -336,9 +336,9 @@ $(call set-vpath, $(SRC_PATH))
 LIBS+=-lz $(LIBS_TOOLS)
 
 vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += vhost-user-gpu$(EXESUF)
@@ -1255,6 +1255,11 @@ endif
 		$(foreach t, $(TARGET_DIRS), \
 		$(call print-help-run,$(t)/all,Build for $(t));) \
 		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
+		echo '')
 	@$(if $(TOOLS), \
 		echo 'Tools targets:'; \
 		$(foreach t, $(TOOLS), \
Signature · 1 line
2.21.1
#1 lore raw

Ping?

Quoted 90 lines · Philippe Mathieu-Daudé

List the name of the helper targets when calling 'make help', along with the tool targets:

   $ make help
   [...]

Helper targets:

     fsdev/virtfs-proxy-helper      - Build virtfs-proxy-helper
     scsi/qemu-pr-helper            - Build qemu-pr-helper
     qemu-bridge-helper             - Build qemu-bridge-helper
     vhost-user-gpu                 - Build vhost-user-gpu
     virtiofsd                      - Build virtiofsd

Tools targets:

     qemu-ga                        - Build qemu-ga tool
     qemu-keymap                    - Build qemu-keymap tool
     elf2dmp                        - Build elf2dmp tool
     ivshmem-client                 - Build ivshmem-client tool
     ivshmem-server                 - Build ivshmem-server tool
     qemu-nbd                       - Build qemu-nbd tool
     qemu-storage-daemon            - Build qemu-storage-daemon tool
     qemu-img                       - Build qemu-img tool
     qemu-io                        - Build qemu-io tool
     qemu-edid                      - Build qemu-edid tool
---
  configure | 5 +++--
  Makefile  | 9 +++++++--
  2 files changed, 10 insertions(+), 4 deletions(-)
configure +3 -2
index 23b5e93752..caf880c38e 100755
@@ -6374,7 +6374,7 @@ if test "$softmmu" = yes ; then
    if test "$linux" = yes; then
      if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
        virtfs=yes
-      tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
+      helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)"
      else
        if test "$virtfs" = yes; then
          error_exit "VirtFS requires libcap-ng devel and libattr devel"
@@ -6389,7 +6389,7 @@ if test "$softmmu" = yes ; then
        fi
        mpath=no
      fi
-    tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+    helpers="$helpers scsi/qemu-pr-helper\$(EXESUF)"
    else
      if test "$virtfs" = yes; then
        error_exit "VirtFS is supported only on Linux"
@@ -7630,6 +7630,7 @@ else
    QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
  fi
 
+echo "HELPERS=$helpers" >> $config_host_mak
  echo "TOOLS=$tools" >> $config_host_mak
  echo "ROMS=$roms" >> $config_host_mak
  echo "MAKE=$make" >> $config_host_mak
Makefile +7 -2
index 8a9113e666..021a0cd491 100644
@@ -336,9 +336,9 @@ $(call set-vpath, $(SRC_PATH))
  LIBS+=-lz $(LIBS_TOOLS)
 
  vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
  ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
  HELPERS-y += vhost-user-gpu$(EXESUF)
@@ -1255,6 +1255,11 @@ endif
  		$(foreach t, $(TARGET_DIRS), \
  		$(call print-help-run,$(t)/all,Build for $(t));) \
  		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
+		echo '')
  	@$(if $(TOOLS), \
  		echo 'Tools targets:'; \
  		$(foreach t, $(TOOLS), \
Reviewed-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 25 lines · Philippe Mathieu-Daudé

List the name of the helper targets when calling 'make help', along with the tool targets:

  $ make help
  [...]

Helper targets:

    fsdev/virtfs-proxy-helper      - Build virtfs-proxy-helper
    scsi/qemu-pr-helper            - Build qemu-pr-helper
    qemu-bridge-helper             - Build qemu-bridge-helper
    vhost-user-gpu                 - Build vhost-user-gpu
    virtiofsd                      - Build virtiofsd

Tools targets:

    qemu-ga                        - Build qemu-ga tool
    qemu-keymap                    - Build qemu-keymap tool
    elf2dmp                        - Build elf2dmp tool
    ivshmem-client                 - Build ivshmem-client tool
    ivshmem-server                 - Build ivshmem-server tool
    qemu-nbd                       - Build qemu-nbd tool
    qemu-storage-daemon            - Build qemu-storage-daemon tool
    qemu-img                       - Build qemu-img tool
    qemu-io                        - Build qemu-io tool
    qemu-edid                      - Build qemu-edid tool
Quoted 5 lines
---
 configure | 5 +++--
 Makefile  | 9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 80 lines · Philippe Mathieu-Daudé

List the name of the helper targets when calling 'make help', along with the tool targets:

  $ make help
  [...]

Helper targets:

    fsdev/virtfs-proxy-helper      - Build virtfs-proxy-helper
    scsi/qemu-pr-helper            - Build qemu-pr-helper
    qemu-bridge-helper             - Build qemu-bridge-helper
    vhost-user-gpu                 - Build vhost-user-gpu
    virtiofsd                      - Build virtiofsd

Tools targets:

    qemu-ga                        - Build qemu-ga tool
    qemu-keymap                    - Build qemu-keymap tool
    elf2dmp                        - Build elf2dmp tool
    ivshmem-client                 - Build ivshmem-client tool
    ivshmem-server                 - Build ivshmem-server tool
    qemu-nbd                       - Build qemu-nbd tool
    qemu-storage-daemon            - Build qemu-storage-daemon tool
    qemu-img                       - Build qemu-img tool
    qemu-io                        - Build qemu-io tool
    qemu-edid                      - Build qemu-edid tool
---
 configure | 5 +++--
 Makefile  | 9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
configure +3 -2
index 23b5e93752..caf880c38e 100755
@@ -6374,7 +6374,7 @@ if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
     if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
       virtfs=yes
-      tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
+      helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)"
     else
       if test "$virtfs" = yes; then
         error_exit "VirtFS requires libcap-ng devel and libattr devel"
@@ -6389,7 +6389,7 @@ if test "$softmmu" = yes ; then
       fi
       mpath=no
     fi
-    tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+    helpers="$helpers scsi/qemu-pr-helper\$(EXESUF)"
   else
     if test "$virtfs" = yes; then
       error_exit "VirtFS is supported only on Linux"
@@ -7630,6 +7630,7 @@ else
   QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
 fi
 
+echo "HELPERS=$helpers" >> $config_host_mak
 echo "TOOLS=$tools" >> $config_host_mak
 echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
Makefile +2 -2
index 8a9113e666..021a0cd491 100644
@@ -336,9 +336,9 @@ $(call set-vpath, $(SRC_PATH))
 LIBS+=-lz $(LIBS_TOOLS)
 
 vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += vhost-user-gpu$(EXESUF)
@@ -1255,6 +1255,11 @@ endif
 		$(foreach t, $(TARGET_DIRS), \

Makefile endif · line 1265

Quoted 10 lines
Makefile +5 -0
 		$(call print-help-run,$(t)/all,Build for $(t));) \
 		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
+		echo '')
 	@$(if $(TOOLS), \
 		echo 'Tools targets:'; \
 		$(foreach t, $(TOOLS), \

Queued, thanks.

Paolo

#4 lore raw
In reply to Philippe Mathieu-Daudé

Hi Mirek,

Quoted 45 lines · Philippe Mathieu-Daudé

List the name of the helper targets when calling 'make help', along with the tool targets:

  $ make help
  [...]

Helper targets:

    fsdev/virtfs-proxy-helper      - Build virtfs-proxy-helper
    scsi/qemu-pr-helper            - Build qemu-pr-helper
    qemu-bridge-helper             - Build qemu-bridge-helper
    vhost-user-gpu                 - Build vhost-user-gpu
    virtiofsd                      - Build virtiofsd

Tools targets:

    qemu-ga                        - Build qemu-ga tool
    qemu-keymap                    - Build qemu-keymap tool
    elf2dmp                        - Build elf2dmp tool
    ivshmem-client                 - Build ivshmem-client tool
    ivshmem-server                 - Build ivshmem-server tool
    qemu-nbd                       - Build qemu-nbd tool
    qemu-storage-daemon            - Build qemu-storage-daemon tool
    qemu-img                       - Build qemu-img tool
    qemu-io                        - Build qemu-io tool
    qemu-edid                      - Build qemu-edid tool
---
 configure | 5 +++--
 Makefile  | 9 +++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)
configure +1 -1
index 23b5e93752..caf880c38e 100755
@@ -6374,7 +6374,7 @@ if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
     if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
       virtfs=yes
-      tools="$tools fsdev/virtfs-proxy-helper\$(EXESUF)"
+      helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)"
     else
       if test "$virtfs" = yes; then
         error_exit "VirtFS requires libcap-ng devel and libattr devel"

configure if test "$softmmu" = yes ; then · line 6392

Quoted 5 lines
configure +1 -1
@@ -6389,7 +6389,7 @@ if test "$softmmu" = yes ; then
       fi
       mpath=no
     fi
-    tools="$tools scsi/qemu-pr-helper\$(EXESUF)"
+    helpers="$helpers scsi/qemu-pr-helper\$(EXESUF)"

Paolo said on IRC this patch didn't follow the recommendation from https://www.mail-archive.com/[email protected]/msg524586.html
and moved qemu-pr-helper from /usr/bin to /usr/libexec.

FYI virtfs-proxy-helper might be also affected.

Quoted 40 lines
configure +1 -0
   else
     if test "$virtfs" = yes; then
       error_exit "VirtFS is supported only on Linux"
@@ -7630,6 +7630,7 @@ else
   QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES"
 fi
 
+echo "HELPERS=$helpers" >> $config_host_mak
 echo "TOOLS=$tools" >> $config_host_mak
 echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
Makefile +7 -2
index 8a9113e666..021a0cd491 100644
@@ -336,9 +336,9 @@ $(call set-vpath, $(SRC_PATH))
 LIBS+=-lz $(LIBS_TOOLS)
 
 vhost-user-json-y =
-HELPERS-y =
+HELPERS-y = $(HELPERS)
 
-HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) = qemu-bridge-helper$(EXESUF)
+HELPERS-$(call land,$(CONFIG_SOFTMMU),$(CONFIG_LINUX)) += qemu-bridge-helper$(EXESUF)
 
 ifeq ($(CONFIG_LINUX)$(CONFIG_VIRGL)$(CONFIG_GBM)$(CONFIG_TOOLS),yyyy)
 HELPERS-y += vhost-user-gpu$(EXESUF)
@@ -1255,6 +1255,11 @@ endif
 		$(foreach t, $(TARGET_DIRS), \
 		$(call print-help-run,$(t)/all,Build for $(t));) \
 		echo '')
+	@$(if $(HELPERS-y), \
+		echo 'Helper targets:'; \
+		$(foreach t, $(HELPERS-y), \
+		$(call print-help-run,$(t),Build $(shell basename $(t)));) \
+		echo '')
 	@$(if $(TOOLS), \
 		echo 'Tools targets:'; \
 		$(foreach t, $(TOOLS), \