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