5693N/A# Copyright (c) 1998, 2010, Oracle
and/or its affiliates. All rights reserved.
5693N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5693N/A# This code is free software; you can redistribute it
and/or modify it
5693N/A# under the terms of the GNU General Public License version 2 only, as
5693N/A# published by the Free Software Foundation.
5693N/A# This code is distributed in the hope that it will be useful, but WITHOUT
5693N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
5693N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
5693N/A# version 2 for more details (a copy is included in the LICENSE file that
5693N/A# You should have received a copy of the GNU General Public License version
5693N/A# 2 along with this work; if not, write to the Free Software Foundation,
5693N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
5693N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
5693N/A# Rules to build JVM and related libraries, included from
vm.make in the build
5693N/AMAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
5693N/A#----------------------------------------------------------------------
5693N/ADEP_DIR = $(GENERATED)/dependencies
5693N/A# reads the generated files defining the set of .o's and the .o .h dependencies
5693N/Ainclude $(MAKEFILES_DIR)/$(BUILDARCH).make
5693N/A# set VPATH so make knows where to look for source files
5693N/A# The adfiles directory contains ad_<arch>.[ch]pp.
5693N/A# The jvmtifiles directory contains jvmti*.[ch]pp
5693N/ASrc_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
5693N/A# set INCLUDES for C preprocessor
5693N/AINCLUDES += $(Src_Dirs_I:%=-I%)
5693N/ABUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
5693N/AJRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
5693N/AHS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
5693N/ABUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
5693N/ABUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
5693N/AVM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
5693N/A# Do not use C++ exception handling
5693N/A# Extra flags from gnumake's invocation or environment
5693N/A# Depending on the Solaris release being used to build with,
5693N/A# This is a critical factor in allowing builds on Solaris 10 or newer
5693N/Aifeq ("${Platform_compiler}", "sparcWorks")
5693N/Aifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
5693N/A# Old Comment: List the libraries in the order the compiler was designed for
5693N/A# Not sure what the 'designed for' comment is referring too above.
5693N/A# The order may not be too significant anymore, but I have placed this
5693N/A# older libm before libCrun, just to make sure it's found and used first.
5693N/ALIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
5693N/Aifeq ($(COMPILER_REV_NUMERIC), 502)
5693N/A# SC6.1 has it's own
libm.so: specifying anything else provokes a name conflict.
5693N/ALIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
5693N/ALIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
5693N/ALIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
5693N/Aifeq ("${Platform_arch}", "sparc")
5693N/A# By default, link the *.o into the library, not the executable.
5693N/ALINK_INTO$(LINK_INTO) = LIBJVM
5693N/A#----------------------------------------------------------------------
5693N/A#----------------------------------------------------------------------
5693N/ALIBJVM_G = lib$(JVM)$(G_SUFFIX).so
5693N/ASPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
5693N/A \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
5693N/ASOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
5693N/ASOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
5693N/ASOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
5693N/ACORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
5693N/ACORE_PATHS+=$(GENERATED)/jvmtifiles
5693N/ACOMPILER2_PATHS += $(GENERATED)/adfiles
5693N/ASrc_Dirs := $(Src_Dirs/$(TYPE))
5693N/ACOMPILER1_SPECIFIC_FILES := c1_\*
5693N/ASHARK_SPECIFIC_FILES := shark
5693N/ASrc_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE))
5693N/A# Special handling of arch model.
5693N/Aifeq ($(Platform_arch_model), x86_32)
5693N/ASrc_Files_EXCLUDE += \*x86_64\*
5693N/Aifeq ($(Platform_arch_model), x86_64)
5693N/ASrc_Files_EXCLUDE += \*x86_32\*
5693N/A# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
5693N/A $(notdir $(shell find $(1)/. ! -name . -prune \
5693N/A -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
5693N/A -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
5693N/ASrc_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
5693N/AObj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
5693N/AJVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
5693N/Amapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT)
5693N/Amapfile_reorder : mapfile $(MAPFILE_DTRACE_OPT) $(REORDERFILE)
LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
# JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
# get around library dependency and compatibility issues. Must use gcc not
LFLAGS_VM += $(STATIC_LIBGCC)
LIBS_VM += $(STATIC_STDCXX) $(LIBS)
$(LIBJVM): $(
LIBJVM.o) $(LIBJVM_MAPFILE)
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
$(QUIETLY) $(LINK_VM) $(LFLAGS_VM) -o $@ $(
LIBJVM.o) $(LIBS_VM)
$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
$(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
$(QUIETLY) [ -f $(LIBJVM_G).1 ] || ln -s $@.1 $(LIBJVM_G).1
endif # filter -sbfast -xsbfast
DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
@echo "Copying $(LIBJVM) to $(DEST_JVM)"
$(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
#----------------------------------------------------------------------
# Signal interposition library
#----------------------------------------------------------------------
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
install: install_jvm install_jsig install_saproc
.PHONY: default build install install_jvm