make/solaris/makefiles/vm.make

Fri, 11 Apr 2008 09:56:35 -0400

author
kamg
date
Fri, 11 Apr 2008 09:56:35 -0400
changeset 545
a49a647afe9a
parent 535
build/solaris/makefiles/vm.make@c7c777385a15
parent 526
build/solaris/makefiles/vm.make@a294fd0c4b38
child 631
d1605aabd0a1
permissions
-rw-r--r--

Merge

duke@435 1 #
duke@435 2 # Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
duke@435 19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@435 20 # CA 95054 USA or visit www.sun.com if you need additional information or
duke@435 21 # have any questions.
duke@435 22 #
duke@435 23 #
duke@435 24
duke@435 25 # Rules to build JVM and related libraries, included from vm.make in the build
duke@435 26 # directory.
duke@435 27
duke@435 28 # Common build rules.
kamg@526 29 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
duke@435 30 include $(MAKEFILES_DIR)/rules.make
duke@435 31
duke@435 32 default: build
duke@435 33
duke@435 34 #----------------------------------------------------------------------
duke@435 35 # Defs
duke@435 36
duke@435 37 GENERATED = ../generated
duke@435 38
duke@435 39 # read a generated file defining the set of .o's and the .o .h dependencies
duke@435 40 include $(GENERATED)/Dependencies
duke@435 41
duke@435 42 # read machine-specific adjustments (%%% should do this via buildtree.make?)
duke@435 43 include $(MAKEFILES_DIR)/$(BUILDARCH).make
duke@435 44
duke@435 45 # set VPATH so make knows where to look for source files
duke@435 46 # Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
duke@435 47 # The incls directory contains generated header file lists for inclusion.
duke@435 48 # The adfiles directory contains ad_<arch>.[ch]pp.
duke@435 49 # The jvmtifiles directory contains jvmti*.[ch]pp
duke@435 50 Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
duke@435 51 VPATH += $(Src_Dirs_V:%=%:)
duke@435 52
duke@435 53 # set INCLUDES for C preprocessor
duke@435 54 Src_Dirs_I = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
duke@435 55 INCLUDES += $(Src_Dirs_I:%=-I%)
duke@435 56
duke@435 57 ifeq (${VERSION}, debug)
duke@435 58 SYMFLAG = -g
duke@435 59 else
duke@435 60 SYMFLAG =
duke@435 61 endif
duke@435 62
duke@435 63 # The following variables are defined in the generated flags.make file.
duke@435 64 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
duke@435 65 JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
jrose@535 66 HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
duke@435 67 BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
duke@435 68 BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
duke@435 69 VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
duke@435 70
duke@435 71 CPPFLAGS = \
duke@435 72 ${SYSDEFS} \
duke@435 73 ${INCLUDES} \
duke@435 74 ${BUILD_VERSION} \
duke@435 75 ${BUILD_TARGET} \
duke@435 76 ${BUILD_USER} \
jrose@535 77 ${HS_LIB_ARCH} \
duke@435 78 ${JRE_VERSION} \
duke@435 79 ${VM_DISTRO}
duke@435 80
duke@435 81 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
duke@435 82 CFLAGS += $(CFLAGS_WARN)
duke@435 83
duke@435 84 # Do not use C++ exception handling
duke@435 85 CFLAGS += $(CFLAGS/NOEX)
duke@435 86
duke@435 87 # Extra flags from gnumake's invocation or environment
duke@435 88 CFLAGS += $(EXTRA_CFLAGS)
duke@435 89
duke@435 90 # Math Library (libm.so), do not use -lm.
duke@435 91 # There might be two versions of libm.so on the build system:
duke@435 92 # libm.so.1 and libm.so.2, and we want libm.so.1.
duke@435 93 # Depending on the Solaris release being used to build with,
duke@435 94 # /usr/lib/libm.so could point at a libm.so.2, so we are
duke@435 95 # explicit here so that the libjvm.so you have built will work on an
duke@435 96 # older Solaris release that might not have libm.so.2.
duke@435 97 # This is a critical factor in allowing builds on Solaris 10 or newer
duke@435 98 # to run on Solaris 8 or 9.
duke@435 99 #
duke@435 100 LIBM=/usr/lib$(ISA_DIR)/libm.so.1
duke@435 101
duke@435 102 ifeq ("${Platform_compiler}", "sparcWorks")
duke@435 103 # The whole megilla:
duke@435 104 ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1)
duke@435 105 # Old Comment: List the libraries in the order the compiler was designed for
duke@435 106 # Not sure what the 'designed for' comment is referring too above.
duke@435 107 # The order may not be too significant anymore, but I have placed this
duke@435 108 # older libm before libCrun, just to make sure it's found and used first.
duke@435 109 LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc
duke@435 110 else
duke@435 111 LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor
duke@435 112 endif
duke@435 113 else
duke@435 114 LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc
duke@435 115 endif
duke@435 116
duke@435 117 # By default, link the *.o into the library, not the executable.
duke@435 118 LINK_INTO$(LINK_INTO) = LIBJVM
duke@435 119
duke@435 120 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
duke@435 121
duke@435 122 #----------------------------------------------------------------------
duke@435 123 # jvm_db & dtrace
duke@435 124 include $(MAKEFILES_DIR)/dtrace.make
duke@435 125
duke@435 126 #----------------------------------------------------------------------
duke@435 127 # JVM
duke@435 128
duke@435 129 JVM = jvm$(G_SUFFIX)
duke@435 130 LIBJVM = lib$(JVM).so
duke@435 131
duke@435 132 JVM_OBJ_FILES = $(Obj_Files) $(DTRACE_OBJS)
duke@435 133
duke@435 134 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
duke@435 135
duke@435 136 mapfile : $(MAPFILE) $(MAPFILE_DTRACE_OPT)
duke@435 137 rm -f $@
duke@435 138 cat $^ > $@
duke@435 139
duke@435 140 mapfile_reorder : mapfile $(MAPFILE_DTRACE_OPT) $(REORDERFILE)
duke@435 141 rm -f $@
duke@435 142 cat $^ > $@
duke@435 143
duke@435 144 ifeq ($(LINK_INTO),AOUT)
duke@435 145 LIBJVM.o =
duke@435 146 LIBJVM_MAPFILE =
duke@435 147 LIBS_VM = $(LIBS)
duke@435 148 else
duke@435 149 LIBJVM.o = $(JVM_OBJ_FILES)
duke@435 150 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
duke@435 151 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
duke@435 152 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
duke@435 153 ifndef USE_GCC
duke@435 154 LIBS_VM = $(LIBS)
duke@435 155 else
duke@435 156 # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
duke@435 157 # get around library dependency and compatibility issues. Must use gcc not
duke@435 158 # g++ to link.
duke@435 159 LFLAGS_VM += $(STATIC_LIBGCC)
duke@435 160 LIBS_VM += $(STATIC_STDCXX) $(LIBS)
duke@435 161 endif
duke@435 162 endif
duke@435 163
duke@435 164 ifdef USE_GCC
duke@435 165 LINK_VM = $(LINK_LIB.c)
duke@435 166 else
duke@435 167 LINK_VM = $(LINK_LIB.CC)
duke@435 168 endif
duke@435 169 # making the library:
duke@435 170 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE)
duke@435 171 $(QUIETLY) \
duke@435 172 case "$(CFLAGS_BROWSE)" in \
duke@435 173 -sbfast|-xsbfast) \
duke@435 174 ;; \
duke@435 175 *) \
duke@435 176 echo Linking vm...; \
duke@435 177 $(LINK_LIB.CC/PRE_HOOK) \
duke@435 178 $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
duke@435 179 $(LINK_LIB.CC/POST_HOOK) \
duke@435 180 rm -f $@.1; ln -s $@ $@.1; \
duke@435 181 ;; \
duke@435 182 esac
duke@435 183
duke@435 184 DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
duke@435 185
duke@435 186 install_jvm: $(LIBJVM)
duke@435 187 @echo "Copying $(LIBJVM) to $(DEST_JVM)"
duke@435 188 $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
duke@435 189
duke@435 190 #----------------------------------------------------------------------
duke@435 191 # Other files
duke@435 192
duke@435 193 # Gamma launcher
duke@435 194 include $(MAKEFILES_DIR)/launcher.make
duke@435 195
duke@435 196 # Signal interposition library
duke@435 197 include $(MAKEFILES_DIR)/jsig.make
duke@435 198
duke@435 199 # Serviceability agent
duke@435 200 include $(MAKEFILES_DIR)/saproc.make
duke@435 201
duke@435 202 #----------------------------------------------------------------------
duke@435 203
duke@435 204 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) checkAndBuildSA dtraceCheck
duke@435 205
duke@435 206 install: install_jvm install_jsig install_saproc
duke@435 207
duke@435 208 .PHONY: default build install install_jvm

mercurial