corba/make/common/shared/Defs.gmk
author martin
Mon, 07 Dec 2009 15:32:26 -0800
changeset 4354 3a70dde80b3b
parent 3871 3d528461f61d
child 5555 b2b5ed3f0d0d
permissions -rw-r--r--
6905029: Broken links in Deflater and DeflaterOutputStream javadoc Summary: Fix syntax errors in @links Reviewed-by: alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     1
#
2192
7e916cf3102a 6814575: Update copyright year
xdono
parents: 718
diff changeset
     2
# Copyright 2005-2009 Sun Microsystems, Inc.  All Rights Reserved.
4
02bb8761fcce Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
02bb8761fcce Initial load
duke
parents:
diff changeset
     4
#
02bb8761fcce Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
02bb8761fcce Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
02bb8761fcce Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
02bb8761fcce Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
02bb8761fcce Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
02bb8761fcce Initial load
duke
parents:
diff changeset
    10
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
02bb8761fcce Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
02bb8761fcce Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
02bb8761fcce Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
02bb8761fcce Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
02bb8761fcce Initial load
duke
parents:
diff changeset
    16
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
02bb8761fcce Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
02bb8761fcce Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
02bb8761fcce Initial load
duke
parents:
diff changeset
    20
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
02bb8761fcce Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
02bb8761fcce Initial load
duke
parents:
diff changeset
    23
# have any questions.
02bb8761fcce Initial load
duke
parents:
diff changeset
    24
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    25
02bb8761fcce Initial load
duke
parents:
diff changeset
    26
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    27
# Defnitions for all platforms.
02bb8761fcce Initial load
duke
parents:
diff changeset
    28
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    29
# Normally the convention is that these alternate definitions of
02bb8761fcce Initial load
duke
parents:
diff changeset
    30
#   primary make variables are never defined inside the Makefiles anywhere
02bb8761fcce Initial load
duke
parents:
diff changeset
    31
#   but are defined via environment variables or set on the make command
02bb8761fcce Initial load
duke
parents:
diff changeset
    32
#   line. So you should never see an ALT_* variable defined in any
02bb8761fcce Initial load
duke
parents:
diff changeset
    33
#   makefiles, just used. This is the convention and there are some
02bb8761fcce Initial load
duke
parents:
diff changeset
    34
#   exceptions, either mistakes or unusual circumstances.
02bb8761fcce Initial load
duke
parents:
diff changeset
    35
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    36
# The naming convention for the default value of one of these variables
02bb8761fcce Initial load
duke
parents:
diff changeset
    37
#   that has an ALT_* override capability is to name the default value with a
02bb8761fcce Initial load
duke
parents:
diff changeset
    38
#   leading underscore (_). So for XXX you would have:
02bb8761fcce Initial load
duke
parents:
diff changeset
    39
#      _XXX      default value
02bb8761fcce Initial load
duke
parents:
diff changeset
    40
#      ALT_XXX   any override the user is providing if any
02bb8761fcce Initial load
duke
parents:
diff changeset
    41
#      XXX       the final value, either the default _XXX or the ALT_XXX value.
02bb8761fcce Initial load
duke
parents:
diff changeset
    42
#
02bb8761fcce Initial load
duke
parents:
diff changeset
    43
02bb8761fcce Initial load
duke
parents:
diff changeset
    44
# On Directory names. In very rare cases should the Windows directory
02bb8761fcce Initial load
duke
parents:
diff changeset
    45
#    names use the backslash, please use the C:/ style of windows paths.
02bb8761fcce Initial load
duke
parents:
diff changeset
    46
#    Avoid duplicating the // characters in paths, this has known to cause
02bb8761fcce Initial load
duke
parents:
diff changeset
    47
#    strange problems with jar and other utilities, e.g. /a//b/ != /a/b/.
02bb8761fcce Initial load
duke
parents:
diff changeset
    48
#    Some of these variables have an explicit trailing / character, but in
02bb8761fcce Initial load
duke
parents:
diff changeset
    49
#    general, they should NOT have the trailing / character.
02bb8761fcce Initial load
duke
parents:
diff changeset
    50
02bb8761fcce Initial load
duke
parents:
diff changeset
    51
# Get shared system utilities macros defined
02bb8761fcce Initial load
duke
parents:
diff changeset
    52
include $(BUILDDIR)/common/shared/Defs-utils.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
    53
02bb8761fcce Initial load
duke
parents:
diff changeset
    54
# Assumes ARCH, PLATFORM, ARCH_VM_SUBDIR, etc. have been defined.
02bb8761fcce Initial load
duke
parents:
diff changeset
    55
02bb8761fcce Initial load
duke
parents:
diff changeset
    56
# Simple pwd path
02bb8761fcce Initial load
duke
parents:
diff changeset
    57
define PwdPath
02bb8761fcce Initial load
duke
parents:
diff changeset
    58
$(shell cd $1 2> $(DEV_NULL) && pwd)
02bb8761fcce Initial load
duke
parents:
diff changeset
    59
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    60
02bb8761fcce Initial load
duke
parents:
diff changeset
    61
# Checks an ALT value for spaces (should be one word), 
02bb8761fcce Initial load
duke
parents:
diff changeset
    62
#       warns and returns Check_ALT_$1 if spaces
02bb8761fcce Initial load
duke
parents:
diff changeset
    63
define AltCheckSpaces
02bb8761fcce Initial load
duke
parents:
diff changeset
    64
$(if $(word 2,$($1)),$(warning "WARNING: Value of $1 contains a space: '$($1)', check or set ALT_$1")Check_ALT_$1,$($1))
02bb8761fcce Initial load
duke
parents:
diff changeset
    65
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    66
02bb8761fcce Initial load
duke
parents:
diff changeset
    67
# Checks an ALT value for empty, warns and returns Check_ALT_$1 if empty
02bb8761fcce Initial load
duke
parents:
diff changeset
    68
define AltCheckValue
02bb8761fcce Initial load
duke
parents:
diff changeset
    69
$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, check or set ALT_$1")Check_ALT_$1)
02bb8761fcce Initial load
duke
parents:
diff changeset
    70
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    71
02bb8761fcce Initial load
duke
parents:
diff changeset
    72
# Checks any value for empty, warns and returns $2 if empty
02bb8761fcce Initial load
duke
parents:
diff changeset
    73
define CheckValue
02bb8761fcce Initial load
duke
parents:
diff changeset
    74
$(if $($1),$($1),$(warning "WARNING: Value of $1 cannot be empty, will use '$2'")$2)
02bb8761fcce Initial load
duke
parents:
diff changeset
    75
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    76
02bb8761fcce Initial load
duke
parents:
diff changeset
    77
# Prefix for a utility prefix path, if empty leave alone, otherwise end with a /
02bb8761fcce Initial load
duke
parents:
diff changeset
    78
define PrefixPath
02bb8761fcce Initial load
duke
parents:
diff changeset
    79
$(if $1,$(subst //,/,$1/),)
02bb8761fcce Initial load
duke
parents:
diff changeset
    80
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    81
02bb8761fcce Initial load
duke
parents:
diff changeset
    82
# Select a directory if it exists, or the alternate 2 or the alternate 3
02bb8761fcce Initial load
duke
parents:
diff changeset
    83
define DirExists
02bb8761fcce Initial load
duke
parents:
diff changeset
    84
$(shell \
02bb8761fcce Initial load
duke
parents:
diff changeset
    85
  if [ -d "$1" ]; then  \
02bb8761fcce Initial load
duke
parents:
diff changeset
    86
    echo "$1"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    87
  elif [ -d "$2" ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
    88
    echo "$2"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    89
  else \
02bb8761fcce Initial load
duke
parents:
diff changeset
    90
    echo "$3"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    91
  fi)
02bb8761fcce Initial load
duke
parents:
diff changeset
    92
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
    93
02bb8761fcce Initial load
duke
parents:
diff changeset
    94
# Select a writable directory if it exists and is writable, or the alternate
02bb8761fcce Initial load
duke
parents:
diff changeset
    95
define WriteDirExists
02bb8761fcce Initial load
duke
parents:
diff changeset
    96
$(shell \
02bb8761fcce Initial load
duke
parents:
diff changeset
    97
  if [ -d "$1" -a -w "$1" ]; then  \
02bb8761fcce Initial load
duke
parents:
diff changeset
    98
    echo "$1"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
    99
  else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   100
    echo "$2"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   101
  fi)
02bb8761fcce Initial load
duke
parents:
diff changeset
   102
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   103
02bb8761fcce Initial load
duke
parents:
diff changeset
   104
# Select a file if it exists, or the alternate 1, or the alternate 2
02bb8761fcce Initial load
duke
parents:
diff changeset
   105
define FileExists
02bb8761fcce Initial load
duke
parents:
diff changeset
   106
$(shell \
02bb8761fcce Initial load
duke
parents:
diff changeset
   107
  if [ -r "$1" ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   108
    echo "$1"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   109
  elif [ -r "$2" ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   110
    echo "$2"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   111
  else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   112
    echo "NO_FILE_EXISTS"; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   113
  fi)
02bb8761fcce Initial load
duke
parents:
diff changeset
   114
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   115
02bb8761fcce Initial load
duke
parents:
diff changeset
   116
# Given a line of text, get the major.minor version number from it
02bb8761fcce Initial load
duke
parents:
diff changeset
   117
define GetVersion
02bb8761fcce Initial load
duke
parents:
diff changeset
   118
$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
02bb8761fcce Initial load
duke
parents:
diff changeset
   119
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   120
02bb8761fcce Initial load
duke
parents:
diff changeset
   121
# Given a major.minor.micro version, return the major, minor, or micro number
02bb8761fcce Initial load
duke
parents:
diff changeset
   122
define MajorVersion
02bb8761fcce Initial load
duke
parents:
diff changeset
   123
$(if $(word 1, $(subst ., ,$1)),$(word 1, $(subst ., ,$1)),0)
02bb8761fcce Initial load
duke
parents:
diff changeset
   124
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   125
define MinorVersion
02bb8761fcce Initial load
duke
parents:
diff changeset
   126
$(if $(word 2, $(subst ., ,$1)),$(word 2, $(subst ., ,$1)),0)
02bb8761fcce Initial load
duke
parents:
diff changeset
   127
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   128
define MicroVersion
02bb8761fcce Initial load
duke
parents:
diff changeset
   129
$(if $(word 3, $(subst ., ,$1)),$(word 3, $(subst ., ,$1)),0)
02bb8761fcce Initial load
duke
parents:
diff changeset
   130
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   131
02bb8761fcce Initial load
duke
parents:
diff changeset
   132
# Macro that returns missing, same, newer, or older $1=version $2=required
02bb8761fcce Initial load
duke
parents:
diff changeset
   133
#  (currently does not check the micro number)
02bb8761fcce Initial load
duke
parents:
diff changeset
   134
define CheckVersions
02bb8761fcce Initial load
duke
parents:
diff changeset
   135
$(shell \
02bb8761fcce Initial load
duke
parents:
diff changeset
   136
  if [ "$1" = "" -o "$2" = "" ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   137
    echo missing; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   138
  else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   139
    if [ "$1" = "$2" ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   140
      echo same; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   141
    else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   142
      if [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   143
        echo older; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   144
      else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   145
	if [ $(call MajorVersion,$1) -eq $(call MajorVersion,$2) -a \
02bb8761fcce Initial load
duke
parents:
diff changeset
   146
	     $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
02bb8761fcce Initial load
duke
parents:
diff changeset
   147
          echo older; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   148
        else \
02bb8761fcce Initial load
duke
parents:
diff changeset
   149
          echo newer; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   150
        fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   151
      fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   152
    fi; \
02bb8761fcce Initial load
duke
parents:
diff changeset
   153
  fi)
02bb8761fcce Initial load
duke
parents:
diff changeset
   154
endef
02bb8761fcce Initial load
duke
parents:
diff changeset
   155
02bb8761fcce Initial load
duke
parents:
diff changeset
   156
# Make sure certain variables are non-empty at this point
02bb8761fcce Initial load
duke
parents:
diff changeset
   157
_check_values:=\
02bb8761fcce Initial load
duke
parents:
diff changeset
   158
$(call CheckValue,ARCH,),\
02bb8761fcce Initial load
duke
parents:
diff changeset
   159
$(call CheckValue,ARCH_DATA_MODEL,),\
02bb8761fcce Initial load
duke
parents:
diff changeset
   160
$(call CheckValue,ARCH_VM_SUBDIR,),\
02bb8761fcce Initial load
duke
parents:
diff changeset
   161
$(call CheckValue,VARIANT,),\
02bb8761fcce Initial load
duke
parents:
diff changeset
   162
$(call CheckValue,PLATFORM,)
02bb8761fcce Initial load
duke
parents:
diff changeset
   163
02bb8761fcce Initial load
duke
parents:
diff changeset
   164
# Misc common settings for all workspaces
02bb8761fcce Initial load
duke
parents:
diff changeset
   165
#   This determines the version of the product, and the previous version or boot
02bb8761fcce Initial load
duke
parents:
diff changeset
   166
ifndef JDK_MAJOR_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   167
  JDK_MAJOR_VERSION      = 1
02bb8761fcce Initial load
duke
parents:
diff changeset
   168
  PREVIOUS_MAJOR_VERSION = 1
02bb8761fcce Initial load
duke
parents:
diff changeset
   169
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   170
02bb8761fcce Initial load
duke
parents:
diff changeset
   171
ifndef JDK_MINOR_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   172
  JDK_MINOR_VERSION      = 7
02bb8761fcce Initial load
duke
parents:
diff changeset
   173
  PREVIOUS_MINOR_VERSION = 6
02bb8761fcce Initial load
duke
parents:
diff changeset
   174
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   175
02bb8761fcce Initial load
duke
parents:
diff changeset
   176
ifndef JDK_MICRO_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   177
  JDK_MICRO_VERSION      = 0
02bb8761fcce Initial load
duke
parents:
diff changeset
   178
  PREVIOUS_MICRO_VERSION = 0
02bb8761fcce Initial load
duke
parents:
diff changeset
   179
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   180
02bb8761fcce Initial load
duke
parents:
diff changeset
   181
ifndef MILESTONE
02bb8761fcce Initial load
duke
parents:
diff changeset
   182
  MILESTONE = internal
02bb8761fcce Initial load
duke
parents:
diff changeset
   183
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   184
02bb8761fcce Initial load
duke
parents:
diff changeset
   185
ifndef BUILD_NUMBER
02bb8761fcce Initial load
duke
parents:
diff changeset
   186
  JDK_BUILD_NUMBER = b00
02bb8761fcce Initial load
duke
parents:
diff changeset
   187
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   188
  ifndef JDK_BUILD_NUMBER
02bb8761fcce Initial load
duke
parents:
diff changeset
   189
    JDK_BUILD_NUMBER = $(BUILD_NUMBER)
02bb8761fcce Initial load
duke
parents:
diff changeset
   190
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   191
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   192
02bb8761fcce Initial load
duke
parents:
diff changeset
   193
# Default variant is the optimized version of everything
02bb8761fcce Initial load
duke
parents:
diff changeset
   194
#    can be OPT or DBG,  default is OPT
02bb8761fcce Initial load
duke
parents:
diff changeset
   195
#    Determine the extra pattern to add to the release name for debug/fastdebug.
02bb8761fcce Initial load
duke
parents:
diff changeset
   196
#    Determine the JDK_IMPORT_VARIANT, so we get the right VM files copied over.
02bb8761fcce Initial load
duke
parents:
diff changeset
   197
#    Determine suffix for obj directory or OBJDIR, for .o files.
02bb8761fcce Initial load
duke
parents:
diff changeset
   198
#    (by keeping .o files separate, just .o files, they don't clobber each
02bb8761fcce Initial load
duke
parents:
diff changeset
   199
#     other, however, the library files will clobber each other).
02bb8761fcce Initial load
duke
parents:
diff changeset
   200
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   201
ifeq ($(VARIANT), DBG)
02bb8761fcce Initial load
duke
parents:
diff changeset
   202
  BUILD_VARIANT_RELEASE=-debug
02bb8761fcce Initial load
duke
parents:
diff changeset
   203
  OBJDIRNAME_SUFFIX=_g
02bb8761fcce Initial load
duke
parents:
diff changeset
   204
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   205
  BUILD_VARIANT_RELEASE=
02bb8761fcce Initial load
duke
parents:
diff changeset
   206
  OBJDIRNAME_SUFFIX=
02bb8761fcce Initial load
duke
parents:
diff changeset
   207
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   208
ifeq ($(FASTDEBUG), true)
02bb8761fcce Initial load
duke
parents:
diff changeset
   209
  VARIANT=DBG
02bb8761fcce Initial load
duke
parents:
diff changeset
   210
  BUILD_VARIANT_RELEASE=-fastdebug
02bb8761fcce Initial load
duke
parents:
diff changeset
   211
  OBJDIRNAME_SUFFIX=_gO
02bb8761fcce Initial load
duke
parents:
diff changeset
   212
  _JDK_IMPORT_VARIANT=/fastdebug
02bb8761fcce Initial load
duke
parents:
diff changeset
   213
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   214
02bb8761fcce Initial load
duke
parents:
diff changeset
   215
# Depending on the flavor of the build, add a -debug or -fastdebug to the name
02bb8761fcce Initial load
duke
parents:
diff changeset
   216
ifdef DEBUG_NAME
02bb8761fcce Initial load
duke
parents:
diff changeset
   217
  BUILD_VARIANT_RELEASE=-$(DEBUG_NAME)
02bb8761fcce Initial load
duke
parents:
diff changeset
   218
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   219
02bb8761fcce Initial load
duke
parents:
diff changeset
   220
JDK_VERSION  = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   221
JDK_UNDERSCORE_VERSION =  $(subst .,_,$(JDK_VERSION))
02bb8761fcce Initial load
duke
parents:
diff changeset
   222
02bb8761fcce Initial load
duke
parents:
diff changeset
   223
# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set
02bb8761fcce Initial load
duke
parents:
diff changeset
   224
ifneq ($(MILESTONE),fcs)
02bb8761fcce Initial load
duke
parents:
diff changeset
   225
  RELEASE      = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   226
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   227
  RELEASE      = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE)
02bb8761fcce Initial load
duke
parents:
diff changeset
   228
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   229
02bb8761fcce Initial load
duke
parents:
diff changeset
   230
# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set
3871
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   231
ifndef FULL_VERSION
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   232
  ifdef BUILD_NUMBER
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   233
    FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   234
  else
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   235
    BUILD_NUMBER = b00
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   236
    USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`)
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   237
    FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   238
  endif
3d528461f61d 6875240: Reduce Makefile build time by limiting repeated exec's (mostly for cygwin building)
ohair
parents: 2192
diff changeset
   239
  export FULL_VERSION
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   240
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   241
02bb8761fcce Initial load
duke
parents:
diff changeset
   242
# Promoted build location
02bb8761fcce Initial load
duke
parents:
diff changeset
   243
PROMOTED_RE_AREA = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted
02bb8761fcce Initial load
duke
parents:
diff changeset
   244
PROMOTED_BUILD_LATEST = latest
02bb8761fcce Initial load
duke
parents:
diff changeset
   245
PROMOTED_BUILD_BASEDIR = $(PROMOTED_RE_AREA)/$(PROMOTED_BUILD_LATEST)
02bb8761fcce Initial load
duke
parents:
diff changeset
   246
PROMOTED_BUILD_BINARIES = $(PROMOTED_BUILD_BASEDIR)/binaries
02bb8761fcce Initial load
duke
parents:
diff changeset
   247
02bb8761fcce Initial load
duke
parents:
diff changeset
   248
# OPT: Changes what the optimizations settings (in _OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   249
POPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
02bb8761fcce Initial load
duke
parents:
diff changeset
   250
02bb8761fcce Initial load
duke
parents:
diff changeset
   251
# PARALLEL_COMPILE_JOBS: is the number of compiles done in parallel.
02bb8761fcce Initial load
duke
parents:
diff changeset
   252
#  If the user sets ALT_PARALLEL_COMPILE_JOBS, then COMPILE_APPROACH is set
02bb8761fcce Initial load
duke
parents:
diff changeset
   253
#  to parallel.
02bb8761fcce Initial load
duke
parents:
diff changeset
   254
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   255
#  Recommended setting: 2 seems to be ideal for single cpu machines,
02bb8761fcce Initial load
duke
parents:
diff changeset
   256
#                       2 times the number of CPU's is a basic formula, 
02bb8761fcce Initial load
duke
parents:
diff changeset
   257
#                       but probably not more than 4 if the machine is 
02bb8761fcce Initial load
duke
parents:
diff changeset
   258
#                       being shared by others, or the machine is limited 
02bb8761fcce Initial load
duke
parents:
diff changeset
   259
#                       in RAM or swap.
02bb8761fcce Initial load
duke
parents:
diff changeset
   260
#
02bb8761fcce Initial load
duke
parents:
diff changeset
   261
ifdef ALT_PARALLEL_COMPILE_JOBS
02bb8761fcce Initial load
duke
parents:
diff changeset
   262
  PARALLEL_COMPILE_JOBS=$(ALT_PARALLEL_COMPILE_JOBS)
02bb8761fcce Initial load
duke
parents:
diff changeset
   263
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   264
  PARALLEL_COMPILE_JOBS=2
02bb8761fcce Initial load
duke
parents:
diff changeset
   265
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   266
02bb8761fcce Initial load
duke
parents:
diff changeset
   267
# Previous JDK release (version of BOOTDIR version)
02bb8761fcce Initial load
duke
parents:
diff changeset
   268
ifdef ALT_PREVIOUS_JDK_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   269
  PREVIOUS_JDK_VERSION = $(ALT_PREVIOUS_JDK_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   270
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   271
  PREVIOUS_JDK_VERSION  = $(PREVIOUS_MAJOR_VERSION).$(PREVIOUS_MINOR_VERSION).$(PREVIOUS_MICRO_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   272
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   273
export PREVIOUS_JDK_VERSION
02bb8761fcce Initial load
duke
parents:
diff changeset
   274
PREVIOUS_JDK_VERSION:=$(call AltCheckSpaces,PREVIOUS_JDK_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   275
PREVIOUS_JDK_VERSION:=$(call AltCheckValue,PREVIOUS_JDK_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   276
02bb8761fcce Initial load
duke
parents:
diff changeset
   277
# Version with _ instead of . in number
02bb8761fcce Initial load
duke
parents:
diff changeset
   278
ifeq ($(PREVIOUS_MINOR_VERSION),5)
02bb8761fcce Initial load
duke
parents:
diff changeset
   279
  PREVIOUS_JDK_UNDERSCORE_VERSION =  $(subst .,_,$(PREVIOUS_JDK_VERSION))
02bb8761fcce Initial load
duke
parents:
diff changeset
   280
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   281
  PREVIOUS_JDK_UNDERSCORE_VERSION = $(PREVIOUS_MINOR_VERSION)
02bb8761fcce Initial load
duke
parents:
diff changeset
   282
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   283
02bb8761fcce Initial load
duke
parents:
diff changeset
   284
# Get platform specific settings
02bb8761fcce Initial load
duke
parents:
diff changeset
   285
include $(BUILDDIR)/common/shared/Defs-$(PLATFORM).gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
   286
148
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   287
# Components
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   288
ifdef ALT_LANGTOOLS_DIST
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   289
  LANGTOOLS_DIST :=$(call FullPath,$(ALT_LANGTOOLS_DIST))
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   290
else
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   291
  LANGTOOLS_DIST =
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   292
endif
66df97a4308f 6624808: corba makefiles not using langtools compiler
ohair
parents: 4
diff changeset
   293
4
02bb8761fcce Initial load
duke
parents:
diff changeset
   294
# These are the same on all platforms but require the above platform include 1st
02bb8761fcce Initial load
duke
parents:
diff changeset
   295
02bb8761fcce Initial load
duke
parents:
diff changeset
   296
# BOOTDIR: Bootstrap JDK, previous released JDK.
02bb8761fcce Initial load
duke
parents:
diff changeset
   297
#   _BOOTDIR1 and _BOOTDIR2 picked by platform
02bb8761fcce Initial load
duke
parents:
diff changeset
   298
ifdef ALT_BOOTDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
   299
  BOOTDIR =$(ALT_BOOTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   300
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   301
  BOOTDIR  :=$(call DirExists,$(_BOOTDIR1),$(_BOOTDIR2),/NO_BOOTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   302
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   303
export BOOTDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
   304
BOOTDIR:=$(call AltCheckSpaces,BOOTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   305
BOOTDIR:=$(call AltCheckValue,BOOTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   306
02bb8761fcce Initial load
duke
parents:
diff changeset
   307
# OUTPUTDIR: Location of all output for the build
02bb8761fcce Initial load
duke
parents:
diff changeset
   308
_BACKUP_OUTPUTDIR = $(TEMP_DISK)/$(USER)/jdk-outputdir
02bb8761fcce Initial load
duke
parents:
diff changeset
   309
ifdef ALT_OUTPUTDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
   310
  _POSSIBLE_OUTPUTDIR =$(subst \,/,$(ALT_OUTPUTDIR))
02bb8761fcce Initial load
duke
parents:
diff changeset
   311
else
02bb8761fcce Initial load
duke
parents:
diff changeset
   312
  ifndef _OUTPUTDIR
02bb8761fcce Initial load
duke
parents:
diff changeset
   313
    _OUTPUTDIR = $(_BACKUP_OUTPUTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   314
  endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   315
  _POSSIBLE_OUTPUTDIR =$(_OUTPUTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   316
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   317
_create_outputdir1:=$(shell mkdir -p $(_POSSIBLE_OUTPUTDIR) > $(DEV_NULL) 2>&1)
02bb8761fcce Initial load
duke
parents:
diff changeset
   318
OUTPUTDIR:=$(call WriteDirExists,$(_POSSIBLE_OUTPUTDIR),$(_BACKUP_OUTPUTDIR))
02bb8761fcce Initial load
duke
parents:
diff changeset
   319
_create_outputdir2:=$(shell mkdir -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1)
02bb8761fcce Initial load
duke
parents:
diff changeset
   320
ifeq "$(OUTPUTDIR)" "$(_BACKUP_OUTPUTDIR)"
02bb8761fcce Initial load
duke
parents:
diff changeset
   321
  _outputdir_warning:=$(warning "WARNING: OUTPUTDIR '$(_POSSIBLE_OUTPUTDIR)' not writable, will use '$(_BACKUP_OUTPUTDIR)'")
02bb8761fcce Initial load
duke
parents:
diff changeset
   322
endif
02bb8761fcce Initial load
duke
parents:
diff changeset
   323
OUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   324
OUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   325
02bb8761fcce Initial load
duke
parents:
diff changeset
   326
# Bin directory
02bb8761fcce Initial load
duke
parents:
diff changeset
   327
#   NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
02bb8761fcce Initial load
duke
parents:
diff changeset
   328
BINDIR      = $(OUTPUTDIR)/bin$(ISA_DIR)
02bb8761fcce Initial load
duke
parents:
diff changeset
   329
  
02bb8761fcce Initial load
duke
parents:
diff changeset
   330
# Absolute path to output directory
02bb8761fcce Initial load
duke
parents:
diff changeset
   331
ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
02bb8761fcce Initial load
duke
parents:
diff changeset
   332
02bb8761fcce Initial load
duke
parents:
diff changeset
   333
# Get shared compiler settings
02bb8761fcce Initial load
duke
parents:
diff changeset
   334
include $(BUILDDIR)/common/shared/Compiler.gmk
02bb8761fcce Initial load
duke
parents:
diff changeset
   335