author | mikael |
Tue, 10 Mar 2015 09:42:23 -0700 | |
changeset 29463 | 4b16497408b9 |
parent 26691 | 40ea2c41f53b |
child 34289 | 2d1821a50263 |
permissions | -rw-r--r-- |
1 | 1 |
# |
25639
61be16de0fd5
8046765: makefiles should use parameterized $(CP) and $(MV) rather than explicit commands
mduigou
parents:
13963
diff
changeset
|
2 |
# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
# |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3818
diff
changeset
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3818
diff
changeset
|
20 |
# or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3818
diff
changeset
|
21 |
# questions. |
25639
61be16de0fd5
8046765: makefiles should use parameterized $(CP) and $(MV) rather than explicit commands
mduigou
parents:
13963
diff
changeset
|
22 |
# |
1 | 23 |
# |
24 |
||
25 |
# Common rules/macros for the vm, adlc. |
|
26 |
||
27 |
# Tell make that .cpp is important |
|
28 |
.SUFFIXES: .cpp $(SUFFIXES) |
|
29 |
||
30 |
DEMANGLER = c++filt |
|
25639
61be16de0fd5
8046765: makefiles should use parameterized $(CP) and $(MV) rather than explicit commands
mduigou
parents:
13963
diff
changeset
|
31 |
DEMANGLE = $(DEMANGLER) < $@ > .$@ && $(MV) -f .$@ $@ |
1 | 32 |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
33 |
# $(CC) is the c compiler (cc/gcc), $(CXX) is the c++ compiler (CC/g++). |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
34 |
CC_COMPILE = $(CC) $(CXXFLAGS) $(CFLAGS) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
35 |
CXX_COMPILE = $(CXX) $(CXXFLAGS) $(CFLAGS) |
1 | 36 |
|
37 |
AS.S = $(AS) $(ASFLAGS) |
|
38 |
||
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
39 |
COMPILE.CC = $(CC_COMPILE) -c |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
40 |
GENASM.CC = $(CC_COMPILE) -S |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
41 |
LINK.CC = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
42 |
LINK_LIB.CC = $(CC) $(LFLAGS) $(SHARED_FLAG) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
43 |
PREPROCESS.CC = $(CC_COMPILE) -E |
1 | 44 |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
45 |
COMPILE.CXX = $(CXX_COMPILE) -c |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
46 |
GENASM.CXX = $(CXX_COMPILE) -S |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
47 |
LINK.CXX = $(CXX) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
48 |
LINK_NOPROF.CXX = $(CXX) $(LFLAGS) $(AOUT_FLAGS) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
49 |
LINK_LIB.CXX = $(CXX) $(LFLAGS) $(SHARED_FLAG) |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
50 |
PREPROCESS.CXX = $(CXX_COMPILE) -E |
1 | 51 |
|
52 |
# Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k". |
|
53 |
REMOVE_TARGET = rm -f $@ |
|
54 |
||
55 |
# Note use of ALT_BOOTDIR to explicitly specify location of java and |
|
56 |
# javac; this is the same environment variable used in the J2SE build |
|
57 |
# process for overriding the default spec, which is BOOTDIR. |
|
58 |
# Note also that we fall back to using JAVA_HOME if neither of these is |
|
59 |
# specified. |
|
60 |
||
61 |
ifdef ALT_BOOTDIR |
|
62 |
||
63 |
RUN.JAVA = $(ALT_BOOTDIR)/bin/java |
|
64 |
RUN.JAVAP = $(ALT_BOOTDIR)/bin/javap |
|
65 |
RUN.JAVAH = $(ALT_BOOTDIR)/bin/javah |
|
66 |
RUN.JAR = $(ALT_BOOTDIR)/bin/jar |
|
67 |
COMPILE.JAVAC = $(ALT_BOOTDIR)/bin/javac |
|
68 |
COMPILE.RMIC = $(ALT_BOOTDIR)/bin/rmic |
|
69 |
BOOT_JAVA_HOME = $(ALT_BOOTDIR) |
|
70 |
||
71 |
else |
|
72 |
||
73 |
ifdef BOOTDIR |
|
74 |
||
75 |
RUN.JAVA = $(BOOTDIR)/bin/java |
|
76 |
RUN.JAVAP = $(BOOTDIR)/bin/javap |
|
77 |
RUN.JAVAH = $(BOOTDIR)/bin/javah |
|
78 |
RUN.JAR = $(BOOTDIR)/bin/jar |
|
79 |
COMPILE.JAVAC = $(BOOTDIR)/bin/javac |
|
80 |
COMPILE.RMIC = $(BOOTDIR)/bin/rmic |
|
81 |
BOOT_JAVA_HOME = $(BOOTDIR) |
|
82 |
||
83 |
else |
|
84 |
||
85 |
ifdef JAVA_HOME |
|
86 |
||
87 |
RUN.JAVA = $(JAVA_HOME)/bin/java |
|
88 |
RUN.JAVAP = $(JAVA_HOME)/bin/javap |
|
89 |
RUN.JAVAH = $(JAVA_HOME)/bin/javah |
|
90 |
RUN.JAR = $(JAVA_HOME)/bin/jar |
|
91 |
COMPILE.JAVAC = $(JAVA_HOME)/bin/javac |
|
92 |
COMPILE.RMIC = $(JAVA_HOME)/bin/rmic |
|
93 |
BOOT_JAVA_HOME = $(JAVA_HOME) |
|
94 |
||
95 |
else |
|
96 |
||
97 |
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined |
|
98 |
# note that this is to support hotspot build without SA. To build |
|
99 |
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME |
|
100 |
||
101 |
RUN.JAVA = java |
|
102 |
RUN.JAVAP = javap |
|
103 |
RUN.JAVAH = javah |
|
104 |
RUN.JAR = jar |
|
105 |
COMPILE.JAVAC = javac |
|
106 |
COMPILE.RMIC = rmic |
|
107 |
||
108 |
endif |
|
109 |
endif |
|
110 |
endif |
|
111 |
||
3818
75004bf9026c
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents:
781
diff
changeset
|
112 |
COMPILE.JAVAC += $(BOOTSTRAP_JAVAC_FLAGS) |
75004bf9026c
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents:
781
diff
changeset
|
113 |
|
1 | 114 |
SUM = /usr/bin/sum |
115 |
||
116 |
# 'gmake MAKE_VERBOSE=y' gives all the gory details. |
|
117 |
QUIETLY$(MAKE_VERBOSE) = @ |
|
118 |
RUN.JAR$(MAKE_VERBOSE) += >/dev/null |
|
119 |
||
3818
75004bf9026c
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents:
781
diff
changeset
|
120 |
# Settings for javac |
75004bf9026c
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents:
781
diff
changeset
|
121 |
JAVAC_FLAGS = -g -encoding ascii |
29463
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
122 |
|
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
123 |
# Prefer BOOT_JDK_SOURCETARGET if it's set (typically by the top build system) |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
124 |
# Fall back to the values here if it's not set (hotspot only builds) |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
125 |
ifeq ($(BOOT_JDK_SOURCETARGET),) |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
126 |
BOOTSTRAP_SOURCETARGET := -source 8 -target 8 |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
127 |
else |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
128 |
BOOTSTRAP_SOURCETARGET := $(BOOT_JDK_SOURCETARGET) |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
129 |
endif |
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
130 |
|
4b16497408b9
8074726: Update source and target version used when compiling hotspot class files
mikael
parents:
26691
diff
changeset
|
131 |
BOOTSTRAP_JAVAC_FLAGS = $(JAVAC_FLAGS) $(BOOTSTRAP_SOURCETARGET) |
3818
75004bf9026c
6873059: Explicitly use -source 6 -target 6 when compiling with the boot jdk
andrew
parents:
781
diff
changeset
|
132 |
|
1 | 133 |
# With parallel makes, print a message at the end of compilation. |
134 |
ifeq ($(findstring j,$(MFLAGS)),j) |
|
135 |
COMPILE_DONE = && { echo Done with $<; } |
|
136 |
endif |
|
137 |
||
774
e71318ea23e8
6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents:
744
diff
changeset
|
138 |
# Include NONPIC_OBJ_FILES definition |
e71318ea23e8
6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents:
744
diff
changeset
|
139 |
ifndef LP64 |
e71318ea23e8
6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents:
744
diff
changeset
|
140 |
include $(GAMMADIR)/make/pic.make |
e71318ea23e8
6717128: Using relative path for ALT_OUTPUTDIR does not work properly
xlu
parents:
744
diff
changeset
|
141 |
endif |
1 | 142 |
|
8114
340b5b8b544b
7003401: Implement VM error-reporting functionality on erroneous termination
kamg
parents:
7397
diff
changeset
|
143 |
include $(GAMMADIR)/make/altsrc.make |
340b5b8b544b
7003401: Implement VM error-reporting functionality on erroneous termination
kamg
parents:
7397
diff
changeset
|
144 |
|
1 | 145 |
# Sun compiler for 64 bit Solaris does not support building non-PIC object files. |
146 |
ifdef LP64 |
|
147 |
%.o: %.cpp |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
25639
diff
changeset
|
148 |
@echo $(LOG_INFO) Compiling $< |
1 | 149 |
$(QUIETLY) $(REMOVE_TARGET) |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
150 |
$(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE) |
1 | 151 |
else |
152 |
%.o: %.cpp |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
25639
diff
changeset
|
153 |
@echo $(LOG_INFO) Compiling $< |
1 | 154 |
$(QUIETLY) $(REMOVE_TARGET) |
155 |
$(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \ |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
156 |
$(subst $(VM_PICFLAG), ,$(COMPILE.CXX)) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE), \ |
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
157 |
$(COMPILE.CXX) $(DEPFLAGS) -o $@ $< $(COMPILE_DONE)) |
1 | 158 |
endif |
159 |
||
160 |
%.o: %.s |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
25639
diff
changeset
|
161 |
@echo $(LOG_INFO) Assembling $< |
1 | 162 |
$(QUIETLY) $(REMOVE_TARGET) |
163 |
$(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE) |
|
164 |
||
165 |
%.s: %.cpp |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
25639
diff
changeset
|
166 |
@echo $(LOG_INFO) Generating assembly for $< |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
167 |
$(QUIETLY) $(GENASM.CXX) -o $@ $< |
1 | 168 |
$(QUIETLY) $(DEMANGLE) $(COMPILE_DONE) |
169 |
||
170 |
# Intermediate files (for debugging macros) |
|
171 |
%.i: %.cpp |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
25639
diff
changeset
|
172 |
@echo $(LOG_INFO) Preprocessing $< to $@ |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
8921
diff
changeset
|
173 |
$(QUIETLY) $(PREPROCESS.CXX) $< > $@ $(COMPILE_DONE) |
1 | 174 |
|
175 |
# Override gnumake built-in rules which do sccs get operations badly. |
|
176 |
# (They put the checked out code in the current directory, not in the |
|
177 |
# directory of the original file.) Since this is a symptom of a teamware |
|
178 |
# failure, and since not all problems can be detected by gnumake due |
|
179 |
# to incomplete dependency checking... just complain and stop. |
|
180 |
%:: s.% |
|
181 |
@echo "=========================================================" |
|
182 |
@echo File $@ |
|
183 |
@echo is out of date with respect to its SCCS file. |
|
184 |
@echo This file may be from an unresolved Teamware conflict. |
|
185 |
@echo This is also a symptom of a Teamware bringover/putback failure |
|
186 |
@echo in which SCCS files are updated but not checked out. |
|
187 |
@echo Check for other out of date files in your workspace. |
|
188 |
@echo "=========================================================" |
|
189 |
@exit 666 |
|
190 |
||
191 |
%:: SCCS/s.% |
|
192 |
@echo "=========================================================" |
|
193 |
@echo File $@ |
|
194 |
@echo is out of date with respect to its SCCS file. |
|
195 |
@echo This file may be from an unresolved Teamware conflict. |
|
196 |
@echo This is also a symptom of a Teamware bringover/putback failure |
|
197 |
@echo in which SCCS files are updated but not checked out. |
|
198 |
@echo Check for other out of date files in your workspace. |
|
199 |
@echo "=========================================================" |
|
200 |
@exit 666 |
|
201 |
||
202 |
.PHONY: default |