hotspot/make/solaris/makefiles/vm.make
author stefank
Thu, 02 Dec 2010 20:01:47 +0100
changeset 7409 e9017b2bef9c
parent 7397 5b173b4ca846
child 7704 cc9d3ed42704
child 7448 11b630d174d5
permissions -rw-r--r--
7003786: sort Obj_Files before compiling Summary: Reverted to old sort order on Linux and Solaris. Reviewed-by: tonyp, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5542
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5542
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5542
diff changeset
    21
# questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Rules to build JVM and related libraries, included from vm.make in the build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# directory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
# Common build rules.
338
5cf9f61d76f4 6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents: 1
diff changeset
    29
MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
include $(MAKEFILES_DIR)/rules.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
default: build
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
# Defs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
GENERATED     = ../generated
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    38
DEP_DIR       = $(GENERATED)/dependencies
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    40
# reads the generated files defining the set of .o's and the .o .h dependencies
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    41
-include $(DEP_DIR)/*.d
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
# read machine-specific adjustments (%%% should do this via buildtree.make?)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
include $(MAKEFILES_DIR)/$(BUILDARCH).make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
# set VPATH so make knows where to look for source files
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    47
# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
# The adfiles directory contains ad_<arch>.[ch]pp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
# The jvmtifiles directory contains jvmti*.[ch]pp
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    50
Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    51
VPATH += $(Src_Dirs_V:%=%:)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
# set INCLUDES for C preprocessor
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    54
Src_Dirs_I += $(GENERATED)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
INCLUDES += $(Src_Dirs_I:%=-I%)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
ifeq (${VERSION}, debug)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  SYMFLAG = -g
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  SYMFLAG =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
# The following variables are defined in the generated flags.make file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    66
HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
CPPFLAGS =           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  ${SYSDEFS}         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  ${INCLUDES}        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  ${BUILD_VERSION}   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  ${BUILD_TARGET}    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  ${BUILD_USER}      \
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    77
  ${HS_LIB_ARCH}     \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  ${JRE_VERSION}     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  ${VM_DISTRO}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
CFLAGS += $(CFLAGS_WARN)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
# Do not use C++ exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
CFLAGS += $(CFLAGS/NOEX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
# Extra flags from gnumake's invocation or environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
CFLAGS += $(EXTRA_CFLAGS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
# Math Library (libm.so), do not use -lm.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
#    There might be two versions of libm.so on the build system:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
#    libm.so.1 and libm.so.2, and we want libm.so.1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
#    Depending on the Solaris release being used to build with,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
#    /usr/lib/libm.so could point at a libm.so.2, so we are
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
#    explicit here so that the libjvm.so you have built will work on an
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
#    older Solaris release that might not have libm.so.2.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
#    This is a critical factor in allowing builds on Solaris 10 or newer
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
#    to run on Solaris 8 or 9.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
LIBM=/usr/lib$(ISA_DIR)/libm.so.1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
ifeq ("${Platform_compiler}", "sparcWorks")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
# The whole megilla:
1549
710f8deef989 6769748: Fix solaris makefiles for the case when "CC -V" produces several lines
kvn
parents: 670
diff changeset
   104
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
# Old Comment: List the libraries in the order the compiler was designed for
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
# Not sure what the 'designed for' comment is referring too above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
#   The order may not be too significant anymore, but I have placed this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
#   older libm before libCrun, just to make sure it's found and used first.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
else
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   111
ifeq ($(COMPILER_REV_NUMERIC), 502)
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   112
# SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   113
LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   114
else
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   116
endif # 502
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   117
endif # 505
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   120
endif # sparcWorks
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
# By default, link the *.o into the library, not the executable.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
LINK_INTO$(LINK_INTO) = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
# jvm_db & dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
include $(MAKEFILES_DIR)/dtrace.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
# JVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   134
JVM      = jvm
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   135
LIBJVM   = lib$(JVM).so
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1549
diff changeset
   136
LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   138
CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   139
CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   140
CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   141
CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   142
CORE_PATHS += $(GENERATED)/jvmtifiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   143
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   144
COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   145
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   146
COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   147
COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   148
COMPILER2_PATHS +=  $(GENERATED)/adfiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   149
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   150
# Include dirs per type.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   151
Src_Dirs/CORE      := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   152
Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   153
Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   154
Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   155
Src_Dirs/ZERO      := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   156
Src_Dirs/SHARK     := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   157
Src_Dirs := $(Src_Dirs/$(TYPE))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   158
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   159
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   160
COMPILER1_SPECIFIC_FILES := c1_\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   161
SHARK_SPECIFIC_FILES     := shark
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   162
ZERO_SPECIFIC_FILES      := zero
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   163
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   164
# Always exclude these.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   165
Src_Files_EXCLUDE := dtrace jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   166
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   167
# Exclude per type.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   168
Src_Files_EXCLUDE/CORE      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   169
Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   170
Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   171
Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   172
Src_Files_EXCLUDE/ZERO      := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   173
Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   174
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   175
Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   176
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   177
# Special handling of arch model.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   178
ifeq ($(Platform_arch_model), x86_32)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   179
Src_Files_EXCLUDE += \*x86_64\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   180
endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   181
ifeq ($(Platform_arch_model), x86_64)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   182
Src_Files_EXCLUDE += \*x86_32\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   183
endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   184
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   185
# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   186
define findsrc
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   187
	$(notdir $(shell find $(1) \( -name \*.c -o -name \*.cpp -o -name \*.s \) -a \! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \) ))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   188
endef
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   189
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   190
Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   191
7409
e9017b2bef9c 7003786: sort Obj_Files before compiling
stefank
parents: 7397
diff changeset
   192
Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   193
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
mapfile_reorder : mapfile $(MAPFILE_DTRACE_OPT) $(REORDERFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
ifeq ($(LINK_INTO),AOUT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  LIBJVM.o                 =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  LIBJVM_MAPFILE           =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  LIBJVM.o                 = $(JVM_OBJ_FILES)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
ifndef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  # get around library dependency and compatibility issues. Must use gcc not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  # g++ to link.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  LFLAGS_VM                += $(STATIC_LIBGCC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  LIBS_VM                  += $(STATIC_STDCXX) $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
LINK_VM = $(LINK_LIB.c)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
LINK_VM = $(LINK_LIB.CC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
# making the library:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) 
5542
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   233
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   234
	@echo Linking vm...
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   235
	$(QUIETLY) $(LINK_LIB.CC/PRE_HOOK)
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   236
	$(QUIETLY) $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM)
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   237
	$(QUIETLY) $(LINK_LIB.CC/POST_HOOK)
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   238
	$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   239
	$(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   240
	$(QUIETLY) [ -f $(LIBJVM_G).1 ] || ln -s $@.1 $(LIBJVM_G).1
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   241
endif # filter -sbfast -xsbfast
be05c5ffe905 6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents: 4493
diff changeset
   242
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
install_jvm: $(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
# Other files
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
# Gamma launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
include $(MAKEFILES_DIR)/launcher.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
# Signal interposition library
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
include $(MAKEFILES_DIR)/jsig.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
# Serviceability agent
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
include $(MAKEFILES_DIR)/saproc.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   264
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
install: install_jvm install_jsig install_saproc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
.PHONY: default build install install_jvm