vm.make revision 3178
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# This code is free software; you can redistribute it and/or modify it
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# under the terms of the GNU General Public License version 2 only, as
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# published by the Free Software Foundation.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# This code is distributed in the hope that it will be useful, but WITHOUT
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# version 2 for more details (a copy is included in the LICENSE file that
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# accompanied this code).
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# You should have received a copy of the GNU General Public License version
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# 2 along with this work; if not, write to the Free Software Foundation,
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# or visit www.oracle.com if you need additional information or have any
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Rules to build JVM and related libraries, included from vm.make in the build
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Common build rules.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkMAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkinclude $(MAKEFILES_DIR)/rules.make
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkinclude $(GAMMADIR)/make/altsrc.make
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenkdefault: build
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk#----------------------------------------------------------------------
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkGENERATED = ../generated
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkDEP_DIR = $(GENERATED)/dependencies
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# reads the generated files defining the set of .o's and the .o .h dependencies
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk-include $(DEP_DIR)/*.d
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# read machine-specific adjustments (%%% should do this via buildtree.make?)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkifeq ($(ZERO_BUILD), true)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk include $(MAKEFILES_DIR)/zeroshark.make
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk include $(MAKEFILES_DIR)/$(BUILDARCH).make
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# set VPATH so make knows where to look for source files
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# The adfiles directory contains ad_<arch>.[ch]pp.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# The jvmtifiles directory contains jvmti*.[ch]pp
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkSrc_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkVPATH += $(Src_Dirs_V:%=%:)
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk# set INCLUDES for C preprocessor.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkSrc_Dirs_I += $(GENERATED)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# The order is important for the precompiled headers to work.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkINCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# SYMFLAG is used by {jsig,saproc}.make
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkifneq ($(OBJCOPY),)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk # always build with debug info when we can create .debuginfo files
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk SYMFLAG = -g
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ifeq (${VERSION}, debug)
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk SYMFLAG = -g
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenkifeq ($(HOTSPOT_BUILD_VERSION),)
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# The following variables are defined in the generated flags.make file.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkBUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkJRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkHS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkBUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenkBUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkVM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${SYSDEFS} \
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${INCLUDES} \
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${BUILD_VERSION} \
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${BUILD_TARGET} \
dff2cc5646d4437ab9e0cb1dcb59da65462a5938jeff.schenk ${BUILD_USER} \
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${HS_LIB_ARCH} \
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk ${VM_DISTRO}
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# This is VERY important! The version define must only be supplied to vm_version.o
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# If not, ccache will not re-use the cache at all, since the version string might contain
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# a time and date.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkvm_version.o: CXXFLAGS += ${JRE_VERSION}
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkifndef JAVASE_EMBEDDED
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenkCFLAGS += -DINCLUDE_TRACE
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# CFLAGS_WARN holds compiler options to suppress/enable warnings.
5b64d5d44892834ba97f003080f3467299b7c5c5jeff.schenk# Do not use C++ exception handling
JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
include $(MAKEFILES_DIR)/dtrace.make
$(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
find $(HS_ALT_SRC)/share/vm/jfr -type d; \
COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
SHARK_PATHS := $(GAMMADIR)/src/share/vm/shark
Src_Dirs/CORE := $(CORE_PATHS)
Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
Src_Dirs/ZERO := $(CORE_PATHS)
Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS)
COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp chaitin\* c2_\* runtime_\*
Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
mapfile : $(MAPFILE) vm.def
{ system ("cat vm.def"); } \
vm.def: $(Res_Files) $(Obj_Files)
sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@
LIBJVM.o =
LIBJVM.o = $(JVM_OBJ_FILES)
LINK_VM = $(LINK_LIB.CC)
$(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
LD_SCRIPT = libjvm.so.lds
# the text relocation to libjvm.so considering that it is built as a non-PIC
# DSO. To workaround that, we run chcon to libjvm.so after it is built. See
$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
$(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
if [ -x /usr/sbin/selinuxenabled ] ; then \
/usr/bin/chcon -t textrel_shlib_t $@; \
include $(MAKEFILES_DIR)/launcher.make
include $(MAKEFILES_DIR)/jsig.make
include $(MAKEFILES_DIR)/saproc.make