From nobody Mon Feb 9 03:12:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1558600062; cv=none; d=zoho.com; s=zohoarc; b=JiBEVvUgtikObfst3oz+t58hGvmUSyPVzBz/N8RCtcN98eWyMarkrRovvWpcCLvbNqdzjNIIGdJk97s7OvcyzkCeSoZ5n7eOgt1rOipH4xgH7Y8F4YttUGAQrDcHPU+PxjosFPideeEIY/C2mHAl617NXAXdYr25IxdvP+BfYU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558600062; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=57MOGlQU662mmH70Fgs+mOADr/u6uood1O5gqUBLAmg=; b=Yigmc5i965ideJf+BWYe46oc4iUmIrO3DB/GtlkaY/h8qMs4CgUSZvh3bfdmZDqWJO9ZOPo9A5xn6Mp7MhBu+C68Ylh/7z56shY1LnuRuLmmXSaHMQ2HXY0V++qklHlFysvDvTNNCOEjlTIZyjk8nI9au+MOQ1UAWjmeatvS4+o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1558600062377468.73548236020963; Thu, 23 May 2019 01:27:42 -0700 (PDT) Received: from localhost ([127.0.0.1]:59728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTj4T-000407-2Z for importer@patchew.org; Thu, 23 May 2019 04:27:29 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTj2U-0002Ev-Hy for qemu-devel@nongnu.org; Thu, 23 May 2019 04:25:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTit8-0000ts-Ph for qemu-devel@nongnu.org; Thu, 23 May 2019 04:15:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38278) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTit8-0000t9-Ii for qemu-devel@nongnu.org; Thu, 23 May 2019 04:15:46 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C68A9330260; Thu, 23 May 2019 08:15:40 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BCB21001E82; Thu, 23 May 2019 08:15:40 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E469F1132B6C; Thu, 23 May 2019 10:15:38 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 23 May 2019 10:15:34 +0200 Message-Id: <20190523081538.2291-4-armbru@redhat.com> In-Reply-To: <20190523081538.2291-1-armbru@redhat.com> References: <20190523081538.2291-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 23 May 2019 08:15:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC v4 3/7] Makefile: Rename targets for make recursion X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We make a few sub-directories recursively, in particular $(TARGET_DIRS). For goal "all", we do it the nice way: "all" has a prerequisite subdir-T for each T in $(TARGET_DIRS), and T's recipe runs make recursively. Behaves nicely with -j and -k. For other goals such as "clean" and "install", the recipe runs make recursively in a for loop. Ignores -j and -k. The next commit will fix that for "clean" and "install". This commit prepares the ground by renaming the targets we use for "all" to include the goal for the sub-make. This will permit reusing them for goals other than "all". Targets subdir-T for T in $(TARGET_DIRS) run "make all" in T. Rename to T/all, and declare phony. Targets romsubdir-R for R in $(ROMS) run "make" in pc-bios/R. Default goal is "all" for all R. Rename to pc-bios/R/all, and declare phony. The remainder are renamed just for consistency. Target subdir-dtc runs "make libbft/libfdt.a" in dtc. Rename to dtc/all, and declare phony. Target subdir-capstone runs make $(BUILD_DIR)/capstone/$(LIBCAPSTONE) in $(SRC_PATH)/capstone. Rename to capstone/all, and declare phony. Target subdir-slirp runs "make" in $(SRC_PATH)/slirp. Default goal is all, which builds $(BUILD_DIR)/libslirp.a. Rename to slirp/all, and declare phony. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daud=C3=A9 --- Makefile | 30 ++++++++++++++++++------------ configure | 6 +++--- tests/Makefile.include | 3 ++- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 12e470fa03..09c726bcc2 100644 --- a/Makefile +++ b/Makefile @@ -436,8 +436,8 @@ config-host.h-timestamp: config-host.mak qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@= ") =20 -SUBDIR_RULES=3D$(patsubst %,subdir-%, $(TARGET_DIRS)) -SOFTMMU_SUBDIR_RULES=3D$(filter %-softmmu,$(SUBDIR_RULES)) +SUBDIR_RULES=3D$(addsuffix /all, $(TARGET_DIRS)) +SOFTMMU_SUBDIR_RULES=3D$(filter %-softmmu/all,$(SUBDIR_RULES)) =20 $(SOFTMMU_SUBDIR_RULES): $(authz-obj-y) $(SOFTMMU_SUBDIR_RULES): $(block-obj-y) @@ -447,14 +447,16 @@ $(SOFTMMU_SUBDIR_RULES): $(io-obj-y) $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak $(SOFTMMU_SUBDIR_RULES): $(edk2-decompressed) =20 -subdir-%: - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V=3D"$(V)" TARGET_= DIR=3D"$*/" all,) +.PHONY: $(SUBDIR_RULES) +$(SUBDIR_RULES): + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V=3D"$(V)" = TARGET_DIR=3D"$(dir $@)" all,) =20 DTC_MAKE_ARGS=3D-I$(SRC_PATH)/dtc VPATH=3D$(SRC_PATH)/dtc -C dtc V=3D"$(V)= " LIBFDT_srcdir=3D$(SRC_PATH)/dtc/libfdt DTC_CFLAGS=3D$(CFLAGS) $(QEMU_CFLAGS) DTC_CPPFLAGS=3D-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libf= dt =20 -subdir-dtc: .git-submodule-status dtc/libfdt dtc/tests +.PHONY: dtc/all +dtc/all: .git-submodule-status dtc/libfdt dtc/tests $(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS=3D"$(DTC_CPPFLAGS)= " CFLAGS=3D"$(DTC_CFLAGS)" LDFLAGS=3D"$(LDFLAGS)" ARFLAGS=3D"$(ARFLAGS)" CC= =3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,) =20 dtc/%: .git-submodule-status @@ -472,21 +474,25 @@ CAP_CFLAGS +=3D -DCAPSTONE_HAS_ARM64 CAP_CFLAGS +=3D -DCAPSTONE_HAS_POWERPC CAP_CFLAGS +=3D -DCAPSTONE_HAS_X86 =20 -subdir-capstone: .git-submodule-status +.PHONY: capstone/all +capstone/all: .git-submodule-status $(call quiet-command,$(MAKE) -C $(SRC_PATH)/capstone CAPSTONE_SHARED=3Dno= BUILDDIR=3D"$(BUILD_DIR)/capstone" CC=3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" = RANLIB=3D"$(RANLIB)" CFLAGS=3D"$(CAP_CFLAGS)" $(SUBDIR_MAKEFLAGS) $(BUILD_D= IR)/capstone/$(LIBCAPSTONE)) =20 -subdir-slirp: .git-submodule-status +.PHONY: slirp/all +slirp/all: .git-submodule-status $(call quiet-command,$(MAKE) -C $(SRC_PATH)/slirp BUILD_DIR=3D"$(BUILD_DI= R)/slirp" CC=3D"$(CC)" AR=3D"$(AR)" LD=3D"$(LD)" RANLIB=3D"$(RANLIB)" CFLAG= S=3D"$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS=3D"$(LDFLAGS)") =20 $(SUBDIR_RULES): libqemuutil.a $(common-obj-y) \ $(qom-obj-y) $(crypto-aes-obj-$(CONFIG_USER_ONLY)) =20 -ROMSUBDIR_RULES=3D$(patsubst %,romsubdir-%, $(ROMS)) +ROM_DIRS =3D $(addprefix pc-bios/, $(ROMS)) +ROMSUBDIR_RULES=3D$(addsuffix /all, $(ROM_DIRS)) # Only keep -O and -g cflags -romsubdir-%: - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V=3D"$(V)"= TARGET_DIR=3D"$*/" CFLAGS=3D"$(filter -O% -g%,$(CFLAGS))",) +.PHONY: $(ROMSUBDIR_RULES) +$(ROMSUBDIR_RULES): + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V=3D"$(V)" = TARGET_DIR=3D"$(dir $@)" CFLAGS=3D"$(filter -O% -g%,$(CFLAGS))",) =20 -ALL_SUBDIRS=3D$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) +ALL_SUBDIRS=3D$(TARGET_DIRS) $(ROM_DIRS) =20 recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) =20 @@ -1087,7 +1093,7 @@ endif @$(if $(TARGET_DIRS), \ echo 'Architecture specific targets:'; \ $(foreach t, $(TARGET_DIRS), \ - printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \ + printf " %-30s - Build for %s\\n" $(t)/all $(t);) \ echo '') @echo 'Cleaning targets:' @echo ' clean - Remove most generated files but keep the conf= ig' diff --git a/configure b/configure index d2fc346302..2897434dda 100755 --- a/configure +++ b/configure @@ -6570,7 +6570,7 @@ if test "$slirp" !=3D "no"; then echo "SLIRP_LIBS=3D$slirp_libs" >> $config_host_mak fi if [ "$slirp" =3D "git" -o "$slirp" =3D "internal" ]; then - echo "config-host.h: subdir-slirp" >> $config_host_mak + echo "config-host.h: slirp/all" >> $config_host_mak fi if test "$vde" =3D "yes" ; then echo "CONFIG_VDE=3Dy" >> $config_host_mak @@ -7836,10 +7836,10 @@ if test -n "$enabled_cross_compilers"; then fi =20 if [ "$fdt" =3D "git" ]; then - echo "config-host.h: subdir-dtc" >> $config_host_mak + echo "config-host.h: dtc/all" >> $config_host_mak fi if [ "$capstone" =3D "git" -o "$capstone" =3D "internal" ]; then - echo "config-host.h: subdir-capstone" >> $config_host_mak + echo "config-host.h: capstone/all" >> $config_host_mak fi if test -n "$LIBCAPSTONE"; then echo "LIBCAPSTONE=3D$LIBCAPSTONE" >> $config_host_mak diff --git a/tests/Makefile.include b/tests/Makefile.include index 1865f6b322..2b8d34ca25 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1,3 +1,4 @@ +# -*- Mode: makefile -*- =20 .PHONY: check-help check-help: @@ -880,7 +881,7 @@ define do_test_tap endef =20 .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS)) -$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: subdir-%-so= ftmmu $(check-qtest-y) +$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/a= ll $(check-qtest-y) $(call do_test_human,$(check-qtest-$*-y) $(check-qtest-generic-y), \ QTEST_QEMU_BINARY=3D$*-softmmu/qemu-system-$* \ QTEST_QEMU_IMG=3Dqemu-img$(EXESUF)) --=20 2.17.2