1 #
   2 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 #
  24 
  25 # The common definitions for hotspot windows builds.
  26 # Include the top level defs.make under make directory instead of this one.
  27 # 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.
  30 
  31 SLASH_JAVA ?= J:
  32 PATH_SEP = ;
  33 
  34 MAKE_ARGS += WARNINGS_AS_ERRORS=$(WARNINGS_AS_ERRORS)
  35 
  36 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
  37 ifeq ($(ARCH_DATA_MODEL),32)
  38   ARCH_DATA_MODEL=32
  39   PLATFORM=windows-i586
  40   VM_PLATFORM=windows_i486
  41   HS_ARCH=x86
  42   MAKE_ARGS += ARCH=x86
  43   MAKE_ARGS += BUILDARCH=i486
  44   MAKE_ARGS += Platform_arch=x86
  45   MAKE_ARGS += Platform_arch_model=x86_32
  46 endif
  47 
  48 ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
  49   ARCH_DATA_MODEL=32
  50   PLATFORM=windows-i586
  51   VM_PLATFORM=windows_i486
  52   HS_ARCH=x86
  53   MAKE_ARGS += ARCH=x86
  54   MAKE_ARGS += BUILDARCH=i486
  55   MAKE_ARGS += Platform_arch=x86
  56   MAKE_ARGS += Platform_arch_model=x86_32
  57 endif
  58 
  59 ifneq ($(ARCH_DATA_MODEL),32)
  60   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
  61     ARCH_DATA_MODEL=64
  62     PLATFORM=windows-ia64
  63     VM_PLATFORM=windows_ia64
  64     HS_ARCH=ia64
  65     MAKE_ARGS += LP64=1
  66     MAKE_ARGS += ARCH=ia64
  67     MAKE_ARGS += BUILDARCH=ia64
  68     MAKE_ARGS += Platform_arch=ia64
  69     MAKE_ARGS += Platform_arch_model=ia64
  70   endif
  71 
  72 # http://support.microsoft.com/kb/888731 : this can be either
  73 # AMD64 for AMD, or EM64T for Intel chips.
  74   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
  75     ARCH_DATA_MODEL=64
  76     PLATFORM=windows-amd64
  77     VM_PLATFORM=windows_amd64
  78     HS_ARCH=x86
  79     MAKE_ARGS += LP64=1
  80     MAKE_ARGS += ARCH=x86
  81     MAKE_ARGS += BUILDARCH=amd64
  82     MAKE_ARGS += Platform_arch=x86
  83     MAKE_ARGS += Platform_arch_model=x86_64
  84   endif
  85 
  86 ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
  87     ARCH_DATA_MODEL=64
  88     PLATFORM=windows-amd64
  89     VM_PLATFORM=windows_amd64
  90     HS_ARCH=x86
  91     MAKE_ARGS += LP64=1
  92     MAKE_ARGS += ARCH=x86
  93     MAKE_ARGS += BUILDARCH=amd64
  94     MAKE_ARGS += Platform_arch=x86
  95     MAKE_ARGS += Platform_arch_model=x86_64
  96   endif
  97 
  98 # NB later OS versions than 2003 may report "Intel64"
  99   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
 100     ARCH_DATA_MODEL=64
 101     PLATFORM=windows-amd64
 102     VM_PLATFORM=windows_amd64
 103     HS_ARCH=x86
 104     MAKE_ARGS += LP64=1
 105     MAKE_ARGS += ARCH=x86
 106     MAKE_ARGS += BUILDARCH=amd64
 107     MAKE_ARGS += Platform_arch=x86
 108     MAKE_ARGS += Platform_arch_model=x86_64
 109   endif
 110 endif
 111 
 112 # Full Debug Symbols has been enabled on Windows since JDK1.4.1 so
 113 # there is no need for an "earlier than JDK7 check".
 114 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
 115 # builds is enabled with debug info files ZIP'ed to save space. For
 116 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
 117 # debug build without debug info isn't very useful.
 118 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
 119 #
 120 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
 121 # disabled for a BUILD_FLAVOR == product build.
 122 #
 123 # Note: Use of a different variable name for the FDS override option
 124 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
 125 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
 126 # in options via environment variables, use of distinct variables
 127 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
 128 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
 129 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
 130 # the same variable name is used, then different values can be picked
 131 # up by different parts of the build. Just to be clear, we only need
 132 # two variable names because the incoming option value can be
 133 # overridden in some situations, e.g., a BUILD_FLAVOR != product
 134 # build.
 135 
 136 # Due to the multiple sub-make processes that occur this logic gets
 137 # executed multiple times. We reduce the noise by at least checking that
 138 # BUILD_FLAVOR has been set.
 139 ifneq ($(BUILD_FLAVOR),)
 140   ifeq ($(BUILD_FLAVOR), product)
 141     FULL_DEBUG_SYMBOLS ?= 1
 142     ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 143   else
 144     # debug variants always get Full Debug Symbols (if available)
 145     ENABLE_FULL_DEBUG_SYMBOLS = 1
 146   endif
 147   _JUNK_ := $(shell \
 148     echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 149   MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
 150 
 151   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 152     ZIP_DEBUGINFO_FILES ?= 1
 153   else
 154     ZIP_DEBUGINFO_FILES=0
 155   endif
 156   MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
 157 endif
 158 
 159 MAKE_ARGS += RM="$(RM)"
 160 MAKE_ARGS += ZIPEXE=$(ZIPEXE)
 161 MAKE_ARGS += CP="${CP}"
 162 MAKE_ARGS += MV="${MV}"
 163 
 164 
 165 # On 32 bit windows we build server and client, on 64 bit just server.
 166 ifeq ($(JVM_VARIANTS),)
 167   ifeq ($(ARCH_DATA_MODEL), 32)
 168     JVM_VARIANTS:=client,server
 169     JVM_VARIANT_CLIENT:=true
 170     JVM_VARIANT_SERVER:=true
 171   else
 172     JVM_VARIANTS:=server
 173     JVM_VARIANT_SERVER:=true
 174   endif
 175 endif
 176 
 177 JDK_INCLUDE_SUBDIR=win32
 178 
 179 # Library suffix
 180 LIBRARY_SUFFIX=dll
 181 
 182 # next parameters are defined in $(GAMMADIR)/make/defs.make.
 183 MAKE_ARGS += VERSION_SHORT=$(VERSION_SHORT)
 184 MAKE_ARGS += VERSION_MAJOR=$(VERSION_MAJOR)
 185 MAKE_ARGS += VERSION_MINOR=$(VERSION_MINOR)
 186 MAKE_ARGS += VERSION_SECURITY=$(VERSION_SECURITY)
 187 MAKE_ARGS += VERSION_PATCH=$(VERSION_PATCH)
 188 MAKE_ARGS += VERSION_BUILD=$(VERSION_BUILD)
 189 MAKE_ARGS += DEBUG_LEVEL=$(DEBUG_LEVEL)
 190 
 191 # JDK_DOTVER and JDK_VER are needed in Windows RC files
 192 COMMA:=,
 193 MAKE_ARGS += JDK_DOTVER=$(VERSION_NUMBER_FOUR_POSITIONS)
 194 MAKE_ARGS += JDK_VER=$(subst .,$(COMMA),$(VERSION_NUMBER_FOUR_POSITIONS))
 195 
 196 NMAKE= MAKEFLAGS= MFLAGS= EXTRA_CFLAGS="$(EXTRA_CFLAGS)" nmake -NOLOGO
 197 ifndef SYSTEM_UNAME
 198   SYSTEM_UNAME := $(shell uname)
 199   export SYSTEM_UNAME
 200 endif
 201 
 202 # Check for CYGWIN
 203 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
 204   USING_CYGWIN=true
 205 else
 206   USING_CYGWIN=false
 207 endif
 208 # Check for MinGW
 209 ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
 210   USING_MINGW=true
 211 endif
 212 
 213 # Windows wants particular paths due to nmake (must be after macros defined)
 214 #   It is important that gnumake invokes nmake with C:\\...\\  formated
 215 #   strings so that nmake gets C:\...\ style strings.
 216 # Check for CYGWIN
 217 ifeq ($(USING_CYGWIN), true)
 218   ABS_OUTPUTDIR   := $(subst /,\\,$(shell /bin/cygpath -m -a "$(OUTPUTDIR)"))
 219   ABS_BOOTDIR     := $(subst /,\\,$(shell /bin/cygpath -m -a "$(BOOTDIR)"))
 220   ABS_GAMMADIR    := $(subst /,\\,$(shell /bin/cygpath -m -a "$(GAMMADIR)"))
 221   ABS_OS_MAKEFILE := $(shell /bin/cygpath -m -a "$(HS_MAKE_DIR)/$(OSNAME)")/build.make
 222 else ifeq ($(USING_MINGW), true)
 223     ABS_OUTPUTDIR   := $(shell $(CD) $(OUTPUTDIR);$(PWD))
 224     ABS_BOOTDIR     := $(shell $(CD) $(BOOTDIR);$(PWD))
 225     ABS_GAMMADIR    := $(shell $(CD) $(GAMMADIR);$(PWD))
 226     ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make
 227   else
 228     ABS_OUTPUTDIR   := $(subst /,\\,$(shell $(CD) $(OUTPUTDIR);$(PWD)))
 229     ABS_BOOTDIR     := $(subst /,\\,$(shell $(CD) $(BOOTDIR);$(PWD)))
 230     ABS_GAMMADIR    := $(subst /,\\,$(shell $(CD) $(GAMMADIR);$(PWD)))
 231     ABS_OS_MAKEFILE := $(subst /,\\,$(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make)
 232 endif
 233 
 234 EXPORT_SERVER_DIR = $(EXPORT_BIN_DIR)/server
 235 EXPORT_CLIENT_DIR = $(EXPORT_BIN_DIR)/client
 236 
 237 ifeq ($(JVM_VARIANT_SERVER),true)
 238   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 239   EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
 240   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 241     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 242       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz
 243     else
 244       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
 245       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
 246     endif
 247   endif
 248 endif
 249 ifeq ($(JVM_VARIANT_CLIENT),true)
 250   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
 251   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
 252   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 253     ifeq ($(ZIP_DEBUGINFO_FILES),1)
 254       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz
 255     else
 256       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
 257       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
 258     endif
 259   endif
 260 endif
 261 
 262 EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
 263 
 264 # Propagate compiler and tools paths from configure to nmake.
 265 # Need to make sure they contain \\ and not /.
 266 ifneq ($(SPEC),)
 267   ifeq ($(USING_CYGWIN), true)
 268     MAKE_ARGS += CXX="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(CXX)))"
 269     MAKE_ARGS += LD="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(LD)))"
 270     MAKE_ARGS += RC="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(RC)))"
 271     MAKE_ARGS += MT="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(MT)))"
 272   else
 273     MAKE_ARGS += CXX="$(subst /,\\,$(CXX))"
 274     MAKE_ARGS += LD="$(subst /,\\,$(LD))"
 275     MAKE_ARGS += RC="$(subst /,\\,$(RC))"
 276     MAKE_ARGS += MT="$(subst /,\\,$(MT))"
 277   endif
 278 endif
 279 
 280 ifdef OPENJDK
 281   MAKE_ARGS += OPENJDK="$(OPENJDK)"
 282 endif