author | lana |
Sat, 26 Mar 2011 00:10:12 -0700 | |
changeset 8820 | ddac2c4891b9 |
parent 8694 | 6e5584652aea |
parent 8796 | 604a43386301 |
child 9021 | 5cf29386a520 |
permissions | -rw-r--r-- |
2 | 1 |
# |
8792
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
2 |
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
# published by the Free Software Foundation. Oracle designates this |
2 | 8 |
# particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
# by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
# |
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
# |
|
27 |
# Common variables used by all the Java makefiles. This file should |
|
28 |
# not contain rules. |
|
29 |
# |
|
30 |
||
31 |
# WARNING: This file is shared with other workspaces. |
|
32 |
# So when it includes other files, it must use JDK_TOPDIR. |
|
33 |
# |
|
34 |
||
139 | 35 |
# Check for strange explicit settings (change to empty or true) |
36 |
ifdef OPENJDK |
|
37 |
ifneq ($(OPENJDK),true) |
|
38 |
x:=$(error "OPENJDK (if defined) can only be set to true") |
|
39 |
endif |
|
40 |
endif |
|
41 |
||
2 | 42 |
# |
43 |
# On Solaris, the 'make' utility from Sun will not work with these makefiles. |
|
44 |
# This little rule is only understood by Sun's make, and is harmless |
|
45 |
# when seen by the GNU make tool. If using Sun's make, this causes the |
|
46 |
# make command to fail. |
|
47 |
# |
|
48 |
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 |
|
49 |
||
50 |
ifndef JDK_TOPDIR |
|
32
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
51 |
ifdef BUILDDIR |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
52 |
JDK_TOPDIR=$(BUILDDIR)/.. |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
53 |
else |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
54 |
JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository") |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
55 |
endif |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
56 |
endif |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
57 |
ifndef BUILDDIR |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
58 |
# Hack, due to deploy repository using this file. |
d190436d5b3e
6672777: Broken deploy build from jdk fix 6668781 for cygwin windows
ohair
parents:
30
diff
changeset
|
59 |
BUILDDIR=$(JDK_TOPDIR)/make |
2 | 60 |
endif |
61 |
ifndef JDK_MAKE_SHARED_DIR |
|
62 |
JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared |
|
63 |
endif |
|
64 |
||
65 |
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk |
|
66 |
||
67 |
TOPDIR=$(BUILDDIR)/.. |
|
68 |
||
69 |
include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk |
|
70 |
||
71 |
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to |
|
72 |
# src/solaris so if you want to build on Linux you didn't need a src/linux |
|
73 |
# directory. In an ideal world it would be called src/genunix but we are not |
|
74 |
# there yet. |
|
75 |
# |
|
76 |
ifndef SHARE_SRC |
|
30
7ea1edf98bfe
6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents:
2
diff
changeset
|
77 |
SHARE_SRC = $(BUILDDIR)/../src/share |
2 | 78 |
endif |
79 |
||
80 |
# Files that cannot be included in the OpenJDK distribution are |
|
81 |
# collected under a parent directory which contains just those files. |
|
82 |
ifndef CLOSED_SRC |
|
30
7ea1edf98bfe
6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents:
2
diff
changeset
|
83 |
CLOSED_SRC = $(BUILDDIR)/../src/closed |
2 | 84 |
endif |
85 |
||
7308
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
86 |
# If CLOSE_SRC_INCLUDED isn't set to true, check if there's any |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
87 |
# closed directory. |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
88 |
ifneq ($(CLOSED_SRC_INCLUDED), true) |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
89 |
CLOSED_SRC_INCLUDED := $(shell \ |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
90 |
if [ -d $(CLOSED_SRC) ] ; then \ |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
91 |
echo true; \ |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
92 |
else \ |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
93 |
echo false; \ |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
94 |
fi) |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
95 |
endif |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
96 |
|
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
97 |
# Set OPENJDK based on CLOSED_SRC_INCLUDED |
95b4878b4890
6992226: Missing windows COMPANY file property settings
ccheung
parents:
6681
diff
changeset
|
98 |
ifeq ($(CLOSED_SRC_INCLUDED), false) |
2 | 99 |
OPENJDK = true |
100 |
endif |
|
101 |
||
102 |
# Define where closed directories are |
|
103 |
ifdef OPENJDK |
|
104 |
CLOSED_SRC = |
|
105 |
CLOSED_SHARE_SRC = |
|
106 |
else |
|
107 |
ifndef CLOSED_SHARE_SRC |
|
108 |
CLOSED_SHARE_SRC = $(CLOSED_SRC)/share |
|
109 |
endif |
|
110 |
endif |
|
111 |
||
112 |
# |
|
113 |
# Get platform definitions |
|
114 |
# |
|
115 |
||
116 |
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk |
|
117 |
||
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
118 |
# |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
119 |
# Cross-compilation Settings |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
120 |
# |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
121 |
ifdef CROSS_COMPILE_ARCH |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
122 |
# Can't run the tools we just built |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
123 |
USE_ONLY_BOOTDIR_TOOLS = true |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
124 |
|
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
125 |
# When cross-compiling CC generates code for the target, but |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
126 |
# some parts of the build generate C code that has to be compiled |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
127 |
# and executed on the build host - HOST_CC is the 'local' compiler. |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
128 |
# For linux the default is /usr/bin/gcc; other platforms need to |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
129 |
# set it explicitly |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
130 |
ifeq ($(PLATFORM), linux) |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
131 |
ifndef HOST_CC |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
132 |
HOST_CC = $(USRBIN_PATH)gcc |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
133 |
endif |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
134 |
endif |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
135 |
else |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
136 |
# Must set HOST_CC if not already set |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
137 |
ifndef HOST_CC |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
138 |
HOST_CC = $(CC) |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
139 |
endif |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
140 |
endif |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
141 |
|
8792
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
142 |
# Reset the VM name for client-only builds |
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
143 |
ifdef BUILD_CLIENT_ONLY |
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
144 |
VM_NAME = client |
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
145 |
endif |
cd1dceb2d665
7027897: Build support for client-VM only configurations
dholmes
parents:
7967
diff
changeset
|
146 |
|
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
147 |
|
2 | 148 |
# |
149 |
# Freetype logic is applicable to OpenJDK only |
|
150 |
# |
|
151 |
ifdef OPENJDK |
|
152 |
||
153 |
#if we use system lib we do not need to copy it to build tree |
|
154 |
USING_SYSTEM_FT_LIB=false |
|
155 |
||
156 |
ifeq ($(PLATFORM), windows) |
|
157 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH) |
|
158 |
endif |
|
159 |
ifeq ($(PLATFORM), linux) |
|
160 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH) |
|
161 |
endif |
|
162 |
ifeq ($(PLATFORM), solaris) |
|
163 |
# historically for Solaris we have slightly different devtools |
|
164 |
# naming conventions |
|
165 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH) |
|
166 |
endif |
|
167 |
||
168 |
DEVTOOLS_FT_DIR_EXISTS = $(shell \ |
|
169 |
if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \ |
|
170 |
echo true; \ |
|
171 |
else \ |
|
172 |
echo false; \ |
|
173 |
fi) |
|
174 |
||
175 |
ifdef ALT_FREETYPE_LIB_PATH |
|
176 |
FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH) |
|
177 |
else |
|
178 |
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) |
|
179 |
FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib |
|
180 |
else |
|
181 |
FREETYPE_LIB_PATH = /usr/lib |
|
182 |
USING_SYSTEM_FT_LIB=true |
|
183 |
endif |
|
184 |
endif |
|
185 |
||
186 |
ifdef ALT_FREETYPE_HEADERS_PATH |
|
187 |
FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH) |
|
188 |
else |
|
189 |
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) |
|
190 |
FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include |
|
191 |
else |
|
192 |
FREETYPE_HEADERS_PATH = /usr/include |
|
193 |
endif |
|
194 |
endif |
|
195 |
endif |
|
196 |
||
197 |
# |
|
3704
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
198 |
# zlib version |
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
199 |
# |
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
200 |
ZLIB_VERSION = 1.2.3 |
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
201 |
|
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
202 |
|
bd98409d8c32
4963968: zlib should be upgraded to current version of zlib
sherman
parents:
2301
diff
changeset
|
203 |
# |
2 | 204 |
# Localizations for the different parts of the product beyond English |
205 |
# |
|
206 |
||
7468 | 207 |
JRE_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK |
208 |
PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK |
|
2 | 209 |
JDK_LOCALES = ja zh_CN |
210 |
||
211 |
# |
|
212 |
# A list of locales we support but don't have resource files. |
|
213 |
# This is defined to optimize the search of resource bundles. |
|
214 |
# |
|
215 |
JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh |
|
216 |
||
217 |
# |
|
218 |
# All libraries except libjava and libjvm itself link against libjvm and |
|
219 |
# libjava, the latter for its exported common utilities. libjava only links |
|
220 |
# against libjvm. Programs' makefiles take their own responsibility for |
|
221 |
# adding other libs. |
|
222 |
# |
|
223 |
ifdef PACKAGE |
|
224 |
# put JAVALIB first, but do not lose any platform specific values.... |
|
225 |
LDLIBS_COMMON = $(JAVALIB) |
|
226 |
endif # PACKAGE |
|
227 |
||
228 |
# |
|
229 |
# Libraries that must appear ahead of libc.so on the link command line |
|
230 |
# |
|
231 |
ifdef PROGRAM |
|
232 |
||
233 |
ifeq ($(PLATFORM), solaris) |
|
234 |
LDLIBS_COMMON = -lthread -ldl |
|
235 |
endif |
|
236 |
||
237 |
ifeq ($(PLATFORM), linux) |
|
238 |
LDLIBS_COMMON = -ldl |
|
239 |
endif |
|
240 |
||
241 |
endif # PROGRAM |
|
242 |
||
243 |
LDLIBS_COMMON += $(EXTRA_LIBS) |
|
244 |
||
245 |
# for generated libraries |
|
246 |
LIBDIR = $(OUTPUTDIR)/lib |
|
247 |
ABS_LIBDIR = $(ABS_OUTPUTDIR)/lib |
|
248 |
# Optional place to save the windows .lib files |
|
249 |
LIBFILES_DIR = $(OUTPUTDIR)/libfiles |
|
250 |
# for ext jre files |
|
251 |
EXTDIR = $(LIBDIR)/ext |
|
252 |
# for generated include files |
|
253 |
INCLUDEDIR = $(OUTPUTDIR)/include |
|
254 |
# for generated class files |
|
255 |
CLASSBINDIR = $(OUTPUTDIR)/classes |
|
256 |
DEMOCLASSDIR = $(OUTPUTDIR)/democlasses |
|
257 |
# for generated tool class files |
|
258 |
BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses |
|
259 |
# for build tool jar files |
|
260 |
BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars |
|
261 |
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars |
|
305
9b905a071b0e
6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents:
139
diff
changeset
|
262 |
# for generated tool class files |
9b905a071b0e
6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents:
139
diff
changeset
|
263 |
BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins |
2 | 264 |
# for generated java source files |
265 |
GENSRCDIR = $(OUTPUTDIR)/gensrc |
|
266 |
# for generated C source files (not javah) |
|
267 |
GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc |
|
268 |
# for imported source files |
|
269 |
IMPORTSRCDIR = $(OUTPUTDIR)/impsrc |
|
270 |
# for imported documents |
|
271 |
IMPORTDOCDIR = $(OUTPUTDIR)/impdoc |
|
272 |
# for generated demo |
|
273 |
DEMODIR = $(OUTPUTDIR)/demo |
|
274 |
# for sample code |
|
275 |
SAMPLEDIR = $(OUTPUTDIR)/sample |
|
276 |
# for generated documentation |
|
277 |
DOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX) |
|
278 |
DOCSDIRSUFFIX = |
|
279 |
||
280 |
# The MESSAGE, WARNING and ERROR files are used to store sanityck and |
|
6681
e721d11e4826
6987114: Fix top level "test" Makefile logic, add jdk/make/Makefile test target
ohair
parents:
5506
diff
changeset
|
281 |
# warnings and errors. |
2 | 282 |
ifndef ERROR_FILE |
283 |
ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt |
|
284 |
endif |
|
285 |
ifndef WARNING_FILE |
|
286 |
WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt |
|
287 |
endif |
|
288 |
ifndef MESSAGE_FILE |
|
289 |
MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt |
|
290 |
endif |
|
291 |
||
292 |
JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image |
|
293 |
JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image |
|
294 |
||
295 |
#where the demo source can be found |
|
296 |
DEMOSRCDIR = $(SHARE_SRC)/demo |
|
297 |
||
298 |
# An attempt is made to generate unique enough directories for the |
|
299 |
# generated files to not have name collisisons. Most build units |
|
300 |
# defines PRODUCT (except Release.gmk), but then they may or may |
|
7967 | 301 |
# not define PACKAGE, PROGRAM, and LIBRARY. This code attempts to |
302 |
# generate a unique OBJDIR/CLASSHDRDIR for each build unit based |
|
303 |
# on which of those values are set within each build unit. |
|
2 | 304 |
|
305 |
UNIQUE_LOCATION_STRING = tmp |
|
306 |
||
307 |
ifneq ($(PRODUCT),) |
|
308 |
UNIQUE_LOCATION_STRING += /$(PRODUCT) |
|
309 |
endif |
|
310 |
||
311 |
ifneq ($(PACKAGE),) |
|
312 |
UNIQUE_LOCATION_STRING += /$(PACKAGE) |
|
313 |
endif |
|
314 |
||
315 |
ifneq ($(PROGRAM),) |
|
316 |
UNIQUE_LOCATION_STRING += /$(PROGRAM) |
|
317 |
endif |
|
318 |
||
319 |
ifneq ($(LIBRARY),) |
|
320 |
ifneq ($(LIBRARY_OUTPUT),) |
|
321 |
UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT) |
|
322 |
else |
|
323 |
UNIQUE_LOCATION_STRING += /$(LIBRARY) |
|
324 |
endif |
|
325 |
endif |
|
326 |
||
327 |
# the use of += above makes a space separated list which we need to |
|
328 |
# remove for filespecs. |
|
329 |
# |
|
330 |
NULLSTRING := |
|
331 |
ONESPACE := $(NULLSTRING) # space before this comment is required. |
|
332 |
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING)) |
|
333 |
||
334 |
# TEMPDIR is a unique general purpose directory |
|
335 |
# need to use 'override' because GNU Make on Linux exports the wrong |
|
336 |
# value. |
|
337 |
override TEMPDIR = $(OUTPUTDIR)/$(UNIQUE_PATH) |
|
338 |
override ABS_TEMPDIR = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH) |
|
339 |
||
340 |
# This must be created right away for pattern rules in Sanity.gmk to work. |
|
341 |
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR)) |
|
342 |
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK)) |
|
343 |
||
344 |
# OBJDIRNAME is the name of the directory where the object code is to |
|
345 |
# be placed. It's name depends on whether the data model architecture |
|
346 |
# is 32-bit or not. |
|
347 |
ifneq ($(ARCH_DATA_MODEL), 32) |
|
348 |
OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX) |
|
349 |
else |
|
350 |
OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX) |
|
351 |
endif |
|
352 |
OBJDIR = $(TEMPDIR)/$(OBJDIRNAME) |
|
353 |
||
354 |
# CLASSHDRDIR is where the generated C Class Header files go. |
|
355 |
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders |
|
356 |
||
357 |
# |
|
358 |
# CLASSDESTDIR can be used to specify the directory where generated classes |
|
359 |
# are to be placed. The default is CLASSBINDIR. |
|
360 |
# |
|
361 |
ifndef CLASSDESTDIR |
|
362 |
CLASSDESTDIR = $(CLASSBINDIR) |
|
363 |
endif |
|
364 |
||
365 |
INCLUDES = -I. -I$(CLASSHDRDIR) \ |
|
366 |
$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES) |
|
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
367 |
OTHER_CPPFLAGS += $(INCLUDES) |
2 | 368 |
|
369 |
# |
|
370 |
# vpaths. These are the default locations searched for source files. |
|
371 |
# GNUmakefiles of individual areas often override the default settings. |
|
372 |
# There are no longer default vpath entries for C and assembler files |
|
373 |
# so we can ensure that libraries don't get their hands on JVM files. |
|
374 |
# |
|
375 |
# We define an intermediate variable for Java files because |
|
376 |
# we use its value later to help define $SOURCEPATH |
|
377 |
||
378 |
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes |
|
379 |
ifdef OPENJDK |
|
380 |
VPATH.java = $(VPATH0.java) |
|
381 |
else |
|
382 |
# |
|
383 |
# If filenames are duplicated between open/closed workspaces, prefer |
|
384 |
# the closed files. |
|
385 |
# |
|
386 |
# Source ordering is important: some targets depend on closed files |
|
387 |
# replacing open ones, and thus the closed file sources must be found |
|
388 |
# before the open ones. |
|
389 |
# |
|
390 |
# Don't reorder without consulting the teams that depend on this behavior. |
|
391 |
# |
|
392 |
VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java) |
|
393 |
endif |
|
394 |
vpath %.java $(VPATH.java) |
|
395 |
vpath %.class $(CLASSBINDIR) |
|
396 |
vpath %.$(OBJECT_SUFFIX) $(OBJDIR) |
|
397 |
||
398 |
# |
|
399 |
# VPATH.h is used elsewhere to generate include flags. By default, |
|
400 |
# anyone has access to the include files that the JVM area exports, |
|
401 |
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific |
|
402 |
# relatives. |
|
403 |
# |
|
1090
c5805b1672a6
6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents:
919
diff
changeset
|
404 |
VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export |
2 | 405 |
vpath %.h $(VPATH.h) |
406 |
||
407 |
# |
|
408 |
# Used in two ways: helps link against libjava.so. Also if overridden |
|
409 |
# determines where your shared library is installed. |
|
410 |
# |
|
411 |
ifndef LIB_LOCATION |
|
412 |
LIB_LOCATION = $(LIBDIR)/$(LIBARCH) |
|
413 |
endif |
|
414 |
||
415 |
# |
|
416 |
# Java header and stub variables |
|
417 |
# |
|
418 |
CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export))) |
|
419 |
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX) |
|
420 |
STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h |
|
421 |
||
422 |
# |
|
423 |
# Classpath seen by javac (different from the one seen by the VM |
|
424 |
# running javac), and useful variables. |
|
425 |
# |
|
426 |
SOURCEPATH = $(VPATH.java) |
|
427 |
PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)') |
|
428 |
PKGDIR = $(subst .,/,$(PACKAGE)) |
|
429 |
||
430 |
# |
|
431 |
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.) |
|
432 |
# |
|
433 |
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk |
|
434 |
||
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
435 |
UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH)) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
436 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
437 |
# Run MAKE $@ for a launcher: |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
438 |
# $(call make-launcher, name, mainclass, java-args, main-args) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
439 |
define make-launcher |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
440 |
$(CD) $(BUILDDIR)/launchers && \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
441 |
$(MAKE) -f Makefile.launcher \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
442 |
PROGRAM=$(strip $1) \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
443 |
MAIN_CLASS=$(strip $2) \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
444 |
MAIN_JAVA_ARGS="$(strip $3)" \ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
445 |
MAIN_ARGS="$(strip $4)" |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
446 |
endef |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
447 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
448 |
# |
2 | 449 |
# Convenient macros |
450 |
# |
|
451 |
||
452 |
# Prepare $@ target, remove old one and making sure directory exists |
|
453 |
define prep-target |
|
454 |
$(MKDIR) -p $(@D) |
|
455 |
$(RM) $@ |
|
456 |
endef |
|
457 |
||
458 |
# Simple install of $< file to $@ |
|
459 |
define install-file |
|
460 |
$(prep-target) |
|
461 |
$(CP) $< $@ |
|
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
462 |
endef |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
463 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
464 |
define chmod-file |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
465 |
$(CHMOD) $1 $@ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
466 |
endef |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
467 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
468 |
define install-sym-link |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
469 |
$(LN) -s $1 $@ |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
470 |
endef |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
471 |
|
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
472 |
define install-manifest-file |
8583
15dea0fdc2ea
7025631: Remove the modules build support from jdk 7
mchung
parents:
7967
diff
changeset
|
473 |
$(install-file) |
2 | 474 |
endef |
475 |
||
476 |
# Cleanup rule for after debug java run (hotspot.log file is left around) |
|
477 |
# (This could be an old leftover file in a read-only area, use the @- prefix) |
|
478 |
HOTSPOT_LOG_NAME = hotspot.log |
|
479 |
define java-vm-cleanup |
|
480 |
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi |
|
481 |
endef |
|
482 |
||
483 |
# Current directory |
|
484 |
CURRENT_DIRECTORY := $(shell $(PWD)) |
|
485 |
||
486 |
# |
|
487 |
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is |
|
488 |
# used for this file, otherwise the default settings are used. |
|
489 |
# |
|
490 |
CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \ |
|
491 |
$(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F))) |
|
492 |
CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \ |
|
493 |
$(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F))) |
|
494 |
||
495 |
# |
|
496 |
# Tool flags |
|
497 |
# |
|
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
498 |
# EXTRA_CFLAGS are used to define cross-compilation options |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
499 |
# |
2 | 500 |
ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS) |
8796
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
501 |
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS) |
604a43386301
7027910: Add basic cross-compilation support and add ARM/PPC to the known architectures in the open code
dholmes
parents:
8793
diff
changeset
|
502 |
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS) |
2 | 503 |
CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \ |
504 |
$(DEFINES) $(OPTIONS:%=-D%) |
|
505 |
LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS) |
|
506 |
LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON) |
|
507 |
LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \ |
|
508 |
$(OTHER_LINTFLAGS) |
|
509 |
||
4116
54b55d640d9a
6888709: Change use of -DX=\""Y\"" to -DX='"Y"', consistently for all platforms
ohair
parents:
3704
diff
changeset
|
510 |
VERSION_DEFINES = -DRELEASE='"$(RELEASE)"' |
2 | 511 |
|
512 |
ifdef INSANE |
|
513 |
export INSANE |
|
514 |
endif |
|
515 |
||
516 |
ifdef ALT_COPYRIGHT_YEAR |
|
517 |
COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) |
|
518 |
else |
|
847 | 519 |
COPYRIGHT_YEAR := $(shell $(DATE) '+%Y') |
2 | 520 |
endif |
521 |
||
8694
6e5584652aea
7029704: JFB: Refix JFB Custom Revision Version Build/Makefile changes
asaha
parents:
8583
diff
changeset
|
522 |
ifndef OPENJDK |
6e5584652aea
7029704: JFB: Refix JFB Custom Revision Version Build/Makefile changes
asaha
parents:
8583
diff
changeset
|
523 |
include $(JDK_TOPDIR)/make/closed/common/Defs.gmk |
6e5584652aea
7029704: JFB: Refix JFB Custom Revision Version Build/Makefile changes
asaha
parents:
8583
diff
changeset
|
524 |
endif |
6e5584652aea
7029704: JFB: Refix JFB Custom Revision Version Build/Makefile changes
asaha
parents:
8583
diff
changeset
|
525 |
|
2 | 526 |
# Install of imported file (JDK_IMPORT_PATH, or some other external location) |
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
527 |
define install-importonly-file |
2 | 528 |
@$(ECHO) "ASSEMBLY_IMPORT: $@" |
1164
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
529 |
$(prep-target) |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
530 |
$(CP) $< $@ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
531 |
@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
532 |
if [ -x /usr/sbin/selinuxenabled ] ; then \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
533 |
/usr/sbin/selinuxenabled; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
534 |
if [ $$? = 0 ] ; then \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
535 |
$(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@"; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
536 |
/usr/bin/chcon -t textrel_shlib_t $@; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
537 |
if [ $$? != 0 ]; then \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
538 |
echo "ERROR: Cannot chcon $@"; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
539 |
fi; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
540 |
fi; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
541 |
fi; \ |
fcf7f66faf68
6746409: Error: dl failure on line 689: Copies of libjvm.so need to have chcon (selinux) re-applied to them
ohair
parents:
919
diff
changeset
|
542 |
fi |
2 | 543 |
endef |
544 |
||
4665
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
545 |
define install-import-file |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
546 |
$(install-importonly-file) |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
547 |
endef |
d14dc3d9e1fa
6911737: Module build: generate modules with native libraries and any other files not in jar
mchung
parents:
4116
diff
changeset
|
548 |
|
2 | 549 |
.PHONY: all build clean clobber |