NewMakefile.gmk

Thu, 14 Nov 2013 09:04:53 -0800

author
cl
date
Thu, 14 Nov 2013 09:04:53 -0800
changeset 909
a4afb0a8d55e
parent 865
4293401d683b
permissions
-rw-r--r--

Added tag jdk8-b116 for changeset cbfe5da942c6

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

mercurial