annotate make/linux/makefiles/vm.make @ 196:d1605aabd0a1

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents a49a647afe9a
children 6e76352f1f62
rev   line source
duke@0 1 #
xdono@196 2 # Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 #
duke@0 5 # This code is free software; you can redistribute it and/or modify it
duke@0 6 # under the terms of the GNU General Public License version 2 only, as
duke@0 7 # published by the Free Software Foundation.
duke@0 8 #
duke@0 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 # accompanied this code).
duke@0 14 #
duke@0 15 # You should have received a copy of the GNU General Public License version
duke@0 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 #
duke@0 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 20 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 21 # have any questions.
duke@0 22 #
duke@0 23 #
duke@0 24
duke@0 25 # Rules to build JVM and related libraries, included from vm.make in the build
duke@0 26 # directory.
duke@0 27
duke@0 28 # Common build rules.
kamg@91 29 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
duke@0 30 include $(MAKEFILES_DIR)/rules.make
duke@0 31
duke@0 32 default: build
duke@0 33
duke@0 34 #----------------------------------------------------------------------
duke@0 35 # Defs
duke@0 36
duke@0 37 GENERATED = ../generated
duke@0 38
duke@0 39 # read a generated file defining the set of .o's and the .o .h dependencies
duke@0 40 include $(GENERATED)/Dependencies
duke@0 41
duke@0 42 # read machine-specific adjustments (%%% should do this via buildtree.make?)
duke@0 43 include $(MAKEFILES_DIR)/$(BUILDARCH).make
duke@0 44
duke@0 45 # set VPATH so make knows where to look for source files
duke@0 46 # Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
duke@0 47 # The incls directory contains generated header file lists for inclusion.
duke@0 48 # The adfiles directory contains ad_<arch>.[ch]pp.
duke@0 49 # The jvmtifiles directory contains jvmti*.[ch]pp
duke@0 50 Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
duke@0 51 VPATH += $(Src_Dirs_V:%=%:)
duke@0 52
duke@0 53 # set INCLUDES for C preprocessor
duke@0 54 Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
duke@0 55 INCLUDES += $(Src_Dirs_I:%=-I%)
duke@0 56
duke@0 57 ifeq (${VERSION}, debug)
duke@0 58 SYMFLAG = -g
duke@0 59 else
duke@0 60 SYMFLAG =
duke@0 61 endif
duke@0 62
duke@0 63 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
duke@0 64 # in $(GAMMADIR)/make/defs.make
duke@0 65 ifeq ($(HOTSPOT_BUILD_VERSION),)
duke@0 66 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
duke@0 67 else
duke@0 68 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
duke@0 69 endif
duke@0 70
duke@0 71 # The following variables are defined in the generated flags.make file.
duke@0 72 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
duke@0 73 JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
jrose@100 74 HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
duke@0 75 BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
duke@0 76 BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
duke@0 77 VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
duke@0 78
duke@0 79 CPPFLAGS = \
duke@0 80 ${SYSDEFS} \
duke@0 81 ${INCLUDES} \
duke@0 82 ${BUILD_VERSION} \
duke@0 83 ${BUILD_TARGET} \
duke@0 84 ${BUILD_USER} \
jrose@100 85 ${HS_LIB_ARCH} \
duke@0 86 ${JRE_VERSION} \
duke@0 87 ${VM_DISTRO}
duke@0 88
duke@0 89 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
duke@0 90 CFLAGS += $(CFLAGS_WARN/BYFILE)
duke@0 91
duke@0 92 # Do not use C++ exception handling
duke@0 93 CFLAGS += $(CFLAGS/NOEX)
duke@0 94
duke@0 95 # Extra flags from gnumake's invocation or environment
duke@0 96 CFLAGS += $(EXTRA_CFLAGS)
duke@0 97
duke@0 98 LIBS += -lm -ldl -lpthread
duke@0 99
duke@0 100 # By default, link the *.o into the library, not the executable.
duke@0 101 LINK_INTO$(LINK_INTO) = LIBJVM
duke@0 102
duke@0 103 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
duke@0 104
duke@0 105 #----------------------------------------------------------------------
duke@0 106 # jvm_db & dtrace
duke@0 107 include $(MAKEFILES_DIR)/dtrace.make
duke@0 108
duke@0 109 #----------------------------------------------------------------------
duke@0 110 # JVM
duke@0 111
duke@0 112 JVM = jvm$(G_SUFFIX)
duke@0 113 LIBJVM = lib$(JVM).so
duke@0 114
duke@0 115 JVM_OBJ_FILES = $(Obj_Files)
duke@0 116
duke@0 117 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
duke@0 118
duke@0 119 mapfile : $(MAPFILE)
duke@0 120 rm -f $@
duke@0 121 cat $^ > $@
duke@0 122
duke@0 123 mapfile_reorder : mapfile $(REORDERFILE)
duke@0 124 rm -f $@
duke@0 125 cat $^ > $@
duke@0 126
duke@0 127 STATIC_CXX = true
duke@0 128
duke@0 129 ifeq ($(LINK_INTO),AOUT)
duke@0 130 LIBJVM.o =
duke@0 131 LIBJVM_MAPFILE =
duke@0 132 LIBS_VM = $(LIBS)
duke@0 133 else
duke@0 134 LIBJVM.o = $(JVM_OBJ_FILES)
duke@0 135 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
duke@0 136 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
duke@0 137 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
duke@0 138
duke@0 139 # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
duke@0 140 # get around library dependency and compatibility issues. Must use gcc not
duke@0 141 # g++ to link.
duke@0 142 ifeq ($(STATIC_CXX), true)
duke@0 143 LFLAGS_VM += $(STATIC_LIBGCC)
duke@0 144 LIBS_VM += $(STATIC_STDCXX)
duke@0 145 else
duke@0 146 LIBS_VM += -lstdc++
duke@0 147 endif
duke@0 148
duke@0 149 LIBS_VM += $(LIBS)
duke@0 150 endif
duke@0 151
duke@0 152 LINK_VM = $(LINK_LIB.c)
duke@0 153
duke@0 154 # rule for building precompiled header
duke@0 155 $(PRECOMPILED_HEADER): $(Precompiled_Files)
duke@0 156 $(QUIETLY) echo Generating precompiled header $@
duke@0 157 $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
duke@0 158 $(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
duke@0 159
duke@0 160 # making the library:
duke@0 161
duke@0 162 ifneq ($(JVM_BASE_ADDR),)
duke@0 163 # By default shared library is linked at base address == 0. Modify the
duke@0 164 # linker script if JVM prefers a different base location. It can also be
duke@0 165 # implemented with 'prelink -r'. But 'prelink' is not (yet) available on
duke@0 166 # our build platform (AS-2.1).
duke@0 167 LD_SCRIPT = libjvm.so.lds
duke@0 168 $(LD_SCRIPT): $(LIBJVM_MAPFILE)
duke@0 169 $(QUIETLY) { \
duke@0 170 rm -rf $@; \
duke@0 171 $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1 | \
duke@0 172 sed -e '/^======/,/^======/!d' \
duke@0 173 -e '/^======/d' \
duke@0 174 -e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/' \
duke@0 175 > $@; \
duke@0 176 }
duke@0 177 LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
duke@0 178 endif
duke@0 179
duke@0 180 # With more recent Redhat releases (or the cutting edge version Fedora), if
duke@0 181 # SELinux is configured to be enabled, the runtime linker will fail to apply
duke@0 182 # the text relocation to libjvm.so considering that it is built as a non-PIC
duke@0 183 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See
duke@0 184 # details in bug 6538311.
duke@0 185 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
duke@0 186 $(QUIETLY) { \
duke@0 187 echo Linking vm...; \
duke@0 188 $(LINK_LIB.CC/PRE_HOOK) \
duke@0 189 $(LINK_VM) $(LD_SCRIPT_FLAG) \
duke@0 190 $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
duke@0 191 $(LINK_LIB.CC/POST_HOOK) \
duke@0 192 rm -f $@.1; ln -s $@ $@.1; \
duke@0 193 if [ -x /usr/sbin/selinuxenabled ] ; then \
duke@0 194 /usr/sbin/selinuxenabled; \
duke@0 195 if [ $$? = 0 ] ; then \
duke@0 196 /usr/bin/chcon -t textrel_shlib_t $@; \
duke@0 197 if [ $$? != 0 ]; then \
duke@0 198 echo "ERROR: Cannot chcon $@"; exit 1; \
duke@0 199 fi \
duke@0 200 fi \
duke@0 201 fi \
duke@0 202 }
duke@0 203
duke@0 204 DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
duke@0 205
duke@0 206 install_jvm: $(LIBJVM)
duke@0 207 @echo "Copying $(LIBJVM) to $(DEST_JVM)"
duke@0 208 $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
duke@0 209
duke@0 210 #----------------------------------------------------------------------
duke@0 211 # Other files
duke@0 212
duke@0 213 # Gamma launcher
duke@0 214 include $(MAKEFILES_DIR)/launcher.make
duke@0 215
duke@0 216 # Signal interposition library
duke@0 217 include $(MAKEFILES_DIR)/jsig.make
duke@0 218
duke@0 219 # Serviceability agent
duke@0 220 include $(MAKEFILES_DIR)/saproc.make
duke@0 221
duke@0 222 #----------------------------------------------------------------------
duke@0 223
duke@0 224 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
duke@0 225
duke@0 226 install: install_jvm install_jsig install_saproc
duke@0 227
duke@0 228 .PHONY: default build install install_jvm