annotate NewMakefile.gmk @ 639:ecc8fda8f187

8008435: Fix new build to include jdk.Supported in ct.sym Reviewed-by: erikj
author darcy
date Tue, 19 Feb 2013 00:24:55 -0800
parents ef6adbf511cc
children 7ed0c9db6943
rev   line source
ohair@476 1 #
ohair@476 2 # Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
ohair@476 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@476 4 #
ohair@476 5 # This code is free software; you can redistribute it and/or modify it
ohair@476 6 # under the terms of the GNU General Public License version 2 only, as
ohair@476 7 # published by the Free Software Foundation. Oracle designates this
ohair@476 8 # particular file as subject to the "Classpath" exception as provided
ohair@476 9 # by Oracle in the LICENSE file that accompanied this code.
ohair@476 10 #
ohair@476 11 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@476 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@476 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@476 14 # version 2 for more details (a copy is included in the LICENSE file that
ohair@476 15 # accompanied this code).
ohair@476 16 #
ohair@476 17 # You should have received a copy of the GNU General Public License version
ohair@476 18 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@476 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@476 20 #
ohair@476 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@476 22 # or visit www.oracle.com if you need additional information or have any
ohair@476 23 # questions.
ohair@476 24 #
ohair@476 25
erikj@557 26 # This must be the first rule
erikj@557 27 default:
ohair@476 28
erikj@557 29 # Inclusion of this pseudo-target will cause make to execute this file
erikj@557 30 # serially, regardless of -j. Recursively called makefiles will not be
erikj@557 31 # affected, however. This is required for correct dependency management.
erikj@557 32 .NOTPARALLEL:
ohair@476 33
erikj@557 34 # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
erikj@557 35 # /usr/ccs/bin/make lacks basically every other flow control mechanism.
erikj@557 36 TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
ohair@476 37
erikj@557 38 # Assume we have GNU make, but check version.
erikj@557 39 ifeq (,$(findstring 3.81,$(MAKE_VERSION)))
erikj@557 40 ifeq (,$(findstring 3.82,$(MAKE_VERSION)))
erikj@557 41 $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
erikj@557 42 endif
ohair@476 43 endif
ohair@476 44
erikj@557 45 # Locate this Makefile
erikj@557 46 ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
erikj@557 47 makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
erikj@557 48 else
erikj@557 49 makefile_path:=$(lastword $(MAKEFILE_LIST))
erikj@557 50 endif
erikj@557 51 root_dir:=$(dir $(makefile_path))
ohair@476 52
erikj@557 53 # ... and then we can include our helper functions
erikj@557 54 include $(root_dir)/common/makefiles/MakeHelpers.gmk
ohair@476 55
erikj@557 56 $(eval $(call ParseLogLevel))
erikj@557 57 $(eval $(call ParseConfAndSpec))
ohair@476 58
erikj@557 59 # Now determine if we have zero, one or several configurations to build.
erikj@557 60 ifeq ($(SPEC),)
erikj@557 61 # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
erikj@557 62 else
erikj@557 63 ifeq ($(words $(SPEC)),1)
erikj@557 64 # We are building a single configuration. This is the normal case. Execute the Main.gmk file.
erikj@557 65 include $(root_dir)/common/makefiles/Main.gmk
erikj@557 66 else
erikj@557 67 # We are building multiple configurations.
erikj@557 68 # First, find out the valid targets
erikj@557 69 # Run the makefile with an arbitraty SPEC using -p -q (quiet dry-run and dump rules) to find
erikj@557 70 # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
erikj@557 71 all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \
erikj@557 72 $(MAKE) -p -q -f common/makefiles SPEC=$(firstword $(SPEC)) | \
erikj@557 73 grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
ohair@476 74
erikj@557 75 $(all_phony_targets):
erikj@557 76 @$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true
ohair@476 77
erikj@557 78 endif
erikj@557 79 endif
ohair@492 80
erikj@576 81 # Include this after a potential spec file has been included so that the bundles target
erikj@576 82 # has access to the spec variables.
erikj@576 83 include $(root_dir)/common/makefiles/Jprt.gmk
erikj@576 84
erikj@557 85 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
erikj@557 86 # If you addd more global targets, please update the variable global_targets in MakeHelpers.
ohair@492 87
ohair@492 88 help:
erikj@557 89 $(info )
erikj@557 90 $(info OpenJDK Makefile help)
erikj@557 91 $(info =====================)
erikj@557 92 $(info )
erikj@557 93 $(info Common make targets)
erikj@557 94 $(info . make [default] # Compile all product in langtools, hotspot, jaxp, jaxws,)
erikj@557 95 $(info . # corba and jdk)
erikj@557 96 $(info . make all # Compile everything, all repos and images)
erikj@557 97 $(info . make images # Create complete j2sdk and j2re images)
erikj@557 98 $(info . make overlay-images # Create limited images for sparc 64 bit platforms)
erikj@557 99 $(info . make bootcycle-images # Build images twice, second time with newly build JDK)
erikj@557 100 $(info . make install # Install the generated images locally)
erikj@557 101 $(info . make clean # Remove all files generated by make, but not those)
erikj@557 102 $(info . # generated by configure)
erikj@557 103 $(info . make dist-clean # Remove all files, including configuration)
erikj@557 104 $(info . make help # Give some help on using make)
erikj@557 105 $(info . make test # Run tests, default is all tests (see TEST below))
erikj@557 106 $(info )
erikj@557 107 $(info Targets for specific components)
erikj@557 108 $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, images or overlay-images))
erikj@557 109 $(info . make <component> # Build <component> and everything it depends on. )
erikj@557 110 $(info . make <component>-only # Build <component> only, without dependencies. This)
erikj@557 111 $(info . # is faster but can result in incorrect build results!)
erikj@557 112 $(info . make clean-<component> # Remove files generated by make for <component>)
erikj@557 113 $(info )
erikj@557 114 $(info Useful make variables)
erikj@557 115 $(info . make CONF= # Build all configurations (note, assignment is empty))
erikj@557 116 $(info . make CONF=<substring> # Build the configuration(s) with a name matching)
erikj@557 117 $(info . # <substring>)
erikj@557 118 $(info )
erikj@557 119 $(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
erikj@557 120 $(info . # Available log levels are:)
erikj@557 121 $(info . # 'warn' (default), 'info', 'debug' and 'trace')
erikj@557 122 $(info . # To see executed command lines, use LOG=debug)
erikj@557 123 $(info )
erikj@557 124 $(info . make JOBS=<n> # Run <n> parallel make jobs)
erikj@557 125 $(info . # Note that -jN does not work as expected!)
erikj@557 126 $(info )
erikj@557 127 $(info . make test TEST=<test> # Only run the given test or tests, e.g.)
erikj@557 128 $(info . # make test TEST="jdk_lang jdk_net")
erikj@557 129 $(info )
ohair@492 130
erikj@557 131 .PHONY: help