make/windows/makefiles/defs.make

Wed, 15 Apr 2020 11:49:55 +0800

author
aoqi
date
Wed, 15 Apr 2020 11:49:55 +0800
changeset 9852
70aa912cebe5
parent 6876
710a3c8b516e
parent 9823
147dfbe6ffa1
child 9931
fd44df5e3bc3
permissions
-rw-r--r--

Merge

     1 #
     2 # Copyright (c) 2006, 2013, 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 #
    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.
    31 SLASH_JAVA ?= J:
    32 PATH_SEP = ;
    34 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
    35 ifeq ($(ARCH_DATA_MODEL),32)
    36   ARCH_DATA_MODEL=32
    37   PLATFORM=windows-i586
    38   VM_PLATFORM=windows_i486
    39   HS_ARCH=x86
    40   MAKE_ARGS += ARCH=x86
    41   MAKE_ARGS += BUILDARCH=i486
    42   MAKE_ARGS += Platform_arch=x86
    43   MAKE_ARGS += Platform_arch_model=x86_32
    44 endif
    46 ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) x86),)
    47   ARCH_DATA_MODEL=32
    48   PLATFORM=windows-i586
    49   VM_PLATFORM=windows_i486
    50   HS_ARCH=x86
    51   MAKE_ARGS += ARCH=x86
    52   MAKE_ARGS += BUILDARCH=i486
    53   MAKE_ARGS += Platform_arch=x86
    54   MAKE_ARGS += Platform_arch_model=x86_32
    55 endif
    57 ifneq ($(ARCH_DATA_MODEL),32)
    58   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) ia64),)
    59     ARCH_DATA_MODEL=64
    60     PLATFORM=windows-ia64
    61     VM_PLATFORM=windows_ia64
    62     HS_ARCH=ia64
    63     MAKE_ARGS += LP64=1
    64     MAKE_ARGS += ARCH=ia64
    65     MAKE_ARGS += BUILDARCH=ia64
    66     MAKE_ARGS += Platform_arch=ia64
    67     MAKE_ARGS += Platform_arch_model=ia64
    68   endif
    70 # http://support.microsoft.com/kb/888731 : this can be either
    71 # AMD64 for AMD, or EM64T for Intel chips.
    72   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) AMD64),)
    73     ARCH_DATA_MODEL=64
    74     PLATFORM=windows-amd64
    75     VM_PLATFORM=windows_amd64
    76     HS_ARCH=x86
    77     MAKE_ARGS += LP64=1
    78     MAKE_ARGS += ARCH=x86
    79     MAKE_ARGS += BUILDARCH=amd64
    80     MAKE_ARGS += Platform_arch=x86
    81     MAKE_ARGS += Platform_arch_model=x86_64
    82   endif
    84 ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) EM64T),)
    85     ARCH_DATA_MODEL=64
    86     PLATFORM=windows-amd64
    87     VM_PLATFORM=windows_amd64
    88     HS_ARCH=x86
    89     MAKE_ARGS += LP64=1
    90     MAKE_ARGS += ARCH=x86
    91     MAKE_ARGS += BUILDARCH=amd64
    92     MAKE_ARGS += Platform_arch=x86
    93     MAKE_ARGS += Platform_arch_model=x86_64
    94   endif
    96 # NB later OS versions than 2003 may report "Intel64"
    97   ifneq ($(shell $(ECHO) $(PROCESSOR_IDENTIFIER) | $(GREP) Intel64),)
    98     ARCH_DATA_MODEL=64
    99     PLATFORM=windows-amd64
   100     VM_PLATFORM=windows_amd64
   101     HS_ARCH=x86
   102     MAKE_ARGS += LP64=1
   103     MAKE_ARGS += ARCH=x86
   104     MAKE_ARGS += BUILDARCH=amd64
   105     MAKE_ARGS += Platform_arch=x86
   106     MAKE_ARGS += Platform_arch_model=x86_64
   107   endif
   108 endif
   110 # Full Debug Symbols has been enabled on Windows since JDK1.4.1 so
   111 # there is no need for an "earlier than JDK7 check".
   112 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
   113 # builds is enabled with debug info files ZIP'ed to save space. For
   114 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
   115 # debug build without debug info isn't very useful.
   116 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
   117 #
   118 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
   119 # disabled for a BUILD_FLAVOR == product build.
   120 #
   121 # Note: Use of a different variable name for the FDS override option
   122 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
   123 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
   124 # in options via environment variables, use of distinct variables
   125 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
   126 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
   127 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
   128 # the same variable name is used, then different values can be picked
   129 # up by different parts of the build. Just to be clear, we only need
   130 # two variable names because the incoming option value can be
   131 # overridden in some situations, e.g., a BUILD_FLAVOR != product
   132 # build.
   134 # Due to the multiple sub-make processes that occur this logic gets
   135 # executed multiple times. We reduce the noise by at least checking that
   136 # BUILD_FLAVOR has been set.
   137 ifneq ($(BUILD_FLAVOR),)
   138   ifeq ($(BUILD_FLAVOR), product)
   139     FULL_DEBUG_SYMBOLS ?= 1
   140     ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   141   else
   142     # debug variants always get Full Debug Symbols (if available)
   143     ENABLE_FULL_DEBUG_SYMBOLS = 1
   144   endif
   145   _JUNK_ := $(shell \
   146     echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
   147   MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
   149   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   150     ZIP_DEBUGINFO_FILES ?= 1
   151   else
   152     ZIP_DEBUGINFO_FILES=0
   153   endif
   154   MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
   155 endif
   157 MAKE_ARGS += RM="$(RM)"
   158 MAKE_ARGS += ZIPEXE=$(ZIPEXE)
   160 MAKE_ARGS += COMPANY_NAME="$(COMPANY_NAME)"
   161 MAKE_ARGS += VENDOR_URL=$(VENDOR_URL)
   162 MAKE_ARGS += VENDOR_URL_BUG=$(VENDOR_URL_BUG)
   163 MAKE_ARGS += VENDOR_URL_VM_BUG=$(VENDOR_URL_VM_BUG)
   164 ifneq ($(VERSION_CFLAGS),)
   165   # transform syntax from -DProp='"Value"' to /D "Prop=\"Value\"" for Windows build
   166   MAKE_ARGS += VERSION_CFLAGS="$(subst -D,/D \",$(subst ',,$(subst '$() $(),\"$() $(),$(subst ",\\\",$(VERSION_CFLAGS)))))\""
   167 endif
   169 # On 32 bit windows we build server and client, on 64 bit just server.
   170 ifeq ($(JVM_VARIANTS),)
   171   ifeq ($(ARCH_DATA_MODEL), 32)
   172     JVM_VARIANTS:=client,server
   173     JVM_VARIANT_CLIENT:=true
   174     JVM_VARIANT_SERVER:=true
   175   else
   176     JVM_VARIANTS:=server
   177     JVM_VARIANT_SERVER:=true
   178   endif
   179 endif
   181 JDK_INCLUDE_SUBDIR=win32
   183 # Library suffix
   184 LIBRARY_SUFFIX=dll
   186 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
   187 # and added to MAKE_ARGS list in $(GAMMADIR)/make/defs.make.
   189 # next parameters are defined in $(GAMMADIR)/make/defs.make.
   190 MAKE_ARGS += JDK_MKTG_VERSION=$(JDK_MKTG_VERSION)
   191 MAKE_ARGS += JDK_MAJOR_VER=$(JDK_MAJOR_VERSION)
   192 MAKE_ARGS += JDK_MINOR_VER=$(JDK_MINOR_VERSION)
   193 MAKE_ARGS += JDK_MICRO_VER=$(JDK_MICRO_VERSION)
   195 ifdef COOKED_JDK_UPDATE_VERSION
   196   MAKE_ARGS += JDK_UPDATE_VER=$(COOKED_JDK_UPDATE_VERSION)
   197 endif
   199 # COOKED_BUILD_NUMBER should only be set if we have a numeric
   200 # build number.  It must not be zero padded.
   201 ifdef COOKED_BUILD_NUMBER
   202   MAKE_ARGS += JDK_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
   203 endif
   205 NMAKE= MAKEFLAGS= MFLAGS= EXTRA_CFLAGS="$(EXTRA_CFLAGS)" nmake -NOLOGO
   206 ifndef SYSTEM_UNAME
   207   SYSTEM_UNAME := $(shell uname)
   208   export SYSTEM_UNAME
   209 endif
   211 # Check for CYGWIN
   212 ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
   213   USING_CYGWIN=true
   214 else
   215   USING_CYGWIN=false
   216 endif
   217 # Check for MinGW
   218 ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
   219   USING_MINGW=true
   220 endif
   222 # Windows wants particular paths due to nmake (must be after macros defined)
   223 #   It is important that gnumake invokes nmake with C:\\...\\  formated
   224 #   strings so that nmake gets C:\...\ style strings.
   225 # Check for CYGWIN
   226 ifeq ($(USING_CYGWIN), true)
   227   ABS_OUTPUTDIR   := $(subst /,\\,$(shell /bin/cygpath -m -a "$(OUTPUTDIR)"))
   228   ABS_BOOTDIR     := $(subst /,\\,$(shell /bin/cygpath -m -a "$(BOOTDIR)"))
   229   ABS_GAMMADIR    := $(subst /,\\,$(shell /bin/cygpath -m -a "$(GAMMADIR)"))
   230   ABS_OS_MAKEFILE := $(shell /bin/cygpath -m -a "$(HS_MAKE_DIR)/$(OSNAME)")/build.make
   231 else ifeq ($(USING_MINGW), true)
   232     ABS_OUTPUTDIR   := $(shell $(CD) $(OUTPUTDIR);$(PWD))
   233     ABS_BOOTDIR     := $(shell $(CD) $(BOOTDIR);$(PWD))
   234     ABS_GAMMADIR    := $(shell $(CD) $(GAMMADIR);$(PWD))
   235     ABS_OS_MAKEFILE := $(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make
   236   else
   237     ABS_OUTPUTDIR   := $(subst /,\\,$(shell $(CD) $(OUTPUTDIR);$(PWD)))
   238     ABS_BOOTDIR     := $(subst /,\\,$(shell $(CD) $(BOOTDIR);$(PWD)))
   239     ABS_GAMMADIR    := $(subst /,\\,$(shell $(CD) $(GAMMADIR);$(PWD)))
   240     ABS_OS_MAKEFILE := $(subst /,\\,$(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make)
   241 endif
   243 # Disable building SA on windows until we are sure
   244 # we want to release it.  If we build it here,
   245 # the SDK makefiles will copy it over and put it into
   246 # the created image.
   247 BUILD_WIN_SA = 1
   248 ifneq ($(ALT_BUILD_WIN_SA),)
   249   BUILD_WIN_SA = $(ALT_BUILD_WIN_SA)
   250 endif
   252 ifeq ($(BUILD_WIN_SA), 1)
   253   ifeq ($(ARCH),ia64)
   254     BUILD_WIN_SA = 0
   255   endif
   256 endif
   258 EXPORT_SERVER_DIR = $(EXPORT_JRE_BIN_DIR)/server
   259 EXPORT_CLIENT_DIR = $(EXPORT_JRE_BIN_DIR)/client
   261 ifeq ($(JVM_VARIANT_SERVER),true)
   262   EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
   263   EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.$(LIBRARY_SUFFIX)
   264   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   265     ifeq ($(ZIP_DEBUGINFO_FILES),1)
   266       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.diz
   267     else
   268       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.pdb
   269       EXPORT_LIST += $(EXPORT_SERVER_DIR)/jvm.map
   270     endif
   271   endif
   272 endif
   273 ifeq ($(JVM_VARIANT_CLIENT),true)
   274   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   275   EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.$(LIBRARY_SUFFIX)
   276   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   277     ifeq ($(ZIP_DEBUGINFO_FILES),1)
   278       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.diz
   279     else
   280       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.pdb
   281       EXPORT_LIST += $(EXPORT_CLIENT_DIR)/jvm.map
   282     endif
   283   endif
   284 endif
   286 EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
   288 ifeq ($(BUILD_WIN_SA), 1)
   289   EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
   290   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   291     ifeq ($(ZIP_DEBUGINFO_FILES),1)
   292       EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.diz
   293     else
   294       EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb
   295       EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map
   296     endif
   297   endif
   298   EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
   299   # Must pass this down to nmake.
   300   MAKE_ARGS += BUILD_WIN_SA=1
   301 endif
   303 # Propagate compiler and tools paths from configure to nmake.
   304 # Need to make sure they contain \\ and not /.
   305 ifneq ($(SPEC),)
   306   ifeq ($(USING_CYGWIN), true)
   307     MAKE_ARGS += CXX="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(CXX)))"
   308     MAKE_ARGS += LD="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(LD)))"
   309     MAKE_ARGS += RC="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(RC)))"
   310     MAKE_ARGS += MT="$(subst /,\\,$(shell /bin/cygpath -s -m -a $(MT)))"
   311   else
   312     MAKE_ARGS += CXX="$(subst /,\\,$(CXX))"
   313     MAKE_ARGS += LD="$(subst /,\\,$(LD))"
   314     MAKE_ARGS += RC="$(subst /,\\,$(RC))"
   315     MAKE_ARGS += MT="$(subst /,\\,$(MT))"
   316   endif
   317 endif

mercurial