annotate Makefile @ 1232:eefa97d0d263

8065215: Print warning summary at end of configure Reviewed-by: erikj, tbell
author ihse
date Fri, 21 Nov 2014 16:11:28 +0100
parents dc29cb072e8a
children 67395f7ca2db bebfcf0b68ea
rev   line source
duke@0 1 #
ihse@910 2 # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
ohair@180 7 # published by the Free Software Foundation. Oracle designates this
duke@0 8 # particular file as subject to the "Classpath" exception as provided
ohair@180 9 # by Oracle in the LICENSE file that accompanied this code.
duke@0 10 #
duke@0 11 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 14 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 15 # accompanied this code).
duke@0 16 #
duke@0 17 # You should have received a copy of the GNU General Public License version
duke@0 18 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 20 #
ohair@180 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@180 22 # or visit www.oracle.com if you need additional information or have any
ohair@180 23 # questions.
duke@0 24 #
duke@0 25
ihse@910 26 # This must be the first rule
ihse@910 27 default:
ohair@476 28
ihse@910 29 # Inclusion of this pseudo-target will cause make to execute this file
ihse@910 30 # serially, regardless of -j. Recursively called makefiles will not be
ihse@910 31 # affected, however. This is required for correct dependency management.
ihse@910 32 .NOTPARALLEL:
ihse@910 33
ihse@910 34 # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
ihse@910 35 # /usr/ccs/bin/make lacks basically every other flow control mechanism.
ihse@910 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
ihse@910 37
ihse@910 38 # Assume we have GNU make, but check version.
ihse@910 39 ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
ihse@910 40 $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
ohair@568 41 endif
ohair@568 42
ihse@910 43 # Locate this Makefile
ihse@910 44 ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
ihse@910 45 makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
ihse@910 46 else
ihse@910 47 makefile_path:=$(lastword $(MAKEFILE_LIST))
ihse@910 48 endif
ihse@910 49 root_dir:=$(dir $(makefile_path))
ohair@476 50
ihse@910 51 # ... and then we can include our helper functions
ihse@910 52 include $(root_dir)/make/MakeHelpers.gmk
ohair@476 53
ihse@910 54 $(eval $(call ParseLogLevel))
ihse@910 55 $(eval $(call ParseConfAndSpec))
ohair@476 56
ihse@910 57 # Now determine if we have zero, one or several configurations to build.
ihse@910 58 ifeq ($(SPEC),)
ihse@910 59 # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
ihse@910 60 else
chegar@1120 61 # In Cygwin, the MAKE variable gets messed up if the make executable is called with
chegar@1120 62 # a Windows mixed path (c:/cygwin/bin/make.exe). If that's the case, fix it by removing
chegar@1120 63 # the prepended root_dir.
chegar@1120 64 ifneq ($(findstring :, $(MAKE)), )
chegar@1120 65 MAKE := $(patsubst $(root_dir)%, %, $(MAKE))
chegar@1120 66 endif
ohair@5 67
chegar@1120 68 # We are potentially building multiple configurations.
chegar@1120 69 # First, find out the valid targets
chegar@1120 70 # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
chegar@1120 71 # available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
chegar@1120 72 all_phony_targets := $(sort $(filter-out $(global_targets), $(strip $(shell \
erikj@1171 73 cd $(root_dir)/make && $(MAKE) -f Main.gmk -p -q FRC SPEC=$(firstword $(SPEC)) \
erikj@1171 74 -I $(root_dir)/make/common | grep "^.PHONY:" | head -n 1 | cut -d " " -f 2-))))
ohair@338 75
chegar@1120 76 # Loop through the configurations and call the main-wrapper for each one. The wrapper
chegar@1120 77 # target will execute with a single configuration loaded.
chegar@1120 78 $(all_phony_targets):
chegar@1120 79 @$(if $(TARGET_RUN),,\
chegar@1120 80 $(foreach spec,$(SPEC),\
chegar@1120 81 (cd $(root_dir) && $(MAKE) SPEC=$(spec) MAIN_TARGETS="$(call GetRealTarget)" \
chegar@1120 82 $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) main-wrapper) &&) true)
chegar@1120 83 @echo > /dev/null
chegar@1120 84 $(eval TARGET_RUN=true)
ohair@338 85
chegar@1120 86 .PHONY: $(all_phony_targets)
chegar@1120 87
chegar@1120 88 ifneq ($(MAIN_TARGETS), )
chegar@1120 89 # The wrapper target was called so we now have a single configuration. Load the spec file
chegar@1120 90 # and call the real Main.gmk.
chegar@1120 91 include $(SPEC)
chegar@1120 92
chegar@1120 93 ### Clean up from previous run
chegar@1120 94 # Remove any build.log from a previous run, if they exist
chegar@1120 95 ifneq (,$(BUILD_LOG))
chegar@1120 96 ifneq (,$(BUILD_LOG_PREVIOUS))
chegar@1120 97 # Rotate old log
chegar@1120 98 $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
chegar@1120 99 $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
chegar@1120 100 else
chegar@1120 101 $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
chegar@1120 102 endif
chegar@1120 103 $(shell $(RM) $(OUTPUT_ROOT)/build-trace-time.log 2> /dev/null)
chegar@1120 104 endif
chegar@1120 105 # Remove any javac server logs and port files. This
chegar@1120 106 # prevents a new make run to reuse the previous servers.
chegar@1120 107 ifneq (,$(SJAVAC_SERVER_DIR))
chegar@1120 108 $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
chegar@1120 109 endif
chegar@1120 110
erikj@1158 111 # Split out the targets requiring sequential execution. Run these targets separately
erikj@1158 112 # from the rest so that the rest may still enjoy full parallel execution.
erikj@1158 113 SEQUENTIAL_TARGETS := $(filter dist-clean clean% reconfigure, $(MAIN_TARGETS))
erikj@1158 114 PARALLEL_TARGETS := $(filter-out $(SEQUENTIAL_TARGETS), $(MAIN_TARGETS))
erikj@1158 115
chegar@1120 116 main-wrapper:
erikj@1158 117 ifneq ($(SEQUENTIAL_TARGETS), )
erikj@1171 118 (cd $(SRC_ROOT)/make && $(MAKE) -f Main.gmk SPEC=$(SPEC) -j 1 \
erikj@1158 119 $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(SEQUENTIAL_TARGETS))
erikj@1158 120 endif
erikj@1158 121 ifneq ($(PARALLEL_TARGETS), )
erikj@1158 122 @$(call AtMakeStart)
erikj@1171 123 (cd $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -f Main.gmk SPEC=$(SPEC) -j $(JOBS) \
erikj@1158 124 $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $(PARALLEL_TARGETS) \
erikj@1158 125 $(if $(filter true, $(OUTPUT_SYNC_SUPPORTED)), -O$(OUTPUT_SYNC)))
erikj@1158 126 @$(call AtMakeEnd)
erikj@1158 127 endif
chegar@1120 128
chegar@1120 129 .PHONY: main-wrapper
chegar@1120 130
chegar@1120 131 endif
ohair@27 132 endif
ohair@27 133
ihse@910 134 # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
chegar@1120 135 # If you add more global targets, please update the variable global_targets in MakeHelpers.
ohrstrom@311 136
ihse@910 137 help:
ihse@910 138 $(info )
ihse@910 139 $(info OpenJDK Makefile help)
ihse@910 140 $(info =====================)
ihse@910 141 $(info )
ihse@910 142 $(info Common make targets)
chegar@1120 143 $(info . make [default] # Compile all modules in langtools, hotspot, jaxp, jaxws,)
chegar@1120 144 $(info . # corba and jdk and create a runnable "exploded" image)
chegar@1120 145 $(info . make all # Compile everything, all repos, docs and images)
ihse@910 146 $(info . make images # Create complete j2sdk and j2re images)
chegar@1120 147 $(info . make docs # Create all docs)
chegar@1120 148 $(info . make docs-javadoc # Create just javadocs, depends on less than full docs)
ihse@910 149 $(info . make profiles # Create complete j2re compact profile images)
erikj@1145 150 $(info . make bootcycle-images # Build images twice, second time with newly built JDK)
ihse@910 151 $(info . make install # Install the generated images locally)
erikj@1158 152 $(info . make reconfigure # Rerun configure with the same arguments as last time)
ihse@910 153 $(info . make clean # Remove all files generated by make, but not those)
erikj@1158 154 $(info . # generated by configure)
ihse@910 155 $(info . make dist-clean # Remove all files, including configuration)
ihse@910 156 $(info . make help # Give some help on using make)
ihse@910 157 $(info . make test # Run tests, default is all tests (see TEST below))
ihse@910 158 $(info )
chegar@1120 159 $(info Targets for specific modules)
chegar@1120 160 $(info . make <module> # Build <module> and everything it depends on. )
chegar@1120 161 $(info . make <module>-only # Build <module> only, without dependencies. This)
ihse@910 162 $(info . # is faster but can result in incorrect build results!)
chegar@1120 163 $(info . make <module>-java # Compile java classes for <module> and everything it)
chegar@1120 164 $(info . # depends on)
chegar@1120 165 $(info . make <module>-libs # Build native libraries for <module> and everything it)
chegar@1120 166 $(info . # depends on)
chegar@1120 167 $(info . make <module>-launchers# Build native executables for <module> and everything it)
chegar@1120 168 $(info . # depends on)
chegar@1120 169 $(info . make <module>-gensrc # Execute the gensrc step for <module> and everything it)
chegar@1120 170 $(info . # depends on)
ihse@910 171 $(info )
ihse@910 172 $(info Useful make variables)
ihse@910 173 $(info . make CONF= # Build all configurations (note, assignment is empty))
ihse@910 174 $(info . make CONF=<substring> # Build the configuration(s) with a name matching)
ihse@910 175 $(info . # <substring>)
ihse@910 176 $(info )
ihse@910 177 $(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
ihse@910 178 $(info . # Available log levels are:)
ihse@910 179 $(info . # 'warn' (default), 'info', 'debug' and 'trace')
ihse@910 180 $(info . # To see executed command lines, use LOG=debug)
ihse@910 181 $(info )
ihse@910 182 $(info . make JOBS=<n> # Run <n> parallel make jobs)
ihse@910 183 $(info . # Note that -jN does not work as expected!)
ihse@910 184 $(info )
ihse@910 185 $(info . make test TEST=<test> # Only run the given test or tests, e.g.)
ihse@910 186 $(info . # make test TEST="jdk_lang jdk_net")
ihse@910 187 $(info )
ohair@27 188
ihse@910 189 .PHONY: help