annotate make/linux/makefiles/rules.make @ 1978:2ca799d83d3c

Merge
author ohair
date Tue, 30 Nov 2010 18:10:20 -0800
parents f95d63e2154a
children 5d801e6b9a80 b92c45f2bc75
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 #
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 # Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 #
a61af66fc99e Initial load
duke
parents:
diff changeset
5 # This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 # under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 # published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 #
a61af66fc99e Initial load
duke
parents:
diff changeset
9 # This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 # version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 # accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 #
a61af66fc99e Initial load
duke
parents:
diff changeset
15 # You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 # 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 #
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 971
diff changeset
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 971
diff changeset
20 # or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 971
diff changeset
21 # questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 #
a61af66fc99e Initial load
duke
parents:
diff changeset
23 #
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # Common rules/macros for the vm, adlc.
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 # Tell make that .cpp is important
a61af66fc99e Initial load
duke
parents:
diff changeset
28 .SUFFIXES: .cpp $(SUFFIXES)
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 # For now. Other makefiles use CPP as the c++ compiler, but that should really
a61af66fc99e Initial load
duke
parents:
diff changeset
31 # name the preprocessor.
a61af66fc99e Initial load
duke
parents:
diff changeset
32 ifeq ($(CCC),)
a61af66fc99e Initial load
duke
parents:
diff changeset
33 CCC = $(CPP)
a61af66fc99e Initial load
duke
parents:
diff changeset
34 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 DEMANGLER = c++filt
a61af66fc99e Initial load
duke
parents:
diff changeset
37 DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 # $(CC) is the c compiler (cc/gcc), $(CCC) is the c++ compiler (CC/g++).
a61af66fc99e Initial load
duke
parents:
diff changeset
40 C_COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
41 CC_COMPILE = $(CCC) $(CPPFLAGS) $(CFLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 AS.S = $(AS) $(ASFLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 COMPILE.c = $(C_COMPILE) -c
a61af66fc99e Initial load
duke
parents:
diff changeset
46 GENASM.c = $(C_COMPILE) -S
a61af66fc99e Initial load
duke
parents:
diff changeset
47 LINK.c = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
48 LINK_LIB.c = $(CC) $(LFLAGS) $(SHARED_FLAG)
a61af66fc99e Initial load
duke
parents:
diff changeset
49 PREPROCESS.c = $(C_COMPILE) -E
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 COMPILE.CC = $(CC_COMPILE) -c
a61af66fc99e Initial load
duke
parents:
diff changeset
52 GENASM.CC = $(CC_COMPILE) -S
a61af66fc99e Initial load
duke
parents:
diff changeset
53 LINK.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
54 LINK_NOPROF.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS)
a61af66fc99e Initial load
duke
parents:
diff changeset
55 LINK_LIB.CC = $(CCC) $(LFLAGS) $(SHARED_FLAG)
a61af66fc99e Initial load
duke
parents:
diff changeset
56 PREPROCESS.CC = $(CC_COMPILE) -E
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 # Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k".
a61af66fc99e Initial load
duke
parents:
diff changeset
59 REMOVE_TARGET = rm -f $@
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 # Synonyms.
a61af66fc99e Initial load
duke
parents:
diff changeset
62 COMPILE.cpp = $(COMPILE.CC)
a61af66fc99e Initial load
duke
parents:
diff changeset
63 GENASM.cpp = $(GENASM.CC)
a61af66fc99e Initial load
duke
parents:
diff changeset
64 LINK.cpp = $(LINK.CC)
a61af66fc99e Initial load
duke
parents:
diff changeset
65 LINK_LIB.cpp = $(LINK_LIB.CC)
a61af66fc99e Initial load
duke
parents:
diff changeset
66 PREPROCESS.cpp = $(PREPROCESS.CC)
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 # Note use of ALT_BOOTDIR to explicitly specify location of java and
a61af66fc99e Initial load
duke
parents:
diff changeset
69 # javac; this is the same environment variable used in the J2SE build
a61af66fc99e Initial load
duke
parents:
diff changeset
70 # process for overriding the default spec, which is BOOTDIR.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 # Note also that we fall back to using JAVA_HOME if neither of these is
a61af66fc99e Initial load
duke
parents:
diff changeset
72 # specified.
a61af66fc99e Initial load
duke
parents:
diff changeset
73
a61af66fc99e Initial load
duke
parents:
diff changeset
74 ifdef ALT_BOOTDIR
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 RUN.JAVA = $(ALT_BOOTDIR)/bin/java
a61af66fc99e Initial load
duke
parents:
diff changeset
77 RUN.JAVAP = $(ALT_BOOTDIR)/bin/javap
a61af66fc99e Initial load
duke
parents:
diff changeset
78 RUN.JAVAH = $(ALT_BOOTDIR)/bin/javah
a61af66fc99e Initial load
duke
parents:
diff changeset
79 RUN.JAR = $(ALT_BOOTDIR)/bin/jar
a61af66fc99e Initial load
duke
parents:
diff changeset
80 COMPILE.JAVAC = $(ALT_BOOTDIR)/bin/javac
a61af66fc99e Initial load
duke
parents:
diff changeset
81 COMPILE.RMIC = $(ALT_BOOTDIR)/bin/rmic
a61af66fc99e Initial load
duke
parents:
diff changeset
82 BOOT_JAVA_HOME = $(ALT_BOOTDIR)
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 else
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 ifdef BOOTDIR
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 RUN.JAVA = $(BOOTDIR)/bin/java
a61af66fc99e Initial load
duke
parents:
diff changeset
89 RUN.JAVAP = $(BOOTDIR)/bin/javap
a61af66fc99e Initial load
duke
parents:
diff changeset
90 RUN.JAVAH = $(BOOTDIR)/bin/javah
a61af66fc99e Initial load
duke
parents:
diff changeset
91 RUN.JAR = $(BOOTDIR)/bin/jar
a61af66fc99e Initial load
duke
parents:
diff changeset
92 COMPILE.JAVAC = $(BOOTDIR)/bin/javac
a61af66fc99e Initial load
duke
parents:
diff changeset
93 COMPILE.RMIC = $(BOOTDIR)/bin/rmic
a61af66fc99e Initial load
duke
parents:
diff changeset
94 BOOT_JAVA_HOME = $(BOOTDIR)
a61af66fc99e Initial load
duke
parents:
diff changeset
95
a61af66fc99e Initial load
duke
parents:
diff changeset
96 else
a61af66fc99e Initial load
duke
parents:
diff changeset
97
a61af66fc99e Initial load
duke
parents:
diff changeset
98 ifdef JAVA_HOME
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 RUN.JAVA = $(JAVA_HOME)/bin/java
a61af66fc99e Initial load
duke
parents:
diff changeset
101 RUN.JAVAP = $(JAVA_HOME)/bin/javap
a61af66fc99e Initial load
duke
parents:
diff changeset
102 RUN.JAVAH = $(JAVA_HOME)/bin/javah
a61af66fc99e Initial load
duke
parents:
diff changeset
103 RUN.JAR = $(JAVA_HOME)/bin/jar
a61af66fc99e Initial load
duke
parents:
diff changeset
104 COMPILE.JAVAC = $(JAVA_HOME)/bin/javac
a61af66fc99e Initial load
duke
parents:
diff changeset
105 COMPILE.RMIC = $(JAVA_HOME)/bin/rmic
a61af66fc99e Initial load
duke
parents:
diff changeset
106 BOOT_JAVA_HOME = $(JAVA_HOME)
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 else
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 # take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
a61af66fc99e Initial load
duke
parents:
diff changeset
111 # note that this is to support hotspot build without SA. To build
a61af66fc99e Initial load
duke
parents:
diff changeset
112 # SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 RUN.JAVA = java
a61af66fc99e Initial load
duke
parents:
diff changeset
115 RUN.JAVAP = javap
a61af66fc99e Initial load
duke
parents:
diff changeset
116 RUN.JAVAH = javah
a61af66fc99e Initial load
duke
parents:
diff changeset
117 RUN.JAR = jar
a61af66fc99e Initial load
duke
parents:
diff changeset
118 COMPILE.JAVAC = javac
a61af66fc99e Initial load
duke
parents:
diff changeset
119 COMPILE.RMIC = rmic
a61af66fc99e Initial load
duke
parents:
diff changeset
120
a61af66fc99e Initial load
duke
parents:
diff changeset
121 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
122 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
123 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
124
971
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
125 COMPILE.JAVAC += $(BOOTSTRAP_JAVAC_FLAGS)
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
126
0
a61af66fc99e Initial load
duke
parents:
diff changeset
127 SUM = /usr/bin/sum
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 # 'gmake MAKE_VERBOSE=y' gives all the gory details.
a61af66fc99e Initial load
duke
parents:
diff changeset
130 QUIETLY$(MAKE_VERBOSE) = @
a61af66fc99e Initial load
duke
parents:
diff changeset
131 RUN.JAR$(MAKE_VERBOSE) += >/dev/null
a61af66fc99e Initial load
duke
parents:
diff changeset
132
971
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
133 # Settings for javac
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
134 BOOT_SOURCE_LANGUAGE_VERSION = 6
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
135 BOOT_TARGET_CLASS_VERSION = 6
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
136 JAVAC_FLAGS = -g -encoding ascii
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
137 BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
0fc81f0a8ca8 6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents: 235
diff changeset
138
0
a61af66fc99e Initial load
duke
parents:
diff changeset
139 # With parallel makes, print a message at the end of compilation.
a61af66fc99e Initial load
duke
parents:
diff changeset
140 ifeq ($(findstring j,$(MFLAGS)),j)
a61af66fc99e Initial load
duke
parents:
diff changeset
141 COMPILE_DONE = && { echo Done with $<; }
a61af66fc99e Initial load
duke
parents:
diff changeset
142 endif
a61af66fc99e Initial load
duke
parents:
diff changeset
143
228
f232d7d67023 6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents: 198
diff changeset
144 # Include $(NONPIC_OBJ_FILES) definition
f232d7d67023 6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents: 198
diff changeset
145 ifndef LP64
f232d7d67023 6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents: 198
diff changeset
146 include $(GAMMADIR)/make/pic.make
f232d7d67023 6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents: 198
diff changeset
147 endif
198
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
148
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
149 # The non-PIC object files are only generated for 32 bit platforms.
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
150 ifdef LP64
0
a61af66fc99e Initial load
duke
parents:
diff changeset
151 %.o: %.cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
152 @echo Compiling $<
a61af66fc99e Initial load
duke
parents:
diff changeset
153 $(QUIETLY) $(REMOVE_TARGET)
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
154 $(QUIETLY) $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
198
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
155 else
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
156 %.o: %.cpp
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
157 @echo Compiling $<
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
158 $(QUIETLY) $(REMOVE_TARGET)
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
159 $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
160 $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
161 $(COMPILE.CC) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE))
198
6470a2a42f92 6647068: libjvm.so is not built PIC
xlu
parents: 91
diff changeset
162 endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
163
a61af66fc99e Initial load
duke
parents:
diff changeset
164 %.o: %.s
a61af66fc99e Initial load
duke
parents:
diff changeset
165 @echo Assembling $<
a61af66fc99e Initial load
duke
parents:
diff changeset
166 $(QUIETLY) $(REMOVE_TARGET)
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
167 $(QUIETLY) $(AS.S) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)
0
a61af66fc99e Initial load
duke
parents:
diff changeset
168
a61af66fc99e Initial load
duke
parents:
diff changeset
169 %.s: %.cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
170 @echo Generating assembly for $<
a61af66fc99e Initial load
duke
parents:
diff changeset
171 $(QUIETLY) $(GENASM.CC) -o $@ $<
a61af66fc99e Initial load
duke
parents:
diff changeset
172 $(QUIETLY) $(DEMANGLE) $(COMPILE_DONE)
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 # Intermediate files (for debugging macros)
a61af66fc99e Initial load
duke
parents:
diff changeset
175 %.i: %.cpp
a61af66fc99e Initial load
duke
parents:
diff changeset
176 @echo Preprocessing $< to $@
a61af66fc99e Initial load
duke
parents:
diff changeset
177 $(QUIETLY) $(PREPROCESS.CC) $< > $@ $(COMPILE_DONE)
a61af66fc99e Initial load
duke
parents:
diff changeset
178
a61af66fc99e Initial load
duke
parents:
diff changeset
179 # Override gnumake built-in rules which do sccs get operations badly.
a61af66fc99e Initial load
duke
parents:
diff changeset
180 # (They put the checked out code in the current directory, not in the
a61af66fc99e Initial load
duke
parents:
diff changeset
181 # directory of the original file.) Since this is a symptom of a teamware
a61af66fc99e Initial load
duke
parents:
diff changeset
182 # failure, and since not all problems can be detected by gnumake due
a61af66fc99e Initial load
duke
parents:
diff changeset
183 # to incomplete dependency checking... just complain and stop.
a61af66fc99e Initial load
duke
parents:
diff changeset
184 %:: s.%
a61af66fc99e Initial load
duke
parents:
diff changeset
185 @echo "========================================================="
a61af66fc99e Initial load
duke
parents:
diff changeset
186 @echo File $@
a61af66fc99e Initial load
duke
parents:
diff changeset
187 @echo is out of date with respect to its SCCS file.
a61af66fc99e Initial load
duke
parents:
diff changeset
188 @echo This file may be from an unresolved Teamware conflict.
a61af66fc99e Initial load
duke
parents:
diff changeset
189 @echo This is also a symptom of a Teamware bringover/putback failure
a61af66fc99e Initial load
duke
parents:
diff changeset
190 @echo in which SCCS files are updated but not checked out.
a61af66fc99e Initial load
duke
parents:
diff changeset
191 @echo Check for other out of date files in your workspace.
a61af66fc99e Initial load
duke
parents:
diff changeset
192 @echo "========================================================="
a61af66fc99e Initial load
duke
parents:
diff changeset
193 @exit 666
a61af66fc99e Initial load
duke
parents:
diff changeset
194
a61af66fc99e Initial load
duke
parents:
diff changeset
195 %:: SCCS/s.%
a61af66fc99e Initial load
duke
parents:
diff changeset
196 @echo "========================================================="
a61af66fc99e Initial load
duke
parents:
diff changeset
197 @echo File $@
a61af66fc99e Initial load
duke
parents:
diff changeset
198 @echo is out of date with respect to its SCCS file.
a61af66fc99e Initial load
duke
parents:
diff changeset
199 @echo This file may be from an unresolved Teamware conflict.
a61af66fc99e Initial load
duke
parents:
diff changeset
200 @echo This is also a symptom of a Teamware bringover/putback failure
a61af66fc99e Initial load
duke
parents:
diff changeset
201 @echo in which SCCS files are updated but not checked out.
a61af66fc99e Initial load
duke
parents:
diff changeset
202 @echo Check for other out of date files in your workspace.
a61af66fc99e Initial load
duke
parents:
diff changeset
203 @echo "========================================================="
a61af66fc99e Initial load
duke
parents:
diff changeset
204 @exit 666
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 .PHONY: default