defs.make 10.9 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
# 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.
#
# 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.
#
19 20 21
# 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.
D
duke 已提交
22 23 24 25 26 27
#  
#

# The common definitions for hotspot windows builds.
# Include the top level defs.make under make directory instead of this one.
# This file is included into make/defs.make.
28
# On windows it is only used to construct parameters for
29
# make/windows/build.make when make/Makefile is used to build VM.
D
duke 已提交
30 31 32 33 34

SLASH_JAVA ?= J:
PATH_SEP = ;

# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
35
ifeq ($(ARCH_DATA_MODEL),32)
D
duke 已提交
36 37 38 39 40 41 42 43 44 45
  ARCH_DATA_MODEL=32
  PLATFORM=windows-i586
  VM_PLATFORM=windows_i486
  HS_ARCH=x86
  MAKE_ARGS += ARCH=x86
  MAKE_ARGS += BUILDARCH=i486
  MAKE_ARGS += Platform_arch=x86
  MAKE_ARGS += Platform_arch_model=x86_32
endif

46 47 48 49
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
  ARCH_DATA_MODEL=32
  PLATFORM=windows-i586
  VM_PLATFORM=windows_i486
D
duke 已提交
50 51
  HS_ARCH=x86
  MAKE_ARGS += ARCH=x86
52
  MAKE_ARGS += BUILDARCH=i486
D
duke 已提交
53
  MAKE_ARGS += Platform_arch=x86
54
  MAKE_ARGS += Platform_arch_model=x86_32
D
duke 已提交
55 56
endif

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
ifneq ($(ARCH_DATA_MODEL),32)
  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
    ARCH_DATA_MODEL=64
    PLATFORM=windows-ia64
    VM_PLATFORM=windows_ia64
    HS_ARCH=ia64
    MAKE_ARGS += LP64=1
    MAKE_ARGS += ARCH=ia64
    MAKE_ARGS += BUILDARCH=ia64
    MAKE_ARGS += Platform_arch=ia64
    MAKE_ARGS += Platform_arch_model=ia64
  endif

# http://support.microsoft.com/kb/888731 : this can be either
# AMD64 for AMD, or EM64T for Intel chips.
  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
    ARCH_DATA_MODEL=64
    PLATFORM=windows-amd64
    VM_PLATFORM=windows_amd64
    HS_ARCH=x86
    MAKE_ARGS += LP64=1
    MAKE_ARGS += ARCH=x86
    MAKE_ARGS += BUILDARCH=amd64
    MAKE_ARGS += Platform_arch=x86
    MAKE_ARGS += Platform_arch_model=x86_64
  endif

84
ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
85 86 87 88 89 90 91 92 93 94
    ARCH_DATA_MODEL=64
    PLATFORM=windows-amd64
    VM_PLATFORM=windows_amd64
    HS_ARCH=x86
    MAKE_ARGS += LP64=1
    MAKE_ARGS += ARCH=x86
    MAKE_ARGS += BUILDARCH=amd64
    MAKE_ARGS += Platform_arch=x86
    MAKE_ARGS += Platform_arch_model=x86_64
  endif
95

96
# NB later OS versions than 2003 may report "Intel64"
97 98 99 100 101 102 103 104 105 106 107
  ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
    ARCH_DATA_MODEL=64
    PLATFORM=windows-amd64
    VM_PLATFORM=windows_amd64
    HS_ARCH=x86
    MAKE_ARGS += LP64=1
    MAKE_ARGS += ARCH=x86
    MAKE_ARGS += BUILDARCH=amd64
    MAKE_ARGS += Platform_arch=x86
    MAKE_ARGS += Platform_arch_model=x86_64
  endif
108 109
endif

110 111
# Full Debug Symbols has been enabled on Windows since JDK1.4.1 so
# there is no need for an "earlier than JDK7 check".
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
# builds is enabled with debug info files ZIP'ed to save space. For
# BUILD_FLAVOR != product builds, FDS is always enabled, after all a
# debug build without debug info isn't very useful.
# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
#
# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
# disabled for a BUILD_FLAVOR == product build.
#
# Note: Use of a different variable name for the FDS override option
# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
# in options via environment variables, use of distinct variables
# prevents strange behaviours. For example, in a BUILD_FLAVOR !=
# product build, the FULL_DEBUG_SYMBOLS environment variable will be
# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
# the same variable name is used, then different values can be picked
# up by different parts of the build. Just to be clear, we only need
# two variable names because the incoming option value can be
# overridden in some situations, e.g., a BUILD_FLAVOR != product
# build.
133

134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
# Due to the multiple sub-make processes that occur this logic gets
# executed multiple times. We reduce the noise by at least checking that
# BUILD_FLAVOR has been set.
ifneq ($(BUILD_FLAVOR),)
  ifeq ($(BUILD_FLAVOR), product)
    FULL_DEBUG_SYMBOLS ?= 1
    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
  else
    # debug variants always get Full Debug Symbols (if available)
    ENABLE_FULL_DEBUG_SYMBOLS = 1
  endif
  _JUNK_ := $(shell \
    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
  MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)

  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ZIP_DEBUGINFO_FILES ?= 1
  else
    ZIP_DEBUGINFO_FILES=0
  endif
  MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
155
endif
156

157 158 159
MAKE_ARGS += RM="$(RM)"
MAKE_ARGS += ZIPEXE=$(ZIPEXE)

160 161 162
# On 32 bit windows we build server, client and kernel, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
  ifeq ($(ARCH_DATA_MODEL), 32)
163
    JVM_VARIANTS:=client,server
164 165 166 167 168 169 170 171
    JVM_VARIANT_CLIENT:=true
    JVM_VARIANT_SERVER:=true
  else
    JVM_VARIANTS:=server
    JVM_VARIANT_SERVER:=true
  endif
endif

D
duke 已提交
172 173
JDK_INCLUDE_SUBDIR=win32

N
never 已提交
174 175 176
# Library suffix
LIBRARY_SUFFIX=dll

177
# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
D
duke 已提交
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
# and added to MAKE_ARGS list in $(GAMMADIR)/make/defs.make.

# next parameters are defined in $(GAMMADIR)/make/defs.make.
MAKE_ARGS += JDK_MKTG_VERSION=$(JDK_MKTG_VERSION)
MAKE_ARGS += JDK_MAJOR_VER=$(JDK_MAJOR_VERSION)
MAKE_ARGS += JDK_MINOR_VER=$(JDK_MINOR_VERSION)
MAKE_ARGS += JDK_MICRO_VER=$(JDK_MICRO_VERSION)

ifdef COOKED_JDK_UPDATE_VERSION
  MAKE_ARGS += JDK_UPDATE_VER=$(COOKED_JDK_UPDATE_VERSION)
endif

# COOKED_BUILD_NUMBER should only be set if we have a numeric
# build number.  It must not be zero padded.
ifdef COOKED_BUILD_NUMBER
  MAKE_ARGS += JDK_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
endif

196 197 198 199 200
NMAKE= MAKEFLAGS= MFLAGS= nmake -NOLOGO
ifndef SYSTEM_UNAME
  SYSTEM_UNAME := $(shell uname)
  export SYSTEM_UNAME
endif
D
duke 已提交
201 202

# Check for CYGWIN
203
ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
D
duke 已提交
204 205 206 207
  USING_CYGWIN=true
else
  USING_CYGWIN=false
endif
208 209 210 211
# Check for MinGW
ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
  USING_MINGW=true
endif
D
duke 已提交
212 213 214 215 216 217 218 219 220 221 222
# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
VM_DEBUG=debug

# Windows wants particular paths due to nmake (must be after macros defined)
#   It is important that gnumake invokes nmake with C:\\...\\  formated
#   strings so that nmake gets C:\...\ style strings.
# Check for CYGWIN
ifeq ($(USING_CYGWIN), true)
  ABS_OUTPUTDIR   := $(subst /,\\,$(shell /bin/cygpath -m -a "$(OUTPUTDIR)"))
  ABS_BOOTDIR     := $(subst /,\\,$(shell /bin/cygpath -m -a "$(BOOTDIR)"))
  ABS_GAMMADIR    := $(subst /,\\,$(shell /bin/cygpath -m -a "$(GAMMADIR)"))
223
  ABS_OS_MAKEFILE := $(shell /bin/cygpath -m -a "$(HS_MAKE_DIR)/$(OSNAME)")/build.make
224 225 226 227 228 229 230 231 232 233
else ifeq ($(USING_MINGW), true)
    ABS_OUTPUTDIR   := $(shell $(CD) $(OUTPUTDIR);$(PWD))
    ABS_BOOTDIR     := $(shell $(CD) $(BOOTDIR);$(PWD))
    ABS_GAMMADIR    := $(shell $(CD) $(GAMMADIR);$(PWD))
    ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make
  else
    ABS_OUTPUTDIR   := $(subst /,\\,$(shell $(CD) $(OUTPUTDIR);$(PWD)))
    ABS_BOOTDIR     := $(subst /,\\,$(shell $(CD) $(BOOTDIR);$(PWD)))
    ABS_GAMMADIR    := $(subst /,\\,$(shell $(CD) $(GAMMADIR);$(PWD)))
    ABS_OS_MAKEFILE := $(subst /,\\,$(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make)
D
duke 已提交
234 235 236 237 238 239
endif

# Disable building SA on windows until we are sure
# we want to release it.  If we build it here,
# the SDK makefiles will copy it over and put it into
# the created image.
240
BUILD_WIN_SA = 1
D
duke 已提交
241 242 243 244 245
ifneq ($(ALT_BUILD_WIN_SA),)
  BUILD_WIN_SA = $(ALT_BUILD_WIN_SA)
endif

ifeq ($(BUILD_WIN_SA), 1)
246
  ifeq ($(ARCH),ia64)
D
duke 已提交
247 248 249 250 251
    BUILD_WIN_SA = 0
  endif
endif

EXPORT_SERVER_DIR = $(EXPORT_JRE_BIN_DIR)/server
K
kvn 已提交
252 253 254
EXPORT_CLIENT_DIR = $(EXPORT_JRE_BIN_DIR)/client
EXPORT_KERNEL_DIR = $(EXPORT_JRE_BIN_DIR)/kernel

255 256 257
ifeq ($(JVM_VARIANT_SERVER),true)
  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
  EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
D
Merge  
dcubed 已提交
258 259 260 261 262 263 264
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
      EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz
    else
      EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
      EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
    endif
265
  endif
266 267 268
  EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
endif
ifeq ($(JVM_VARIANT_CLIENT),true)
D
duke 已提交
269
  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
N
never 已提交
270
  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
271 272 273 274 275 276 277 278
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz
    else
      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
    endif
  endif
279 280
endif
ifeq ($(JVM_VARIANT_KERNEL),true)
D
duke 已提交
281
  EXPORT_LIST += $(EXPORT_KERNEL_DIR)/Xusage.txt
N
never 已提交
282
  EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.$(LIBRARY_SUFFIX)
283 284 285 286 287 288 289 290
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.diz
    else
      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb
      EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map
    endif
  endif
D
duke 已提交
291 292
endif

293 294
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar

D
duke 已提交
295
ifeq ($(BUILD_WIN_SA), 1)
N
never 已提交
296
  EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
297 298 299 300 301 302 303 304
  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    ifeq ($(ZIP_DEBUGINFO_FILES),1)
      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz
    else
      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb
      EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map
    endif
  endif
305
  EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
D
duke 已提交
306 307 308
  # Must pass this down to nmake.
  MAKE_ARGS += BUILD_WIN_SA=1
endif
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324

# Propagate compiler and tools paths from configure to nmake. 
# Need to make sure they contain \\ and not /.
ifneq ($(SPEC),)
  ifeq ($(USING_CYGWIN), true)
    MAKE_ARGS += CXX="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(CXX)))"
    MAKE_ARGS += LD="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(LD)))"
    MAKE_ARGS += RC="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(RC)))"
    MAKE_ARGS += MT="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(MT)))"
  else
    MAKE_ARGS += CXX="$(subst /,\\,$(CXX))"
    MAKE_ARGS += LD="$(subst /,\\,$(LD))"
    MAKE_ARGS += RC="$(subst /,\\,$(RC))"
    MAKE_ARGS += MT="$(subst /,\\,$(MT))"
  endif
endif