common/makefiles/Makefile
author ohair
Tue, 18 Sep 2012 11:29:16 -0700
changeset 13697 5262b00bc10c
parent 13132 bd88bb8dd3af
child 14111 2a82ecb35fc7
permissions -rw-r--r--
7197849: Update new build-infra makefiles Reviewed-by: ihse, erikj, ohrstrom, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    26
# This must be the first rule
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    27
default: all
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    28
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    29
# Inclusion of this pseudo-target will cause make to execute this file
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    30
# serially, regardless of -j. Recursively called makefiles will not be
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    31
# affected, however. This is required for correct dependency management.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    32
.NOTPARALLEL:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    33
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    34
# Locate this Makefile
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    35
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    36
    makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    37
else
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    38
    makefile_path:=$(lastword $(MAKEFILE_LIST))
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    39
endif
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    40
root_dir:=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    41
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    42
# ... and then we can include our helper functions
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    43
include $(dir $(makefile_path))/MakeHelpers.gmk
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    44
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    45
$(eval $(call ParseLogLevel))
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    46
$(eval $(call SetupLogging))
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    47
$(eval $(call ParseConfAndSpec))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    48
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    49
ifneq ($(words $(SPEC)),1)
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    50
### We have multiple configurations to build, call make repeatedly
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    51
all clean dist-clean:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    52
langtools corba jaxp jaxws hotspot jdk images overlay-images install:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    53
langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    54
clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    55
	@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    56
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    57
.PHONY: all clean dist-clean
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    58
.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    59
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    60
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    61
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    62
else
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    63
### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    64
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    65
# Now load the spec
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    66
include $(SPEC)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    67
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    68
# Load the vital tools for all the makefiles. 
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    69
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    70
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    71
### Clean up from previous run
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    72
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    73
# Remove any build.log from a previous run, if they exist
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    74
ifneq (,$(BUILD_LOG))
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    75
    ifneq (,$(BUILD_LOG_PREVIOUS))
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    76
        # Rotate old log
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    77
        $(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    78
        $(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    79
    else
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    80
        $(shell $(RM) $(BUILD_LOG) 2> /dev/null)
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    81
    endif
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    82
endif
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    83
# Remove any javac server logs and port files. This
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    84
# prevents a new make run to reuse the previous servers.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    85
ifneq (,$(SJAVAC_SERVER_DIR))
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    86
    $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    87
endif
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    88
# Clean out any notifications from the previous build.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    89
$(shell $(FIND) $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    90
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    91
# Reset the build timers.
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
    92
$(eval $(call ResetTimers))
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
    93
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    94
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    95
# hence this workaround.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    96
ifeq ($(JOBS),)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    97
    JOBS=$(NUM_CORES)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    98
endif
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
    99
MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   100
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   101
### Main targets
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   102
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   103
all: jdk
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   104
	@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   105
	@$(call AtRootMakeEnd)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   106
.PHONY: all
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   107
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   108
langtools: start-make langtools-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   109
langtools-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   110
	@$(call MakeStart,langtools,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   111
	@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   112
	@$(call MakeFinish,langtools,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   113
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   114
corba: langtools corba-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   115
corba-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   116
	@$(call MakeStart,corba,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   117
	@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   118
	@$(call MakeFinish,corba,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   119
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   120
jaxp: langtools jaxp-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   121
jaxp-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   122
	@$(call MakeStart,jaxp,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   123
	@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   124
	@$(call MakeFinish,jaxp,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   125
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   126
jaxws: langtools jaxp jaxws-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   127
jaxws-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   128
	@$(call MakeStart,jaxws,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   129
	@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   130
	@$(call MakeFinish,jaxws,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   131
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   132
hotspot: langtools hotspot-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   133
hotspot-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   134
	@$(call MakeStart,hotspot,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   135
	@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   136
	@$(call MakeFinish,hotspot,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   137
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   138
jdk: langtools corba jaxp jaxws hotspot jdk-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   139
jdk-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   140
	@$(call MakeStart,jdk,all)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   141
	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(JDK_TARGET))
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   142
	@$(call MakeFinish,jdk,all)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   143
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   144
images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   145
images-only:
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   146
	@$(call MakeStart,jdk-images,$@)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   147
	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) images)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   148
	@$(call MakeFinish,jdk-images,$@)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   149
	@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   150
	@$(call AtRootMakeEnd)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   151
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   152
overlay-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot overlay-images-only
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   153
overlay-images-only:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   154
	@$(call MakeStart,jdk-overlay-images,$@)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   155
	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) overlay-images)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   156
	@$(call MakeFinish,jdk-overlay-images,$@)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   157
	@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   158
	@$(call AtRootMakeEnd)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   159
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   160
install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   161
install-only:
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   162
	@$(call MakeStart,jdk-images,$@)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   163
	@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) install)
13132
bd88bb8dd3af 7181504: Update of latest build-infra Makefiles
erikj
parents: 12801
diff changeset
   164
	@$(call MakeFinish,jdk-images,$@)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   165
	@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   166
	@$(call AtRootMakeEnd)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   167
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   168
docs: start-make jdk docs-only
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   169
docs-only:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   170
	@$(call MakeStart,docs,$@)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   171
	@($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   172
	@$(call MakeFinish,docs,$@)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   173
	@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   174
	@$(call AtRootMakeEnd)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   175
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   176
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   177
.PHONY: langtools corba jaxp jaxws hotspot jdk images install
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   178
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only install-only
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   179
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   180
start-make:
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   181
	@$(call AtRootMakeStart)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   182
.PHONY: start-make
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   183
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   184
bootcycle-images:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   185
	@$(ECHO) Boot cycle build step 1: Building the JDK image normally
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   186
	@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(SPEC) images)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   187
	@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   188
	@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   189
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   190
test: start-make
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   191
	@$(call MakeStart,test,$(if $(TEST),$(TEST),all))
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   192
	@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   193
	@$(call MakeFinish,test,$(if $(TEST),$(TEST),all))
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   194
	@$(call AtRootMakeEnd)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   195
.PHONY: test
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   196
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   197
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   198
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   199
# used to track the exact sources used to build that image.
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   200
source-tips: $(OUTPUT_ROOT)/source_tips
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   201
$(OUTPUT_ROOT)/source_tips: FRC
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   202
	@$(MKDIR) -p $(@D)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   203
	@$(RM) $@
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   204
	@$(call GetSourceTips)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   205
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   206
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   207
# Remove everything, except the output from configure.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   208
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-bootcycle-build
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   209
	@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log*)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   210
	@$(ECHO) Cleaned everything except the build configuration.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   211
.PHONY: clean
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   212
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   213
# Remove everything, you have to rerun configure.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   214
dist-clean:
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   215
	@$(RM) -r $(OUTPUT_ROOT)
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   216
	@$(ECHO) Cleaned everything, you will have to re-run configure.
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   217
.PHONY: dist-clean
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   218
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   219
clean-langtools:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   220
	$(call CleanComponent,langtools)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   221
clean-corba:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   222
	$(call CleanComponent,corba)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   223
clean-jaxp:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   224
	$(call CleanComponent,jaxp)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   225
clean-jaxws:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   226
	$(call CleanComponent,jaxws)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   227
clean-hotspot:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   228
	$(call CleanComponent,hotspot)
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   229
clean-jdk:
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   230
	$(call CleanComponent,jdk)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   231
clean-images:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   232
	$(call CleanComponent,images)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   233
clean-bootcycle-build:
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   234
	$(call CleanComponent,bootcycle-build)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   235
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   236
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   237
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   238
endif
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   239
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   240
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   241
# If you addd more global targets, please update the fatal-error macro.
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   242
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   243
help:
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   244
	$(info )
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   245
	$(info OpenJDK Makefile help)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   246
	$(info =====================)
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   247
	$(info )
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   248
	$(info Common make targets)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   249
	$(info .  make [all]             # Compile all code but do not create images)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   250
	$(info .  make images            # Create complete j2sdk and j2re images)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   251
	$(info .  make overlay-images    # Create limited images for sparc 64 bit platforms)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   252
	$(info .  make bootcycle-images  # Build images twice, second time with newly build JDK)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   253
	$(info .  make install           # Install the generated images locally)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   254
	$(info .  make clean             # Remove all files generated by make, but not those)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   255
	$(info .                         # generated by configure)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   256
	$(info .  make dist-clean        # Remove all files, including configuration)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   257
	$(info .  make help              # Give some help on using make)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   258
	$(info .  make test              # Run tests, default is all tests (see TEST below))
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   259
	$(info )
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   260
	$(info Targets for specific components)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   261
	$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk or images))
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   262
	$(info .  make <component>       # Build <component> and everything it depends on. )
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   263
	$(info .  make <component>-only  # Build <component> only, without dependencies. This)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   264
	$(info .                         # is faster but can result in incorrect build results!)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   265
	$(info .  make clean-<component> # Remove files generated by make for <component>)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   266
	$(info )
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   267
	$(info Useful make variables)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   268
	$(info .  make CONF=             # Build all configurations (note, assignment is empty))
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   269
	$(info .  make CONF=<substring>  # Build the configuration(s) with a name matching)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   270
	$(info .                         # <substring>)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   271
	$(info )
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   272
	$(info .  make LOG=<loglevel>    # Change the log level from warn to <loglevel>)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   273
	$(info .                         # Available log levels are:)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   274
	$(info .                         # 'warn' (default), 'info', 'debug' and 'trace')
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   275
	$(info .                         # To see executed command lines, use LOG=info)
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   276
	$(info )
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   277
	$(info .  make JOBS=<n>          # Run <n> parallel make jobs)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   278
	$(info .                         # Note that -jN does not work as expected!)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   279
	$(info )
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   280
	$(info .  make test TEST=<test>  # Only run the given test or tests, e.g.)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13132
diff changeset
   281
	$(info .                         # make test TEST="jdk_lang jdk_net")
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   282
	$(info )
12258
6ec26f6cc53e 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
   283
.PHONY: help
12801
948f8ad66ee7 7170079: Adjustments to build-infra makefiles
erikj
parents: 12258
diff changeset
   284
FRC: # Force target