hotspot/make/linux/makefiles/vm.make
author stefank
Thu, 02 Dec 2010 20:01:47 +0100
changeset 7409 e9017b2bef9c
parent 7397 5b173b4ca846
child 7451 cc12e11b1e07
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
#
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
     2
# Copyright (c) 1999, 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: 5045
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5045
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: 5045
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: 6187
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: 6187
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: 6187
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?)
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    44
ifeq ($(ZERO_BUILD), true)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    45
  include $(MAKEFILES_DIR)/zeroshark.make
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    46
else
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    47
  include $(MAKEFILES_DIR)/$(BUILDARCH).make
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
    48
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
# set VPATH so make knows where to look for source files
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    51
# 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
    52
# The adfiles directory contains ad_<arch>.[ch]pp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
# The jvmtifiles directory contains jvmti*.[ch]pp
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    54
Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    55
VPATH += $(Src_Dirs_V:%=%:)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    57
# set INCLUDES for C preprocessor.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    58
Src_Dirs_I += $(GENERATED)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    59
# The order is important for the precompiled headers to work.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
    60
INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
ifeq (${VERSION}, debug)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  SYMFLAG = -g
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  SYMFLAG =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined 
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
# in $(GAMMADIR)/make/defs.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
ifeq ($(HOTSPOT_BUILD_VERSION),)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
# The following variables are defined in the generated flags.make file.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
JRE_VERSION   = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    79
HS_LIB_ARCH   = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
BUILD_TARGET  = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
BUILD_USER    = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
VM_DISTRO     = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
CPPFLAGS =           \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  ${SYSDEFS}         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  ${INCLUDES}        \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  ${BUILD_VERSION}   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  ${BUILD_TARGET}    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  ${BUILD_USER}      \
347
df859fcca515 6667042: PrintAssembly option does not work without special plugin
jrose
parents: 1
diff changeset
    90
  ${HS_LIB_ARCH}     \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  ${JRE_VERSION}     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  ${VM_DISTRO}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
CFLAGS += $(CFLAGS_WARN/BYFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
# Do not use C++ exception handling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
CFLAGS += $(CFLAGS/NOEX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
# Extra flags from gnumake's invocation or environment
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
CFLAGS += $(EXTRA_CFLAGS)
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   102
LFLAGS += $(EXTRA_CFLAGS)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
LIBS += -lm -ldl -lpthread
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
# By default, link the *.o into the library, not the executable.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
LINK_INTO$(LINK_INTO) = LIBJVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
# jvm_db & dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
include $(MAKEFILES_DIR)/dtrace.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
# JVM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   118
JVM      = jvm
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   119
LIBJVM   = lib$(JVM).so
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   120
LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   122
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: 6187
diff changeset
   123
CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   124
CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   125
CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   126
CORE_PATHS += $(GENERATED)/jvmtifiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   127
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   128
COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   129
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   130
COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   131
COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   132
COMPILER2_PATHS +=  $(GENERATED)/adfiles
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   133
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   134
# Include dirs per type.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   135
Src_Dirs/CORE      := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   136
Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   137
Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   138
Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   139
Src_Dirs/ZERO      := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   140
Src_Dirs/SHARK     := $(CORE_PATHS)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   141
Src_Dirs := $(Src_Dirs/$(TYPE))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   142
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   143
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   144
COMPILER1_SPECIFIC_FILES := c1_\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   145
SHARK_SPECIFIC_FILES     := shark
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   146
ZERO_SPECIFIC_FILES      := zero
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   147
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   148
# Always exclude these.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   149
Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   150
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   151
# Exclude per type.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   152
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: 6187
diff changeset
   153
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: 6187
diff changeset
   154
Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   155
Src_Files_EXCLUDE/TIERED    := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   156
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: 6187
diff changeset
   157
Src_Files_EXCLUDE/SHARK     := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   158
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   159
Src_Files_EXCLUDE +=  $(Src_Files_EXCLUDE/$(TYPE))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   160
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   161
# Special handling of arch model.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   162
ifeq ($(Platform_arch_model), x86_32)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   163
Src_Files_EXCLUDE += \*x86_64\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   164
endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   165
ifeq ($(Platform_arch_model), x86_64)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   166
Src_Files_EXCLUDE += \*x86_32\*
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   167
endif
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   168
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   169
# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   170
define findsrc
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   171
	$(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: 6187
diff changeset
   172
endef
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   173
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   174
Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   175
7409
e9017b2bef9c 7003786: sort Obj_Files before compiling
stefank
parents: 7397
diff changeset
   176
Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   177
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
JVM_OBJ_FILES = $(Obj_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   182
mapfile : $(MAPFILE) vm.def
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
	rm -f $@
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   184
	awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE")	\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   185
                 { system ("cat vm.def"); }		\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   186
               else					\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   187
                 { print $$0 }				\
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   188
             }' > $@ < $(MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
mapfile_reorder : mapfile $(REORDERFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
	rm -f $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
	cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
5045
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   194
vm.def: $(Res_Files) $(Obj_Files)
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   195
	sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
59dd2a304f1d 6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents: 4493
diff changeset
   196
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   197
ifeq ($(SHARK_BUILD), true)
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   198
  STATIC_CXX = false
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   199
else
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   200
  ifeq ($(ZERO_LIBARCH), ppc64)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   201
    STATIC_CXX = false
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   202
  else
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   203
    STATIC_CXX = true
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   204
  endif
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   205
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
ifeq ($(LINK_INTO),AOUT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  LIBJVM.o                 =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  LIBJVM_MAPFILE           =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  LIBS_VM                  = $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  LIBJVM.o                 = $(JVM_OBJ_FILES)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  LFLAGS_VM$(LDNOMAP)      += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  LFLAGS_VM                += $(SONAMEFLAG:SONAME=$(LIBJVM))
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  # get around library dependency and compatibility issues. Must use gcc not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  # g++ to link.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  ifeq ($(STATIC_CXX), true)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    LFLAGS_VM              += $(STATIC_LIBGCC)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    LIBS_VM                += $(STATIC_STDCXX)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    LIBS_VM                += -lstdc++
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
  LIBS_VM                  += $(LIBS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
endif
4013
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   229
ifeq ($(ZERO_BUILD), true)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   230
  LIBS_VM += $(LIBFFI_LIBS)
b154310845de 6890308: integrate zero assembler hotspot changes
never
parents: 995
diff changeset
   231
endif
6187
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   232
ifeq ($(SHARK_BUILD), true)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   233
  LFLAGS_VM += $(LLVM_LDFLAGS)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   234
  LIBS_VM   += $(LLVM_LIBS)
4fa7845f7c14 6976186: integrate Shark HotSpot changes
twisti
parents: 6176
diff changeset
   235
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
LINK_VM = $(LINK_LIB.c)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
# rule for building precompiled header
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   240
$(PRECOMPILED_HEADER):
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
	$(QUIETLY) echo Generating precompiled header $@
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   242
	$(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   243
	$(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
# making the library:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
ifneq ($(JVM_BASE_ADDR),)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
# By default shared library is linked at base address == 0. Modify the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
# linker script if JVM prefers a different base location. It can also be
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
# implemented with 'prelink -r'. But 'prelink' is not (yet) available on
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
# our build platform (AS-2.1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
LD_SCRIPT = libjvm.so.lds
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
$(LD_SCRIPT): $(LIBJVM_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
	$(QUIETLY) {                                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
	  rm -rf $@;                                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
	  $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1             |  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
	    sed -e '/^======/,/^======/!d'                          \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
		-e '/^======/d'                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
		-e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/'   \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
		> $@;                                               \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
	}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
# With more recent Redhat releases (or the cutting edge version Fedora), if
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
# SELinux is configured to be enabled, the runtime linker will fail to apply
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
# the text relocation to libjvm.so considering that it is built as a non-PIC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
# DSO. To workaround that, we run chcon to libjvm.so after it is built. See 
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
# details in bug 6538311.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
	$(QUIETLY) {                                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
	    echo Linking vm...;                                         \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
	    $(LINK_LIB.CC/PRE_HOOK)                                     \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
	    $(LINK_VM) $(LD_SCRIPT_FLAG)                                \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
		       $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM);       \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
	    $(LINK_LIB.CC/POST_HOOK)                                    \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
	    rm -f $@.1; ln -s $@ $@.1;                                  \
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 4013
diff changeset
   278
	    [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
6176
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   279
            if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then                    \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   280
	      if [ -x /usr/sbin/selinuxenabled ] ; then                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   281
	        /usr/sbin/selinuxenabled;                               \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   282
                if [ $$? = 0 ] ; then					\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   283
		  /usr/bin/chcon -t textrel_shlib_t $@;                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   284
		  if [ $$? != 0 ]; then                                 \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   285
		    echo "ERROR: Cannot chcon $@";			\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   286
		  fi							\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   287
	        fi							\
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   288
	      fi                                                        \
4d9030fe341f 6953477: Increase portability and flexibility of building Hotspot
bobv
parents: 5547
diff changeset
   289
            fi 								\
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
	}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
install_jvm: $(LIBJVM)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
	$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
# Other files
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
# Gamma launcher
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
include $(MAKEFILES_DIR)/launcher.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
# Signal interposition library
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
include $(MAKEFILES_DIR)/jsig.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
# Serviceability agent
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
include $(MAKEFILES_DIR)/saproc.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
#----------------------------------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6187
diff changeset
   312
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
install: install_jvm install_jsig install_saproc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
.PHONY: default build install install_jvm