aoqi@0: # aoqi@0: # Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: # aoqi@0: # This code is free software; you can redistribute it and/or modify it aoqi@0: # under the terms of the GNU General Public License version 2 only, as aoqi@0: # published by the Free Software Foundation. Oracle designates this aoqi@0: # particular file as subject to the "Classpath" exception as provided aoqi@0: # by Oracle in the LICENSE file that accompanied this code. aoqi@0: # aoqi@0: # This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: # version 2 for more details (a copy is included in the LICENSE file that aoqi@0: # accompanied this code). aoqi@0: # aoqi@0: # You should have received a copy of the GNU General Public License version aoqi@0: # 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: # aoqi@0: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: # or visit www.oracle.com if you need additional information or have any aoqi@0: # questions. aoqi@0: # aoqi@0: aoqi@0: # This must be the first rule aoqi@0: default: aoqi@0: aoqi@0: # Inclusion of this pseudo-target will cause make to execute this file aoqi@0: # serially, regardless of -j. Recursively called makefiles will not be aoqi@0: # affected, however. This is required for correct dependency management. aoqi@0: .NOTPARALLEL: aoqi@0: aoqi@0: # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make. aoqi@0: # /usr/ccs/bin/make lacks basically every other flow control mechanism. aoqi@0: 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: aoqi@0: # Assume we have GNU make, but check version. aoqi@0: ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), ) aoqi@0: $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) aoqi@0: endif aoqi@0: aoqi@0: # Locate this Makefile aoqi@0: ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) aoqi@0: makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) aoqi@0: else aoqi@0: makefile_path:=$(lastword $(MAKEFILE_LIST)) aoqi@0: endif aoqi@0: root_dir:=$(dir $(makefile_path)) aoqi@0: aoqi@0: # ... and then we can include our helper functions aoqi@0: include $(root_dir)/make/MakeHelpers.gmk aoqi@0: aoqi@0: $(eval $(call ParseLogLevel)) aoqi@0: $(eval $(call ParseConfAndSpec)) aoqi@0: aoqi@0: # Now determine if we have zero, one or several configurations to build. aoqi@0: ifeq ($(SPEC),) aoqi@0: # Since we got past ParseConfAndSpec, we must be building a global target. Do nothing. aoqi@0: else aoqi@0: ifeq ($(words $(SPEC)),1) aoqi@0: # We are building a single configuration. This is the normal case. Execute the Main.gmk file. aoqi@0: include $(root_dir)/make/Main.gmk aoqi@0: else aoqi@0: # We are building multiple configurations. aoqi@0: # First, find out the valid targets aoqi@0: # Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find aoqi@0: # available PHONY targets. Use this list as valid targets to pass on to the repeated calls. aoqi@0: all_phony_targets=$(filter-out $(global_targets) bundles bundles-only final-images-only, $(strip $(shell \ aoqi@0: cd $(root_dir) && $(MAKE) -p -q FRC SPEC=$(firstword $(SPEC)) | \ aoqi@0: grep ^.PHONY: | head -n 1 | cut -d " " -f 2-))) aoqi@0: aoqi@0: $(all_phony_targets): aoqi@0: @$(foreach spec,$(SPEC),(cd $(root_dir) && $(MAKE) SPEC=$(spec) \ aoqi@0: $(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true aoqi@0: aoqi@0: .PHONY: $(all_phony_targets) aoqi@0: aoqi@0: endif aoqi@0: endif aoqi@0: aoqi@0: # Include this after a potential spec file has been included so that the bundles target aoqi@0: # has access to the spec variables. aoqi@0: include $(root_dir)/make/Jprt.gmk aoqi@0: aoqi@0: # Here are "global" targets, i.e. targets that can be executed without specifying a single configuration. aoqi@0: # If you addd more global targets, please update the variable global_targets in MakeHelpers. aoqi@0: aoqi@0: help: aoqi@0: $(info ) aoqi@0: $(info OpenJDK Makefile help) aoqi@0: $(info =====================) aoqi@0: $(info ) aoqi@0: $(info Common make targets) aoqi@0: $(info . make [default] # Compile all product in langtools, hotspot, jaxp, jaxws,) aoqi@0: $(info . # corba and jdk) aoqi@0: $(info . make all # Compile everything, all repos and images) aoqi@0: $(info . make images # Create complete j2sdk and j2re images) aoqi@0: $(info . make docs # Create javadocs) aoqi@0: $(info . make overlay-images # Create limited images for sparc 64 bit platforms) aoqi@0: $(info . make profiles # Create complete j2re compact profile images) aoqi@0: $(info . make bootcycle-images # Build images twice, second time with newly build JDK) aoqi@0: $(info . make install # Install the generated images locally) aoqi@0: $(info . make clean # Remove all files generated by make, but not those) aoqi@0: $(info . # generated by configure) aoqi@0: $(info . make dist-clean # Remove all files, including configuration) aoqi@0: $(info . make help # Give some help on using make) aoqi@0: $(info . make test # Run tests, default is all tests (see TEST below)) aoqi@0: $(info ) aoqi@0: $(info Targets for specific components) aoqi@0: $(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test)) aoqi@0: $(info . make # Build and everything it depends on. ) aoqi@0: $(info . make -only # Build only, without dependencies. This) aoqi@0: $(info . # is faster but can result in incorrect build results!) aoqi@0: $(info . make clean- # Remove files generated by make for ) aoqi@0: $(info ) aoqi@0: $(info Useful make variables) aoqi@0: $(info . make CONF= # Build all configurations (note, assignment is empty)) aoqi@0: $(info . make CONF= # Build the configuration(s) with a name matching) aoqi@0: $(info . # ) aoqi@0: $(info ) aoqi@0: $(info . make LOG= # Change the log level from warn to ) aoqi@0: $(info . # Available log levels are:) aoqi@0: $(info . # 'warn' (default), 'info', 'debug' and 'trace') aoqi@0: $(info . # To see executed command lines, use LOG=debug) aoqi@0: $(info ) aoqi@0: $(info . make JOBS= # Run parallel make jobs) aoqi@0: $(info . # Note that -jN does not work as expected!) aoqi@0: $(info ) aoqi@0: $(info . make test TEST= # Only run the given test or tests, e.g.) aoqi@0: $(info . # make test TEST="jdk_lang jdk_net") aoqi@0: $(info ) aoqi@0: aoqi@0: .PHONY: help