testing: don't nest build for fp-test
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 7 Jan 2020 17:55:52 +0000 (17:55 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Thu, 9 Jan 2020 11:41:29 +0000 (11:41 +0000)
Re-calling the main make is counter-productive and really messes up
with parallel builds. Just ensure we have built the pre-requisites
before we build the fp-test bits. If the user builds manually just
complain if the parent build hasn't got the bits we need.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Emilio G. Cota <cota@braap.org>
tests/Makefile.include
tests/fp/Makefile

index 49e3b0d3194fa73124fea27067a805a4af963299..7a767bf11486efd6a225d7203ce47aa22887371c 100644 (file)
@@ -969,7 +969,7 @@ FP_TEST_BIN=$(BUILD_DIR)/tests/fp/fp-test
 
 # the build dir is created by configure
 .PHONY: $(FP_TEST_BIN)
-$(FP_TEST_BIN):
+$(FP_TEST_BIN): config-host.h $(test-util-obj-y)
        $(call quiet-command, \
                $(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" $(notdir $@), \
                 "BUILD", "$(notdir $@)")
index 5a35e7c2109aa99749780f2fee5d7662ee59c60a..56768ecfd2ffbb03598a0104b2f5ad3a04d2b55b 100644 (file)
@@ -554,15 +554,13 @@ TF_OBJS_LIB += $(TF_OBJS_TEST)
 
 BINARIES := fp-test$(EXESUF) fp-bench$(EXESUF)
 
-# everything depends on config-host.h because platform.h includes it
-all: $(BUILD_DIR)/config-host.h
-       $(MAKE) $(BINARIES)
+# We require artefacts from the main build including config-host.h
+# because platform.h includes it. Rather than re-invoking the main
+# build we just error out if things aren't there.
+$(LIBQEMUUTIL) $(BUILD_DIR)/config-host.h:
+       $(error $@ missing, re-run parent build)
 
-$(LIBQEMUUTIL):
-       $(MAKE) -C $(BUILD_DIR) libqemuutil.a
-
-$(BUILD_DIR)/config-host.h:
-       $(MAKE) -C $(BUILD_DIR) config-host.h
+all: $(BUILD_DIR)/config-host.h $(BINARIES)
 
 # libtestfloat.a depends on libsoftfloat.a, so specify it first
 FP_TEST_LIBS := libtestfloat.a libsoftfloat.a $(LIBQEMUUTIL)