jdk/make/common/Defs.gmk
author alanb
Tue, 07 Sep 2010 08:36:10 +0100
changeset 6532 46e43203603e
parent 5506 202f599c92aa
child 6681 e721d11e4826
permissions -rw-r--r--
6971706: sun/nio/cs/ext/* classes are duplicated between rt.jar, charsets.jar, and localedata.jar Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
     2
# Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
2
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
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
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
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4917
diff changeset
    23
# questions.
2
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
139
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    35
# Check for strange explicit settings (change to empty or true)
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    36
ifdef OPENJDK
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    37
  ifneq ($(OPENJDK),true)
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    38
    x:=$(error "OPENJDK (if defined) can only be set to true")
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    39
  endif
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    40
endif
05173e59b878 6674232: OPENJDK=false is same as OPENJDK=true
ohair
parents: 33
diff changeset
    41
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
#    This little rule is only understood by Sun's make, and is harmless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
#    when seen by the GNU make tool. If using Sun's make, this causes the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
#    make command to fail.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
ifndef JDK_TOPDIR
32
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    51
  ifdef BUILDDIR
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    52
    JDK_TOPDIR=$(BUILDDIR)/..
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    53
  else
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    54
    JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository")
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    55
  endif
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    56
endif
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    57
ifndef BUILDDIR
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    58
  # Hack, due to deploy repository using this file.
d190436d5b3e 6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents: 30
diff changeset
    59
  BUILDDIR=$(JDK_TOPDIR)/make
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
ifndef JDK_MAKE_SHARED_DIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
  JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
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
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
TOPDIR=$(BUILDDIR)/..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
# src/solaris so if you want to build on Linux you didn't need a src/linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
# directory.  In an ideal world it would be called src/genunix but we are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
# there yet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
ifndef SHARE_SRC
30
7ea1edf98bfe 6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents: 2
diff changeset
    77
  SHARE_SRC    = $(BUILDDIR)/../src/share
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
# Files that cannot be included in the OpenJDK distribution are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
# collected under a parent directory which contains just those files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
ifndef CLOSED_SRC
30
7ea1edf98bfe 6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents: 2
diff changeset
    83
  CLOSED_SRC  = $(BUILDDIR)/../src/closed
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
# If we have no closed directory, force it to an openjdk build
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
CLOSED_SRC_DIR_EXISTS := $(shell \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
  if [ -d $(CLOSED_SRC) ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    echo true; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
  else \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    echo false; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
  fi)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
ifeq ($(CLOSED_SRC_DIR_EXISTS), false)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
  OPENJDK = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
# Define where closed directories are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
  CLOSED_SRC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
  CLOSED_SHARE_SRC =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
  ifndef CLOSED_SHARE_SRC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    CLOSED_SHARE_SRC    = $(CLOSED_SRC)/share
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
# If OPENJDK is defined, we may still need to use some native libraries that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
# exist only as part of the closed source. If the closed sources are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
# available, the libraries must have been pre-built. Since these libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
# and the JDK internal interfaces to these are reasonably stable this is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
# a significant problem. But we do need to provide a way to locate them,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
# including a way to point to a new one when there have been changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
# If you have a formal binary plugs download, set ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
# to the location.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
# (Optionally you can set ALT_CLOSED_JDK_IMPORT_PATH to point to the latest
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
#  build JDK, or last promotion for this JDK version, but will not work
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
#  on windows).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
# As the OPENJDK is built, the binary plugs are used instead of building the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
# libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
# Individual Makefiles that specify USE_BINARY_PLUG_LIBRARY, will get
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
# the binary plug copy (or a copy from a built JDK).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
# See common/internal/BinaryPlugs.gmk for more information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
# Usage notes:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
#   ALT_BINARY_PLUGS_JARFILE is probably rarely needed. It can be used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
#   to identify the exact jar file to be used for all closed classes..
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
#   ALT_BINARY_PLUGS_PATH points to a directory containing precisely the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
#   binaries needed to build. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
#   ALT_BUILD_BINARY_PLUGS_PATH points to a directory containing binary plug dirs 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
#   multiple architectures named using the standard conventions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
#   This is useful for build scripts that need to build multiple architectures
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
#   of the OpenJDK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
#   
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
#   ALT_CLOSED_JDK_IMPORT_PATH points to the top-level of a specific platform
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
#   JDK image.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
#  
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
#   The precedence is that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
#     1. ALT_BINARY_PLUGS_JARFILE overrides any other location of the classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
#     2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
#     3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
#     4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries
2301
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   148
#   Note: If any of the ALT_ variables are modified here, it is assumed
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   149
#         that the build should be done with IMPORT_BINARY_PLUGS=true as
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   150
#         well.  Otherwise the default will be IMPORT_BINARY_PLUGS=false.
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   151
#         Lastly, setting IMPORT_BINARY_PLUGS=false on the command line
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   152
#         will override this logic, and plugs will not be imported.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
# Always needed, defines the name of the imported/exported jarfile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
BINARY_PLUGS_JARNAME = rt-closed.jar
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
  ifdef ALT_CLOSED_JDK_IMPORT_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    CLOSED_JDK_IMPORT_PATH = $(ALT_CLOSED_JDK_IMPORT_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    BINARY_PLUGS_PATH = $(CLOSED_JDK_IMPORT_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    BINARY_PLUGS_JARFILE = $(CLOSED_JDK_IMPORT_PATH)/jre/lib/rt.jar
2301
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   163
    IMPORT_BINARY_PLUGS=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
  ifdef ALT_BUILD_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH)
2301
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   167
    IMPORT_BINARY_PLUGS=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
  BINARY_PLUGS_PATH = $(BUILD_BINARY_PLUGS_PATH)/$(PLATFORM)-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
  BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
  ifdef ALT_BINARY_PLUGS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    BINARY_PLUGS_PATH  = $(ALT_BINARY_PLUGS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME)
2301
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   176
    IMPORT_BINARY_PLUGS=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
  ifdef ALT_BINARY_PLUGS_JARFILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    BINARY_PLUGS_JARFILE = $(ALT_BINARY_PLUGS_JARFILE)
2301
0a3821d472a3 6819847: build is broken for OpenJDK with plugs
tbell
parents: 1166
diff changeset
   180
    IMPORT_BINARY_PLUGS=true
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
endif # OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
# Get platform definitions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
# Freetype logic is applicable to OpenJDK only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
#if we use system lib we do not need to copy it to build tree
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
USING_SYSTEM_FT_LIB=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
  # historically for Solaris we have slightly different devtools 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
  # naming conventions
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
  DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
DEVTOOLS_FT_DIR_EXISTS = $(shell \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
  if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    echo true; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  else \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    echo false; \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  fi)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
  ifdef ALT_FREETYPE_LIB_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
      FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
      FREETYPE_LIB_PATH = /usr/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
      USING_SYSTEM_FT_LIB=true
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
  endif 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
  ifdef ALT_FREETYPE_HEADERS_PATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
      FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
      FREETYPE_HEADERS_PATH = /usr/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
#
3704
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   240
# zlib version
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   241
#
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   242
ZLIB_VERSION = 1.2.3
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   243
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   244
bd98409d8c32 4963968: zlib should be upgraded to current version of zlib
sherman
parents: 2301
diff changeset
   245
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
# Localizations for the different parts of the product beyond English
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
JRE_LOCALES   = de es fr it ja ko sv zh_CN zh_TW zh_HK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
JDK_LOCALES  = ja zh_CN
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
# A list of locales we support but don't have resource files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
# This is defined to optimize the search of resource bundles.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
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
   258
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
# All libraries except libjava and libjvm itself link against libjvm and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
# libjava, the latter for its exported common utilities.  libjava only links
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
# against libjvm.  Programs' makefiles take their own responsibility for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
# adding other libs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
ifdef PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
# put JAVALIB first, but do not lose any platform specific values....
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
  LDLIBS_COMMON = $(JAVALIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
endif # PACKAGE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
# Libraries that must appear ahead of libc.so on the link command line
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
ifdef PROGRAM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
  ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    LDLIBS_COMMON = -lthread -ldl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
  ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    LDLIBS_COMMON = -ldl
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
endif # PROGRAM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
LDLIBS_COMMON += $(EXTRA_LIBS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
# Default is to build, not import native binaries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
ifndef IMPORT_NATIVE_BINARIES
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
  IMPORT_NATIVE_BINARIES=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
# If importing libraries in, no incremental builds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
ifeq ($(IMPORT_NATIVE_BINARIES),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
 INCREMENTAL_BUILD=false
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
# for generated libraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
LIBDIR              = $(OUTPUTDIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
ABS_LIBDIR          = $(ABS_OUTPUTDIR)/lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
# Optional place to save the windows .lib files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
LIBFILES_DIR        = $(OUTPUTDIR)/libfiles
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
# for ext jre files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
EXTDIR              = $(LIBDIR)/ext
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
# for generated include files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
INCLUDEDIR          = $(OUTPUTDIR)/include
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
# for generated class files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
CLASSBINDIR         = $(OUTPUTDIR)/classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
DEMOCLASSDIR        = $(OUTPUTDIR)/democlasses
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   310
# for modules
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   311
MODULES_DIR         = $(OUTPUTDIR)/modules
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   312
ABS_MODULES_DIR     = $(ABS_OUTPUTDIR)/modules
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
# for generated tool class files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
BUILDTOOLCLASSDIR   = $(OUTPUTDIR)/btclasses
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
# for build tool jar files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
BUILDTOOLJARDIR     = $(OUTPUTDIR)/btjars
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
305
9b905a071b0e 6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents: 139
diff changeset
   318
# for generated tool class files
9b905a071b0e 6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents: 139
diff changeset
   319
BUILDTOOLBINDIR     = $(OUTPUTDIR)/btbins
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
# for generated java source files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
GENSRCDIR           = $(OUTPUTDIR)/gensrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
# for generated C source files (not javah)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
GENNATIVESRCDIR     = $(OUTPUTDIR)/gennativesrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
# for imported source files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
IMPORTSRCDIR        = $(OUTPUTDIR)/impsrc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
# for imported documents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
IMPORTDOCDIR        = $(OUTPUTDIR)/impdoc
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
# for generated demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
DEMODIR             = $(OUTPUTDIR)/demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
# for sample code
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
SAMPLEDIR           = $(OUTPUTDIR)/sample
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
# for generated documentation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
DOCSDIR             = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
DOCSDIRSUFFIX       =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
# The MESSAGE, WARNING and ERROR files are used to store sanityck and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
# SCCS check messages, warnings and errors. 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
ifndef ERROR_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
  ERROR_FILE   = $(OUTPUTDIR)/sanityCheckErrors.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
ifndef WARNING_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
  WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
ifndef MESSAGE_FILE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
  MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
#where the demo source can be found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
DEMOSRCDIR          = $(SHARE_SRC)/demo
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
# An attempt is made to generate unique enough directories for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
# generated files to not have name collisisons. Most build units
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
# defines PRODUCT (except Release.gmk), but then they may or may 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
# LIBRARY. This code chunk attempts to generate a unique 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
# OBJDIR/CLASSHDRDIR for each build unit based on which of those 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
# values are set within each build unit.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
UNIQUE_LOCATION_STRING = tmp
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
ifneq ($(PRODUCT),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
  UNIQUE_LOCATION_STRING += /$(PRODUCT)
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 ($(PACKAGE),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
  UNIQUE_LOCATION_STRING += /$(PACKAGE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
ifneq ($(PROGRAM),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
  UNIQUE_LOCATION_STRING += /$(PROGRAM)
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 ($(LIBRARY),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
  ifneq ($(LIBRARY_OUTPUT),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    UNIQUE_LOCATION_STRING += /$(LIBRARY)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
ifneq ($(THREADDIR),)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
  UNIQUE_LOCATION_STRING += /$(THREADDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   388
#
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   389
# Build units may or may not define MODULE.  Default to "other".
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   390
#
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   391
# MODULE variable defines the lowest-level module name that
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   392
# might or might not be the name of the modules created in
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   393
# the modules build (see make/modules/modules.config and
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   394
# modules.group).
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   395
#
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   396
MODULES_TEMPDIR     = $(OUTPUTDIR)/tmp/modules
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   397
ABS_MODULES_TEMPDIR = $(ABS_OUTPUTDIR)/tmp/modules
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   398
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   399
ifndef MODULE
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   400
  MODULE = other
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   401
endif
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   402
override MODULE_DEST_DIR = $(MODULES_TEMPDIR)/$(MODULE)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   403
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
# the use of += above makes a space separated list which we need to 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
# remove for filespecs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
NULLSTRING :=
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
ONESPACE := $(NULLSTRING) # space before this comment is required.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
# TEMPDIR is a unique general purpose directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
# need to use 'override' because GNU Make on Linux exports the wrong
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
# value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
override TEMPDIR      = $(OUTPUTDIR)/$(UNIQUE_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
override ABS_TEMPDIR  = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
# This must be created right away for pattern rules in Sanity.gmk to work.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
# OBJDIRNAME is the name of the directory where the object code is to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
#   be placed. It's name depends on whether the data model architecture 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
#   is 32-bit or not.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
ifneq ($(ARCH_DATA_MODEL), 32)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
  OBJDIRNAME  = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
  OBJDIRNAME  = obj$(OBJDIRNAME_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
OBJDIR      = $(TEMPDIR)/$(OBJDIRNAME)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
# CLASSHDRDIR is where the generated C Class Header files go.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
# CLASSDESTDIR can be used to specify the directory where generated classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
# are to be placed. The default is CLASSBINDIR.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
ifndef CLASSDESTDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
CLASSDESTDIR = $(CLASSBINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
INCLUDES = -I. -I$(CLASSHDRDIR) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
	$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
OTHER_CPPFLAGS = $(INCLUDES)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
# vpaths.  These are the default locations searched for source files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
# GNUmakefiles of individual areas often override the default settings.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
# There are no longer default vpath entries for C and assembler files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
# so we can ensure that libraries don't get their hands on JVM files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
# We define an intermediate variable for Java files because
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
# we use its value later to help define $SOURCEPATH
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
ifdef OPENJDK
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
  VPATH.java = $(VPATH0.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
  # If filenames are duplicated between open/closed workspaces, prefer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
  # the closed files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
  # Source ordering is important: some targets depend on closed files
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
  # replacing open ones, and thus the closed file sources must be found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
  # before the open ones.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
  # Don't reorder without consulting the teams that depend on this behavior.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
  #
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
  VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
vpath %.java $(VPATH.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
vpath %.class $(CLASSBINDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
# VPATH.h is used elsewhere to generate include flags.  By default, 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
# anyone has access to the include files that the JVM area exports,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
# relatives.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
#
1090
c5805b1672a6 6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents: 919
diff changeset
   482
VPATH.h =   $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
vpath %.h   $(VPATH.h)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
# Used in two ways: helps link against libjava.so. Also if overridden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
# determines where your shared library is installed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
ifndef LIB_LOCATION
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
  LIB_LOCATION    =  $(LIBDIR)/$(LIBARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
# Java header and stub variables
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
CLASSHDRS     = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
STUBPREAMBLE  = $(INCLUDEDIR)/StubPreamble.h
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
# Classpath seen by javac (different from the one seen by the VM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
# running javac), and useful variables.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
SOURCEPATH	= $(VPATH.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
PKG		= $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
PKGDIR		= $(subst .,/,$(PACKAGE))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
#
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   514
# Macros to find the module that $@ belongs to
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   515
#
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   516
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   517
UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   518
MODULE_PATH_PATTERN = -e 's%.*\/classes\/%classes\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   519
		      -e 's%.*\/$(UNIQUE_PATH_PATTERN)\/%classes\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   520
		      -e 's%.*\/lib\/%lib\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   521
	              -e 's%.*\/bin\/%bin\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   522
	              -e 's%.*\/include\/%include\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   523
		      -e 's%.*\/demo\/%demo\/%' \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   524
		      -e 's%.*\/sample\/%sample\/%'
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   525
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   526
# Install a file to its module
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   527
define install-module-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   528
dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   529
$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   530
$(CP) -f $@ $(MODULE_DEST_DIR)/$$dest
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   531
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   532
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   533
# Install all files from the directory to its module
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   534
define install-module-dir
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   535
dest=`echo $(@D)/ | $(SED) $(MODULE_PATH_PATTERN)` ; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   536
$(MKDIR) -p $(MODULE_DEST_DIR)/$$dest; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   537
$(CP) -rf $(@D)/* $(MODULE_DEST_DIR)/$$dest
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   538
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   539
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   540
# chmod the file in its module
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   541
define chmod-module-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   542
dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   543
$(CHMOD) $1 $(MODULE_DEST_DIR)/$$dest
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   544
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   545
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   546
# install a sym link in its module
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   547
define install-module-sym-link
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   548
dest=`echo $@ | $(SED) $(MODULE_PATH_PATTERN)` ; \
4681
7d382dfe6e55 6916217: make/modules/Makefile requires ALT_JDK_IMPORT_PATH
mchung
parents: 4665
diff changeset
   549
$(LN) -sf $1 $(MODULE_DEST_DIR)/$$dest
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   550
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   551
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   552
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   553
# Run MAKE $@ for a launcher:
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   554
#   $(call make-launcher, name, mainclass, java-args, main-args)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   555
define make-launcher
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   556
$(CD) $(BUILDDIR)/launchers && \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   557
$(MAKE) -f Makefile.launcher \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   558
        MODULE=$(MODULE) \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   559
        PROGRAM=$(strip $1) \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   560
        MAIN_CLASS=$(strip $2) \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   561
        MAIN_JAVA_ARGS="$(strip $3)" \
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   562
        MAIN_ARGS="$(strip $4)"
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   563
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   564
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   565
#
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
# Convenient macros
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
# Prepare $@ target, remove old one and making sure directory exists
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
define prep-target
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
$(MKDIR) -p $(@D)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
$(RM) $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
# Simple install of $< file to $@
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
define install-file
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
$(prep-target)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
$(CP) $< $@
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents: 4681
diff changeset
   579
@$(install-module-file)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   580
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   581
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   582
define chmod-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   583
$(CHMOD) $1 $@
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents: 4681
diff changeset
   584
@$(call chmod-module-file, $1)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   585
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   586
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   587
define install-sym-link
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   588
$(LN) -s $1 $@
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents: 4681
diff changeset
   589
@$(call install-module-sym-link, $1)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   590
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   591
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   592
#
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   593
# Marcos for files not belonging to any module 
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   594
define install-non-module-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   595
$(prep-target)
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   596
$(CP) $< $@
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   597
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   598
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   599
define install-manifest-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   600
$(install-non-module-file)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
# Cleanup rule for after debug java run (hotspot.log file is left around)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
#   (This could be an old leftover file in a read-only area, use the @- prefix)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
HOTSPOT_LOG_NAME = hotspot.log
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
define java-vm-cleanup
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
# Current directory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
CURRENT_DIRECTORY := $(shell $(PWD))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
#    used for this file, otherwise the default settings are used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
CFLAGS_$(VARIANT)/BYFILE    = $(CFLAGS_$(VARIANT)/$(@F)) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
                              $(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
CXXFLAGS_$(VARIANT)/BYFILE  = $(CXXFLAGS_$(VARIANT)/$(@F)) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
                              $(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
# Tool flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
ASFLAGS         = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
CFLAGS          = $(CFLAGS_$(VARIANT)/BYFILE)   $(CFLAGS_COMMON) $(OTHER_CFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
CXXFLAGS        = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
CPPFLAGS        = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
		  $(DEFINES) $(OPTIONS:%=-D%)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
LDFLAGS         = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
LDLIBS          = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
LINTFLAGS       = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
		  $(OTHER_LINTFLAGS)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
4116
54b55d640d9a 6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents: 3704
diff changeset
   635
VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
# Note: As a rule, GNU Make rules should not appear in any of the 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
# Defs*.gmk files. These were added for Kestrel-Solaris and do address
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
# a TeamWare bug. They should be moved elsewhere for Merlin.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
# 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
#  Override gnumake built-in rules which do sccs get operations badly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
#  (They put the checked out code in the current directory, not in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   643
#  directory of the original file.) 
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
# Since this is a symptom of a teamware failure, complain and die on the spot.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   645
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
# This message immediately goes to stdout and the build terminates.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
define SCCS-trouble
90ce3da70b43 Initial load
duke
parents:
diff changeset
   648
$(error  \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
 is out of date with respect to its SCCS file $<. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
 This can happen from an unresolved Teamware conflict, a file movement, or \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
 a failure in which SCCS files are updated but the 'sccs get' was not done. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
 You should double check for other out of date files in your workspace. \
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
 Or run: cd $(TOPDIR) && $(MAKE) sccs_get")
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
%:: s.%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
	@$(SCCS-trouble)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
%:: SCCS/s.%
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
	@$(SCCS-trouble)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
	@$(ECHO) "         is out of date with respect to its SCCS file." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   662
	@$(ECHO) "         This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
	@$(ECHO) "         This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
	@$(ECHO) "         in which SCCS files are updated but not checked out." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   665
	@$(ECHO) "         Check for other out of date files in your workspace." >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
	@$(ECHO) "" >> $(WARNING_FILE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
	@#exit 666
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
ifdef INSANE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
  export INSANE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
ifdef ALT_COPYRIGHT_YEAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
  COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
else
847
530bfef1ed6f 6548261: Use of SE in make/common/Defs-windows.gmk
ohair
parents: 715
diff changeset
   676
  COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
   678
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   680
define install-importonly-file
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   681
@$(ECHO) "ASSEMBLY_IMPORT: $@"
1164
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   682
$(prep-target)
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   683
$(CP) $< $@
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   684
@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then     \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   685
  if [ -x /usr/sbin/selinuxenabled ] ; then                         \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   686
    /usr/sbin/selinuxenabled;                                       \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   687
    if [ $$? = 0 ] ; then                                           \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   688
      $(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@";               \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   689
      /usr/bin/chcon -t textrel_shlib_t $@;                         \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   690
      if [ $$? != 0 ]; then                                         \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   691
        echo "ERROR: Cannot chcon $@";                              \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   692
      fi;                                                           \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   693
    fi;                                                             \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   694
  fi;                                                               \
fcf7f66faf68 6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents: 919
diff changeset
   695
fi
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   696
endef
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   698
define install-import-file
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   699
$(install-importonly-file)
4917
c98da2209f8c 6915413: Module build: building of specified jdk components instead of all
mchung
parents: 4681
diff changeset
   700
@$(install-module-file)
4665
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   701
endef
d14dc3d9e1fa 6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents: 4116
diff changeset
   702
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
.PHONY: all build clean clobber