From 3b8593eeaa5778ae118f0cc2837e615acd13baeb Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 28 May 2019 10:23:07 +0200 Subject: Makefile: Rename targets for make recursion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190528082308.22032-4-armbru@redhat.com> [Add compatibility gunk to keep make working across the rename] --- tests/Makefile.include | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/Makefile.include b/tests/Makefile.include index db750dd..b54fea1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1,3 +1,4 @@ +# -*- Mode: makefile -*- .PHONY: check-help check-help: @@ -890,7 +891,7 @@ define do_test_tap endef .PHONY: $(patsubst %, check-qtest-%, $(QTEST_TARGETS)) -$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: subdir-%-softmmu $(check-qtest-y) +$(patsubst %, check-qtest-%, $(QTEST_TARGETS)): check-qtest-%: %-softmmu/all $(check-qtest-y) $(call do_test_human,$(check-qtest-$*-y) $(check-qtest-generic-y), \ QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \ QTEST_QEMU_IMG=qemu-img$(EXESUF)) @@ -903,7 +904,7 @@ check-speed: $(check-speed-y) # gtester tests with TAP output -$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: subdir-%-softmmu $(check-qtest-y) +$(patsubst %, check-report-qtest-%.tap, $(QTEST_TARGETS)): check-report-qtest-%.tap: %-softmmu/all $(check-qtest-y) $(call do_test_tap, $(check-qtest-$*-y) $(check-qtest-generic-y), \ QTEST_QEMU_BINARY=$*-softmmu/qemu-system-$* \ QTEST_QEMU_IMG=qemu-img$(EXESUF)) -- cgit v1.1