Makefile

Wed, 27 Apr 2016 01:39:08 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:39:08 +0800
changeset 0
75a576e87639
child 1133
50aaf272884f
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/
changeset: 1170:d117f01bfb4f
tag: jdk8u25-b17

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

mercurial