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