aboutsummaryrefslogtreecommitdiff
path: root/make/hotspot-rules.gmk
blob: 9a85b93f9901087be97c2ef9fbb1b2304c49041a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#
# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

################################################################
# HOTSPOT TARGETS
################################################################

# All the output from a hotspot build should be re-located to the
#    build output area.
#
HOTSPOT_OUTPUTDIR = $(HOTSPOT_DIR)/outputdir

# HOTSPOT_EXPORT_PATH points to a dir that contains files
# that are needed in an SDK build, in the same relative positions as
# these files are in an SDK image.
# The SDK java/redist/Makefile will copy files from HOTSPOT_EXPORT_PATH
# into the SDK being built.
# This is the export path supplied to the hotspot makefiles.
#
HOTSPOT_EXPORT_PATH = $(HOTSPOT_DIR)/import

# Default targets
HOTSPOT = hotspot-sanity hotspot-build

hotspot:: $(HOTSPOT)

# Hotspot clobber removes the output directory and exported files
hotspot-clobber:: 
	$(RM) -r $(HOTSPOT_OUTPUTDIR)
	$(RM) -r $(HOTSPOT_EXPORT_PATH)

hotspot-sanity::
	@$(MKDIR) -p $(HOTSPOT_OUTPUTDIR)
	@$(MKDIR) -p $(HOTSPOT_EXPORT_PATH)
	@$(ECHO) "Hotspot Settings: \n" \
	    "     HOTSPOT_BUILD_JOBS  = $(HOTSPOT_BUILD_JOBS) \n"  \
	    "     HOTSPOT_OUTPUTDIR   = $(HOTSPOT_OUTPUTDIR) \n"  \
	    "     HOTSPOT_EXPORT_PATH = $(HOTSPOT_EXPORT_PATH) \n"  \
	    "\n"  >> $(MESSAGE_FILE)

#
# Basic hotspot build and export of it's files
#

HOTSPOT_TARGET = all_product
ifeq ($(DEBUG_NAME), debug)
  HOTSPOT_TARGET = all_debug
endif
ifeq ($(DEBUG_NAME), fastdebug)
  HOTSPOT_TARGET = all_fastdebug
endif

ifeq ($(ZERO_BUILD), true)
  ifeq ($(SHARK_BUILD), true)
    HOTSPOT_TARGET := $(HOTSPOT_TARGET)shark
  else
    HOTSPOT_TARGET := $(HOTSPOT_TARGET)zero
  endif
endif

HOTSPOT_BUILD_ARGUMENTS += $(COMMON_BUILD_ARGUMENTS)
HOTSPOT_BUILD_ARGUMENTS += ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
HOTSPOT_BUILD_ARGUMENTS += ALT_EXPORT_PATH=$(HOTSPOT_EXPORT_PATH)

# Why do these need to be passed in? Because of windows nmake? and MAKEFLAGS=?
#   Or is there something wrong with hotspot/make/Makefile?
HOTSPOT_BUILD_ARGUMENTS += ALT_SLASH_JAVA=$(SLASH_JAVA)
HOTSPOT_BUILD_ARGUMENTS += ALT_BOOTDIR=$(BOOTDIR)

ifeq ($(BUILD_LANGTOOLS), true)
  HOTSPOT_BUILD_ARGUMENTS += ALT_LANGTOOLS_DIST=$(ABS_LANGTOOLS_DIST)
endif

hotspot-build::
	$(MKDIR) -p $(HOTSPOT_OUTPUTDIR)
	$(MKDIR) -p $(HOTSPOT_EXPORT_PATH)
	@$(call MakeStart, hotspot, $(HOTSPOT_TARGET))
	$(CD) $(HOTSPOT_TOPDIR)/make && \
	    $(MAKE) $(HOTSPOT_BUILD_ARGUMENTS) $(HOTSPOT_TARGET)
	@$(call MakeFinish, hotspot, $(HOTSPOT_TARGET))

#####################
# .PHONY
#####################
.PHONY: hotspot-build hotspot-clobber hotspot-sanity