Makefile
changeset 28902 0c09b47449c8
parent 28286 02d8f96d7c92
child 29662 78c47f0002c3
--- a/Makefile	Thu Jan 15 16:36:24 2015 +0100
+++ b/Makefile	Fri Jan 16 16:02:09 2015 +0100
@@ -48,6 +48,17 @@
 endif
 root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
 
+ifeq ($(MAIN_TARGETS), )
+  COMMAND_LINE_VARIABLES:=$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var))))))
+  MAKE_CONTROL_VARIABLES:=LOG CONF SPEC JOBS TEST IGNORE_OLD_CONFIG
+  UNKNOWN_COMMAND_LINE_VARIABLES:=$(strip $(filter-out $(MAKE_CONTROL_VARIABLES), $(COMMAND_LINE_VARIABLES)))
+  ifneq ($(UNKNOWN_COMMAND_LINE_VARIABLES), )
+    $(info Note: Command line contains non-control variables: $(UNKNOWN_COMMAND_LINE_VARIABLES).)
+    $(info Make sure it is not mistyped, and that you intend to override this variable.)
+    $(info 'make help' will list known control variables)
+  endif
+endif
+
 ifneq ($(findstring qp,$(MAKEFLAGS)),)
   # When called with -qp, assume an external part (e.g. bash completion) is trying
   # to understand our targets.
@@ -148,62 +159,64 @@
 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
 # If you add more global targets, please update the variable global_targets in MakeHelpers.
 
+# Helper macro to allow $(info) to properly print strings beginning with spaces.
+_:=
+
 help:
 	$(info )
 	$(info OpenJDK Makefile help)
 	$(info =====================)
 	$(info )
 	$(info Common make targets)
-	$(info .  make [default]         # Compile all modules in langtools, hotspot, jaxp, jaxws,)
-	$(info .                         # corba and jdk and create a runnable "exploded" image)
-	$(info .  make all               # Compile everything, all repos, docs and images)
-	$(info .  make images            # Create complete jdk and jre images)
-	$(info .  make <phase>           # Compile the specified phase and everything it depends on)
-	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info .  make *-only            # Applies to most targets and disables compling the)
-	$(info .                         # dependencies for the target. This is faster but may)
-	$(info .                         # result in incorrect build results!)
-	$(info .  make docs              # Create all docs)
-	$(info .  make docs-javadoc      # Create just javadocs, depends on less than full docs)
-	$(info .  make profiles          # Create complete jre compact profile images)
-	$(info .  make bootcycle-images  # Build images twice, second time with newly built JDK)
-	$(info .  make install           # Install the generated images locally)
-	$(info .  make reconfigure       # Rerun configure with the same arguments as last time)
-	$(info .  make help              # Give some help on using make)
-	$(info .  make test              # Run tests, default is all tests (see TEST below))
+	$(info $(_) make [default]         # Compile all modules in langtools, hotspot, jdk, jaxws,)
+	$(info $(_)                        # jaxp and corba, and create a runnable "exploded" image)
+	$(info $(_) make all               # Compile everything, all repos, docs and images)
+	$(info $(_) make images            # Create complete j2sdk and j2re images)
+	$(info $(_) make <phase>           # Build the specified phase and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
+	$(info $(_) make *-only            # Applies to most targets and disables compling the)
+	$(info $(_)                        # dependencies for the target. This is faster but may)
+	$(info $(_)                        # result in incorrect build results!)
+	$(info $(_) make docs              # Create all docs)
+	$(info $(_) make docs-javadoc      # Create just javadocs, depends on less than full docs)
+	$(info $(_) make profiles          # Create complete j2re compact profile images)
+	$(info $(_) make bootcycle-images  # Build images twice, second time with newly built JDK)
+	$(info $(_) make install           # Install the generated images locally)
+	$(info $(_) make reconfigure       # Rerun configure with the same arguments as last time)
+	$(info $(_) make help              # Give some help on using make)
+	$(info $(_) make test              # Run tests, default is all tests (see TEST below))
 	$(info )
 	$(info Targets for cleaning)
-	$(info .  make clean             # Remove all files generated by make, but not those)
-	$(info .                         # generated by configure)
-	$(info .  make dist-clean        # Remove all files, including configuration)
-	$(info .  make clean-<outputdir> # Remove the subdir in the output dir with the name)
-	$(info .  make clean-<phase>     # Remove all build results related to a certain build)
-	$(info .                         # phase (gensrc, java, libs, launchers))
-	$(info .  make clean-<module>    # Remove all build results related to a certain module)
-	$(info .  make clean-<module>-<phase> # Remove all build results related to a certain)
-	$(info .                         # module and phase)
+	$(info $(_) make clean             # Remove all files generated by make, but not those)
+	$(info $(_)                        # generated by configure)
+	$(info $(_) make dist-clean        # Remove all files, including configuration)
+	$(info $(_) make clean-<outputdir> # Remove the subdir in the output dir with the name)
+	$(info $(_) make clean-<phase>     # Remove all build results related to a certain build)
+	$(info $(_)                        # phase (gensrc, java, libs, launchers))
+	$(info $(_) make clean-<module>    # Remove all build results related to a certain module)
+	$(info $(_) make clean-<module>-<phase> # Remove all build results related to a certain)
+	$(info $(_)                        # module and phase)
 	$(info )
 	$(info Targets for specific modules)
-	$(info .  make <module>          # Build <module> and everything it depends on. )
-	$(info .  make <module>-<phase>  # Compile the specified phase for the specified module)
-	$(info .                         # and everything it depends on)
-	$(info .                         # (gensrc, java, copy, libs, launchers, gendata, rmic))
-	$(info )
-	$(info Useful make variables)
-	$(info .  make CONF=             # Build all configurations (note, assignment is empty))
-	$(info .  make CONF=<substring>  # Build the configuration(s) with a name matching)
-	$(info .                         # <substring>)
+	$(info $(_) make <module>          # Build <module> and everything it depends on.)
+	$(info $(_) make <module>-<phase>  # Compile the specified phase for the specified module)
+	$(info $(_)                        # and everything it depends on)
+	$(info $(_)                        # (gensrc, java, copy, libs, launchers, gendata, rmic))
 	$(info )
-	$(info .  make LOG=<loglevel>    # Change the log level from warn to <loglevel>)
-	$(info .                         # Available log levels are:)
-	$(info .                         # 'warn' (default), 'info', 'debug' and 'trace')
-	$(info .                         # To see executed command lines, use LOG=debug)
-	$(info )
-	$(info .  make JOBS=<n>          # Run <n> parallel make jobs)
-	$(info .                         # Note that -jN does not work as expected!)
-	$(info )
-	$(info .  make test TEST=<test>  # Only run the given test or tests, e.g.)
-	$(info .                         # make test TEST="jdk_lang jdk_net")
+	$(info Make control variables)
+	$(info $(_) CONF=                  # Build all configurations (note, assignment is empty))
+	$(info $(_) CONF=<substring>       # Build the configuration(s) with a name matching)
+	$(info $(_)                        # <substring>)
+	$(info $(_) SPEC=<spec file>       # Build the configuration given by the spec file)
+	$(info $(_) LOG=<loglevel>         # Change the log level from warn to <loglevel>)
+	$(info $(_)                        # Available log levels are:)
+	$(info $(_)                        # 'warn' (default), 'info', 'debug' and 'trace')
+	$(info $(_)                        # To see executed command lines, use LOG=debug)
+	$(info $(_) JOBS=<n>               # Run <n> parallel make jobs)
+	$(info $(_)                        # Note that -jN does not work as expected!)
+	$(info $(_) IGNORE_OLD_CONFIG=true # Skip tests if spec file is up to date)
+	$(info $(_) make test TEST=<test>  # Only run the given test or tests, e.g.)
+	$(info $(_)                        # make test TEST="jdk_lang jdk_net")
 	$(info )
 
 .PHONY: help