jdk/make/common/Defs.gmk
author kvn
Wed, 05 Mar 2008 11:33:31 -0800
changeset 210 6da234892f4a
parent 2 90ce3da70b43
child 30 7ea1edf98bfe
permissions -rw-r--r--
6671250: In Parse::do_if() old Cmp node 'c' should be replaced with new one after BoolNode transformation Summary: In Parse::do_if() 'c' (CmpNode) node may be changed during BoolNode transformation so 'c' may became dead but the node is referenced later in the code. Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 1995-2007 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Common variables used by all the Java makefiles.  This file should
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
# not contain rules.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
# WARNING: This file is shared with other workspaces.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#          So when it includes other files, it must use JDK_TOPDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
#    This little rule is only understood by Sun's make, and is harmless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
#    when seen by the GNU make tool. If using Sun's make, this causes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
#    make command to fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
ifndef JDK_TOPDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  JDK_TOPDIR=$(BUILDDIR)/..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
ifndef JDK_MAKE_SHARED_DIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
TOPDIR=$(BUILDDIR)/..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
# src/solaris so if you want to build on Linux you didn't need a src/linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
# directory.  In an ideal world it would be called src/genunix but we are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
# there yet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
ifndef SHARE_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
  SHARE_SRC    = $(JDK_TOPDIR)/src/share
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
# Files that cannot be included in the OpenJDK distribution are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
# collected under a parent directory which contains just those files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
ifndef CLOSED_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
  CLOSED_SRC  = $(JDK_TOPDIR)/src/closed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
# If we have no closed directory, force it to an openjdk build
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
CLOSED_SRC_DIR_EXISTS := $(shell \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
  if [ -d $(CLOSED_SRC) ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    echo true; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
  else \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    echo false; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
  fi)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
ifeq ($(CLOSED_SRC_DIR_EXISTS), false)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
  OPENJDK = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
# Check for strange explicit settings (change to empty or true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
  ifeq ($(OPENJDK),false)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    # Silently treat as not defined
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    OPENJDK =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    ifneq ($(OPENJDK),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
      dummy := $(warning "WARNING: OPENKJDK=$(OPENJDK) being treated as true")
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
      OPENJDK = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
# Define where closed directories are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
  CLOSED_SRC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
  CLOSED_SHARE_SRC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
  ifndef CLOSED_SHARE_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    CLOSED_SHARE_SRC    = $(CLOSED_SRC)/share
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
# If OPENJDK is defined, we may still need to use some native libraries that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
# exist only as part of the closed source. If the closed sources are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
# available, the libraries must have been pre-built. Since these libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
# and the JDK internal interfaces to these are reasonably stable this is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
# a significant problem. But we do need to provide a way to locate them,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# including a way to point to a new one when there have been changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
# If you have a formal binary plugs download, set ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
# to the location.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
# (Optionally you can set ALT_CLOSED_JDK_IMPORT_PATH to point to the latest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
#  build JDK, or last promotion for this JDK version, but will not work
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
#  on windows).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
# As the OPENJDK is built, the binary plugs are used instead of building the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
# libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
# Individual Makefiles that specify USE_BINARY_PLUG_LIBRARY, will get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
# the binary plug copy (or a copy from a built JDK).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
# See common/internal/BinaryPlugs.gmk for more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
# Usage notes:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
#   ALT_BINARY_PLUGS_JARFILE is probably rarely needed. It can be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#   to identify the exact jar file to be used for all closed classes..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#   ALT_BINARY_PLUGS_PATH points to a directory containing precisely the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#   binaries needed to build. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#   ALT_BUILD_BINARY_PLUGS_PATH points to a directory containing binary plug dirs 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#   multiple architectures named using the standard conventions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#   This is useful for build scripts that need to build multiple architectures
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#   of the OpenJDK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#   ALT_CLOSED_JDK_IMPORT_PATH points to the top-level of a specific platform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#   JDK image.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#   The precedence is that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#     1. ALT_BINARY_PLUGS_JARFILE overrides any other location of the classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#     2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#     3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
#     4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
# Always needed, defines the name of the imported/exported jarfile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
BINARY_PLUGS_JARNAME = rt-closed.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
  ifdef ALT_CLOSED_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    CLOSED_JDK_IMPORT_PATH = $(ALT_CLOSED_JDK_IMPORT_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    BINARY_PLUGS_PATH = $(CLOSED_JDK_IMPORT_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    BINARY_PLUGS_JARFILE = $(CLOSED_JDK_IMPORT_PATH)/jre/lib/rt.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
  ifdef ALT_BUILD_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
  BINARY_PLUGS_PATH = $(BUILD_BINARY_PLUGS_PATH)/$(PLATFORM)-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
  BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  ifdef ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    BINARY_PLUGS_PATH  = $(ALT_BINARY_PLUGS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  ifdef ALT_BINARY_PLUGS_JARFILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    BINARY_PLUGS_JARFILE = $(ALT_BINARY_PLUGS_JARFILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
endif # OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
# Default output directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
# Get platform definitions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
# Freetype logic is applicable to OpenJDK only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
#if we use system lib we do not need to copy it to build tree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
USING_SYSTEM_FT_LIB=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
  # historically for Solaris we have slightly different devtools 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
  # naming conventions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
DEVTOOLS_FT_DIR_EXISTS = $(shell \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
  if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    echo true; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
  else \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    echo false; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
  fi)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
  ifdef ALT_FREETYPE_LIB_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
      FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
      FREETYPE_LIB_PATH = /usr/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
      USING_SYSTEM_FT_LIB=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
  endif 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
  ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    FREETYPE_LIB = $(FREETYPE_LIB_PATH)/freetype.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    FREETYPE_LIB = -L$(FREETYPE_LIB_PATH) -lfreetype
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
  ifdef ALT_FREETYPE_HEADERS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
      FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
      FREETYPE_HEADERS_PATH = /usr/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
# Localizations for the different parts of the product beyond English
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
JRE_LOCALES   = de es fr it ja ko sv zh_CN zh_TW zh_HK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
JDK_LOCALES  = ja zh_CN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
# A list of locales we support but don't have resource files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
# This is defined to optimize the search of resource bundles.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
# All libraries except libjava and libjvm itself link against libjvm and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
# libjava, the latter for its exported common utilities.  libjava only links
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
# against libjvm.  Programs' makefiles take their own responsibility for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
# adding other libs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
ifdef PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
# put JAVALIB first, but do not lose any platform specific values....
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
  LDLIBS_COMMON = $(JAVALIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
endif # PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
# Libraries that must appear ahead of libc.so on the link command line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
ifdef PROGRAM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
  ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    LDLIBS_COMMON = -lthread -ldl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
  ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    LDLIBS_COMMON = -ldl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
endif # PROGRAM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
LDLIBS_COMMON += $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
# Default is to build, not import native binaries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
ifndef IMPORT_NATIVE_BINARIES
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
  IMPORT_NATIVE_BINARIES=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
# If importing libraries in, no incremental builds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
ifeq ($(IMPORT_NATIVE_BINARIES),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
 INCREMENTAL_BUILD=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
# for generated libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
LIBDIR              = $(OUTPUTDIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
ABS_LIBDIR          = $(ABS_OUTPUTDIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
# Optional place to save the windows .lib files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
LIBFILES_DIR        = $(OUTPUTDIR)/libfiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
# for ext jre files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
EXTDIR              = $(LIBDIR)/ext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
# for generated include files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
INCLUDEDIR          = $(OUTPUTDIR)/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
# for generated class files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
CLASSBINDIR         = $(OUTPUTDIR)/classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
# for generated tool class files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
# for build tool jar files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
BUILDTOOLJARDIR     = $(OUTPUTDIR)/btjars
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
# for generated java source files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
GENSRCDIR           = $(OUTPUTDIR)/gensrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
# for generated C source files (not javah)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
GENNATIVESRCDIR     = $(OUTPUTDIR)/gennativesrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
# for imported source files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
IMPORTSRCDIR        = $(OUTPUTDIR)/impsrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
# for imported documents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
IMPORTDOCDIR        = $(OUTPUTDIR)/impdoc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
# for generated demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
DEMODIR             = $(OUTPUTDIR)/demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
# for sample code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
SAMPLEDIR           = $(OUTPUTDIR)/sample
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
# for generated documentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
DOCSDIR             = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
DOCSDIRSUFFIX       =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
# The MESSAGE, WARNING and ERROR files are used to store sanityck and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
# SCCS check messages, warnings and errors. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
ifndef ERROR_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
  ERROR_FILE   = $(OUTPUTDIR)/sanityCheckErrors.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
ifndef WARNING_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
  WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
ifndef MESSAGE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
  MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
#where the demo source can be found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
DEMOSRCDIR          = $(SHARE_SRC)/demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
# An attempt is made to generate unique enough directories for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
# generated files to not have name collisisons. Most build units
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
# defines PRODUCT (except Release.gmk), but then they may or may 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
# LIBRARY. This code chunk attempts to generate a unique 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
# OBJDIR/CLASSHDRDIR for each build unit based on which of those 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
# values are set within each build unit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
UNIQUE_LOCATION_STRING = tmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
ifneq ($(PRODUCT),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
  UNIQUE_LOCATION_STRING += /$(PRODUCT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
ifneq ($(PACKAGE),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
  UNIQUE_LOCATION_STRING += /$(PACKAGE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
ifneq ($(PROGRAM),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
  UNIQUE_LOCATION_STRING += /$(PROGRAM)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
ifneq ($(LIBRARY),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
  ifneq ($(LIBRARY_OUTPUT),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    UNIQUE_LOCATION_STRING += /$(LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
ifneq ($(THREADDIR),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
  UNIQUE_LOCATION_STRING += /$(THREADDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
# the use of += above makes a space separated list which we need to 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
# remove for filespecs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
NULLSTRING :=
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
ONESPACE := $(NULLSTRING) # space before this comment is required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
# TEMPDIR is a unique general purpose directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
# need to use 'override' because GNU Make on Linux exports the wrong
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
# value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
override TEMPDIR      = $(OUTPUTDIR)/$(UNIQUE_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
override ABS_TEMPDIR  = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
# This must be created right away for pattern rules in Sanity.gmk to work.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
# OBJDIRNAME is the name of the directory where the object code is to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
#   be placed. It's name depends on whether the data model architecture 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
#   is 32-bit or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
ifneq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
  OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
  OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
OBJDIR      = $(TEMPDIR)/$(OBJDIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
# CLASSHDRDIR is where the generated C Class Header files go.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
# CLASSDESTDIR can be used to specify the directory where generated classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
# are to be placed. The default is CLASSBINDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
ifndef CLASSDESTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
CLASSDESTDIR = $(CLASSBINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
INCLUDES = -I. -I$(CLASSHDRDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
	$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
OTHER_CPPFLAGS = $(INCLUDES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
# vpaths.  These are the default locations searched for source files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
# GNUmakefiles of individual areas often override the default settings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
# There are no longer default vpath entries for C and assembler files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
# so we can ensure that libraries don't get their hands on JVM files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
# We define an intermediate variable for Java files because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
# we use its value later to help define $SOURCEPATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
  VPATH.java = $(VPATH0.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
  # If filenames are duplicated between open/closed workspaces, prefer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
  # the closed files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
  # Source ordering is important: some targets depend on closed files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
  # replacing open ones, and thus the closed file sources must be found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
  # before the open ones.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
  # Don't reorder without consulting the teams that depend on this behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
  VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
vpath %.java $(VPATH.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
vpath %.class $(CLASSBINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
# VPATH.h is used elsewhere to generate include flags.  By default, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
# anyone has access to the include files that the JVM area exports,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
# relatives.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
VPATH.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/include$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/javavm/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
vpath %.h   $(VPATH.h)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
# Used in two ways: helps link against libjava.so. Also if overridden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
# determines where your shared library is installed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
ifndef LIB_LOCATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
  LIB_LOCATION    =  $(LIBDIR)/$(LIBARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
# Java header and stub variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
CLASSHDRS     = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
STUBPREAMBLE  = $(INCLUDEDIR)/StubPreamble.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
# Classpath seen by javac (different from the one seen by the VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
# running javac), and useful variables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
SOURCEPATH	= $(VPATH.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
PKG		= $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
PKGDIR		= $(subst .,/,$(PACKAGE))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
# Set opt level to ALT_OPT if set otherwise _OPT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
POPT = $(_OPT$(ALT_OPT))$(ALT_OPT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
# Convenient macros
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
# Prepare $@ target, remove old one and making sure directory exists
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
define prep-target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
$(MKDIR) -p $(@D)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
$(RM) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
# Simple install of $< file to $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
define install-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
$(CP) $< $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
# Cleanup rule for after debug java run (hotspot.log file is left around)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
#   (This could be an old leftover file in a read-only area, use the @- prefix)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
HOTSPOT_LOG_NAME = hotspot.log
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
define java-vm-cleanup
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
# Default make settings for processing SUBDIRS with clobber or clean names
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
SUBDIRS_MAKEFLAGS-clean   = INCREMENTAL_BUILD=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
# Current directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
CURRENT_DIRECTORY := $(shell $(PWD))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
# If no timing wanted, we need to define these as empty
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
ifdef NO_TIMING
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
TIMING_ID:=NA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
define TIMING_start
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
t=0:0:0:0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
define TIMING_end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
time_used=0
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
else # NO_TIMING
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
# Default timing id
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
# Timing start (must be used in same shell, e.g. same command line)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
#    Defines the shell variable $1 to have the start time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
define TIMING_start
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
$1=`$(DATE) +%j:%H:%M:%S`
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
# Timing end (must be used in same shell, e.g. same command line)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
#    Expects shell variable $1 to have been defined as the start time.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
#    Expects shell variable $2 to have timing id string
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
#    Sets total_seconds shell variable as the total seconds used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
#    Sets time_used shell variable to contain format "%dh%dm%ds"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
define TIMING_end
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
begTime="$${$1}"; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
timing_id="$${$2}"; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
endTime=`$(DATE) +%j:%H:%M:%S`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
if [ "$${d1}" = "" ] ; then d1=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
if [ "$${h1}" = "" ] ; then h1=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
if [ "$${m1}" = "" ] ; then m1=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
if [ "$${s1}" = "" ] ; then s1=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
if [ "$${d2}" = "" ] ; then d2=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
if [ "$${h2}" = "" ] ; then h2=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
if [ "$${m2}" = "" ] ; then m2=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
if [ "$${s2}" = "" ] ; then s2=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
		 '+' $${m1} '*' 60 '+' $${s1}`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
		 '+' $${m2} '*' 60 '+' $${s2}`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
time_used=$${t_sec}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
if [ "$${t_hour}" != "0h" ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
time_used=$${t_hour}$${t_min}$${t_sec}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
elif [ "$${t_min}" != "0m" ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
time_used=$${t_min}$${t_sec}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
else \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
time_used=$${t_sec}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
fi; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
$(PRINTF) "  Timing: %05d seconds or %s for %s\n" \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    $${total_seconds} $${time_used} $${timing_id}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
endif # NO_TIMING
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
# Given a SUBDIRS list, cd into them and make them
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
#   SUBDIRS_MAKEFLAGS      Make settings for a subdir make
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
#   SUBDIRS_MAKEFLAGS-$@   Make settings specific to this target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
define SUBDIRS-loop
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
@for i in DUMMY $(SUBDIRS) ; do \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
  if [ "$$i" != "DUMMY" ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
    $(call TIMING_start,startTime); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
    curDir=$(CURRENT_DIRECTORY); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
			  $(SUBDIRS_MAKEFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
			  $(SUBDIRS_MAKEFLAGS-$@) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
			  FULL_VERSION=$(FULL_VERSION) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
			  RELEASE=$(RELEASE) || exit 1; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
	       $(CD) $${curDir}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
    $(call TIMING_end,startTime,timing_id); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
  fi ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
#   OTHERSUBDIRS_MAKEFLAGS      Make settings for a subdir make
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
define OTHERSUBDIRS-loop
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
@for i in DUMMY $(OTHERSUBDIRS) ; do \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
  if [ "$$i" != "DUMMY" ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
    timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    $(call TIMING_start,startTime); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
    curDir=$(CURRENT_DIRECTORY); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
    $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
		          $(OTHERSUBDIRS_MAKEFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
			  FULL_VERSION=$(FULL_VERSION) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
			  RELEASE=$(RELEASE) || exit 1; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
	       $(CD) $${curDir}; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
    $(call TIMING_end,startTime,timing_id); \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
    $(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
  fi ; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
done
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
#    used for this file, otherwise the default settings are used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
CFLAGS_$(VARIANT)/BYFILE    = $(CFLAGS_$(VARIANT)/$(@F)) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
                              $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
CXXFLAGS_$(VARIANT)/BYFILE  = $(CXXFLAGS_$(VARIANT)/$(@F)) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
                              $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
# Tool flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
		  $(DEFINES) $(OPTIONS:%=-D%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
		  $(OTHER_LINTFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
# this should be moved into Defs-<platform>.gmk.....
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
  VERSION_DEFINES = -DRELEASE="\"$(RELEASE)\""
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
  VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
# Note: As a rule, GNU Make rules should not appear in any of the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
# Defs*.gmk files. These were added for Kestrel-Solaris and do address
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
# a TeamWare bug. They should be moved elsewhere for Merlin.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
#  Override gnumake built-in rules which do sccs get operations badly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
#  (They put the checked out code in the current directory, not in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
#  directory of the original file.) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
# Since this is a symptom of a teamware failure, complain and die on the spot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
# This message immediately goes to stdout and the build terminates.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
define SCCS-trouble
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
$(error  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
 is out of date with respect to its SCCS file $<. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
 This can happen from an unresolved Teamware conflict, a file movement, or \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
 a failure in which SCCS files are updated but the 'sccs get' was not done. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
 You should double check for other out of date files in your workspace. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
 Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   690
90ce3da70b43 Initial load
duke
parents:
diff changeset
   691
%:: s.%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   692
	@$(SCCS-trouble)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   693
%:: SCCS/s.%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   694
	@$(SCCS-trouble)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   695
	@$(ECHO) "         is out of date with respect to its SCCS file." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
	@$(ECHO) "         This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
	@$(ECHO) "         This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
	@$(ECHO) "         in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   699
	@$(ECHO) "         Check for other out of date files in your workspace." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   700
	@$(ECHO) "" >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
	@#exit 666
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
ifdef INSANE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
  export INSANE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
90ce3da70b43 Initial load
duke
parents:
diff changeset
   707
ifdef ALT_COPYRIGHT_YEAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
  COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   710
  COPYRIGHT_YEAR = $(shell $(DATE) '+%Y')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   712
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
define install-import-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
@$(ECHO) "ASSEMBLY_IMPORT: $@"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   716
$(install-file)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
.PHONY: all build clean clobber