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