Skip to content

Commit f1e0797

Browse files
committed
8348586: Optionally silence make warnings about non-control variables
Reviewed-by: mcimadamore, erikj
1 parent ffeb9b5 commit f1e0797

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

bin/idea.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if [ "$VERBOSE" = "true" ] ; then
9999
echo "idea template dir: $IDEA_TEMPLATE"
100100
fi
101101

102-
cd $TOP ; make idea-gen-config IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
102+
cd $TOP ; make idea-gen-config ALLOW=IDEA_OUTPUT,MODULES IDEA_OUTPUT=$IDEA_OUTPUT MODULES="$*" $CONF_ARG || exit 1
103103
cd $SCRIPT_DIR
104104

105105
. $IDEA_OUTPUT/env.cfg

make/Global.gmk

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -108,6 +108,7 @@ help:
108108
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
109109
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
110110
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
111+
$(info $(_) ALLOW="FOO,BAR" # Do not warn that FOO and BAR are non-control variables)
111112
$(info )
112113
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))), \
113114
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))

make/InitSupport.gmk

+11-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,15 @@ ifeq ($(HAS_SPEC), )
4848
# from the command-line.
4949
##############################################################################
5050

51-
# Make control variables, handled by Init.gmk
52-
INIT_CONTROL_VARIABLES += LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \
53-
COMPARE_BUILD JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
51+
# Essential control variables that are handled by Init.gmk
52+
INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK ALLOW \
53+
COMPARE_BUILD
5454

55-
# All known make control variables
56-
MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER SPEC_FILTER
55+
# All known make control variables; these are handled in other makefiles
56+
MAKE_CONTROL_VARIABLES += JDK_FILTER SPEC_FILTER \
57+
TEST TEST_JOBS JTREG GTEST MICRO TEST_OPTS TEST_VM_OPTS TEST_DEPS
58+
59+
ALL_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) $(MAKE_CONTROL_VARIABLES)
5760

5861
# Define a simple reverse function.
5962
# Should maybe move to MakeBase.gmk, but we can't include that file now.
@@ -87,8 +90,10 @@ ifeq ($(HAS_SPEC), )
8790
command_line_variables := $$(strip $$(foreach var, \
8891
$$(subst \ ,_,$$(MAKEOVERRIDES)), \
8992
$$(firstword $$(subst =, , $$(var)))))
93+
allowed_command_line_variables := $$(strip $$(subst $$(COMMA), , $$(ALLOW)))
9094
unknown_command_line_variables := $$(strip \
91-
$$(filter-out $$(MAKE_CONTROL_VARIABLES), $$(command_line_variables)))
95+
$$(filter-out $$(ALL_CONTROL_VARIABLES) $$(allowed_command_line_variables), \
96+
$$(command_line_variables)))
9297
ifneq ($$(unknown_command_line_variables), )
9398
$$(info Note: Command line contains non-control variables:)
9499
$$(foreach var, $$(unknown_command_line_variables), $$(info * $$(var)=$$($$(var))))

0 commit comments

Comments
 (0)