Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8292944: Noisy output when running make help the first time #23357

Closed
wants to merge 11 commits into from
6 changes: 6 additions & 0 deletions make/Init.gmk
Original file line number Diff line number Diff line change
@@ -47,6 +47,12 @@ include $(TOPDIR)/make/common/MakeBase.gmk
include $(TOPDIR)/make/InitSupport.gmk
include $(TOPDIR)/make/common/LogUtils.gmk

# Force early generation of module-deps.gmk and find-tests.gmk
GENERATE_MODULE_DEPS_FILE := true
include $(TOPDIR)/make/common/Modules.gmk
GENERATE_FIND_TESTS_FILE := true
include $(TOPDIR)/make/common/FindTests.gmk

# Parse COMPARE_BUILD (for makefile development)
$(eval $(call ParseCompareBuild))

1 change: 1 addition & 0 deletions make/Main.gmk
Original file line number Diff line number Diff line change
@@ -1483,6 +1483,7 @@ print-tests:

create-main-targets-include:
$(call LogInfo, Generating main target list)
$(call MakeDir, $(MAKESUPPORT_OUTPUTDIR))
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk

3 changes: 2 additions & 1 deletion make/RunTestsPrebuilt.gmk
Original file line number Diff line number Diff line change
@@ -301,7 +301,8 @@ test-prebuilt:
# are always found and parsed, call FindTests.gmk stand alone once
# before calling RunTests.gmk.
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true \
GENERATE_FIND_TESTS_FILE=true
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)"

10 changes: 6 additions & 4 deletions make/common/FindTests.gmk
Original file line number Diff line number Diff line change
@@ -62,10 +62,11 @@ $(foreach root, $(JTREG_TESTROOTS), \
# Cache the expensive to calculate test names in a generated makefile.
FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk

# If this file is deemed outdated, it will automatically get regenerated
# by this rule before being included below.
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
$(TOPDIR)/test/make/TestMake.gmk
ifeq ($(GENERATE_FIND_TESTS_FILE), true)
# If this file is deemed outdated, it will automatically get regenerated
# by this rule before being included below.
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
$(TOPDIR)/test/make/TestMake.gmk
$(call MakeTargetDir)
( $(foreach root, $(JTREG_TESTROOTS), \
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
@@ -78,6 +79,7 @@ $(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
$(MAKE) -s --no-print-directory $(MAKE_ARGS) \
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
TARGETS_FILE=$@
endif

-include $(FIND_TESTS_CACHE_FILE)

6 changes: 4 additions & 2 deletions make/common/Modules.gmk
Original file line number Diff line number Diff line change
@@ -172,8 +172,9 @@ MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk

MODULE_INFOS := $(call FindAllModuleInfos, *)

$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
$(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
$(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
$(call MakeTargetDir)
$(RM) $@
$(foreach m, $(MODULE_INFOS), \
@@ -206,6 +207,7 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
printf(" %s", $$0) } \
END { printf("\n") }' $m \
) >> $@ $(NEWLINE))
endif

-include $(MODULE_DEPS_MAKEFILE)