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