author | wetmore |
Mon, 03 Aug 2009 18:06:51 -0700 | |
changeset 3353 | ddbd63234844 |
parent 2301 | 0a3821d472a3 |
child 3704 | bd98409d8c32 |
permissions | -rw-r--r-- |
2 | 1 |
# |
715 | 2 |
# Copyright 1995-2008 Sun Microsystems, Inc. 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 |
|
7 |
# published by the Free Software Foundation. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun in the LICENSE file that accompanied this code. |
|
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 |
# |
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
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 |
||
86 |
# If we have no closed directory, force it to an openjdk build |
|
87 |
CLOSED_SRC_DIR_EXISTS := $(shell \ |
|
88 |
if [ -d $(CLOSED_SRC) ] ; then \ |
|
89 |
echo true; \ |
|
90 |
else \ |
|
91 |
echo false; \ |
|
92 |
fi) |
|
93 |
ifeq ($(CLOSED_SRC_DIR_EXISTS), false) |
|
94 |
OPENJDK = true |
|
95 |
endif |
|
96 |
||
97 |
# Define where closed directories are |
|
98 |
ifdef OPENJDK |
|
99 |
CLOSED_SRC = |
|
100 |
CLOSED_SHARE_SRC = |
|
101 |
else |
|
102 |
ifndef CLOSED_SHARE_SRC |
|
103 |
CLOSED_SHARE_SRC = $(CLOSED_SRC)/share |
|
104 |
endif |
|
105 |
endif |
|
106 |
||
107 |
# If OPENJDK is defined, we may still need to use some native libraries that |
|
108 |
# exist only as part of the closed source. If the closed sources are not |
|
109 |
# available, the libraries must have been pre-built. Since these libraries |
|
110 |
# and the JDK internal interfaces to these are reasonably stable this is not |
|
111 |
# a significant problem. But we do need to provide a way to locate them, |
|
112 |
# including a way to point to a new one when there have been changes. |
|
113 |
# |
|
114 |
# If you have a formal binary plugs download, set ALT_BINARY_PLUGS_PATH |
|
115 |
# to the location. |
|
116 |
# (Optionally you can set ALT_CLOSED_JDK_IMPORT_PATH to point to the latest |
|
117 |
# build JDK, or last promotion for this JDK version, but will not work |
|
118 |
# on windows). |
|
119 |
# |
|
120 |
# As the OPENJDK is built, the binary plugs are used instead of building the |
|
121 |
# libraries. |
|
122 |
# Individual Makefiles that specify USE_BINARY_PLUG_LIBRARY, will get |
|
123 |
# the binary plug copy (or a copy from a built JDK). |
|
124 |
# |
|
125 |
# See common/internal/BinaryPlugs.gmk for more information. |
|
126 |
# |
|
127 |
# Usage notes: |
|
128 |
# |
|
129 |
# ALT_BINARY_PLUGS_JARFILE is probably rarely needed. It can be used |
|
130 |
# to identify the exact jar file to be used for all closed classes.. |
|
131 |
# |
|
132 |
# ALT_BINARY_PLUGS_PATH points to a directory containing precisely the |
|
133 |
# binaries needed to build. |
|
134 |
# |
|
135 |
# ALT_BUILD_BINARY_PLUGS_PATH points to a directory containing binary plug dirs |
|
136 |
# multiple architectures named using the standard conventions |
|
137 |
# This is useful for build scripts that need to build multiple architectures |
|
138 |
# of the OpenJDK. |
|
139 |
# |
|
140 |
# ALT_CLOSED_JDK_IMPORT_PATH points to the top-level of a specific platform |
|
141 |
# JDK image. |
|
142 |
# |
|
143 |
# The precedence is that |
|
144 |
# 1. ALT_BINARY_PLUGS_JARFILE overrides any other location of the classes |
|
145 |
# 2. ALT_BINARY_PLUGS_PATH overrides all locations of classes and libraries |
|
146 |
# 3. ALT_BUILD_BINARY_PLUGS_PATH is used to find a ALT_BINARY_PLUGS_PATH |
|
147 |
# 4. ALT_CLOSED_JDK_IMPORT_PATH is used to locate classes and libraries |
|
2301 | 148 |
# Note: If any of the ALT_ variables are modified here, it is assumed |
149 |
# that the build should be done with IMPORT_BINARY_PLUGS=true as |
|
150 |
# well. Otherwise the default will be IMPORT_BINARY_PLUGS=false. |
|
151 |
# Lastly, setting IMPORT_BINARY_PLUGS=false on the command line |
|
152 |
# will override this logic, and plugs will not be imported. |
|
2 | 153 |
# |
154 |
||
155 |
# Always needed, defines the name of the imported/exported jarfile |
|
156 |
BINARY_PLUGS_JARNAME = rt-closed.jar |
|
157 |
||
158 |
ifdef OPENJDK |
|
159 |
ifdef ALT_CLOSED_JDK_IMPORT_PATH |
|
160 |
CLOSED_JDK_IMPORT_PATH = $(ALT_CLOSED_JDK_IMPORT_PATH) |
|
161 |
BINARY_PLUGS_PATH = $(CLOSED_JDK_IMPORT_PATH) |
|
162 |
BINARY_PLUGS_JARFILE = $(CLOSED_JDK_IMPORT_PATH)/jre/lib/rt.jar |
|
2301 | 163 |
IMPORT_BINARY_PLUGS=true |
2 | 164 |
endif |
165 |
ifdef ALT_BUILD_BINARY_PLUGS_PATH |
|
166 |
BUILD_BINARY_PLUGS_PATH = $(ALT_BUILD_BINARY_PLUGS_PATH) |
|
2301 | 167 |
IMPORT_BINARY_PLUGS=true |
2 | 168 |
else |
169 |
BUILD_BINARY_PLUGS_PATH = $(SLASH_JAVA)/re/jdk/$(JDK_VERSION)/promoted/latest/openjdk/binaryplugs |
|
170 |
endif |
|
171 |
BINARY_PLUGS_PATH = $(BUILD_BINARY_PLUGS_PATH)/$(PLATFORM)-$(ARCH) |
|
172 |
BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME) |
|
173 |
ifdef ALT_BINARY_PLUGS_PATH |
|
174 |
BINARY_PLUGS_PATH = $(ALT_BINARY_PLUGS_PATH) |
|
175 |
BINARY_PLUGS_JARFILE = $(BINARY_PLUGS_PATH)/jre/lib/$(BINARY_PLUGS_JARNAME) |
|
2301 | 176 |
IMPORT_BINARY_PLUGS=true |
2 | 177 |
endif |
178 |
ifdef ALT_BINARY_PLUGS_JARFILE |
|
179 |
BINARY_PLUGS_JARFILE = $(ALT_BINARY_PLUGS_JARFILE) |
|
2301 | 180 |
IMPORT_BINARY_PLUGS=true |
2 | 181 |
endif |
182 |
endif # OPENJDK |
|
183 |
||
184 |
# |
|
185 |
# Get platform definitions |
|
186 |
# |
|
187 |
||
188 |
include $(JDK_TOPDIR)/make/common/Defs-$(PLATFORM).gmk |
|
189 |
||
190 |
# |
|
191 |
# Freetype logic is applicable to OpenJDK only |
|
192 |
# |
|
193 |
ifdef OPENJDK |
|
194 |
||
195 |
#if we use system lib we do not need to copy it to build tree |
|
196 |
USING_SYSTEM_FT_LIB=false |
|
197 |
||
198 |
ifeq ($(PLATFORM), windows) |
|
199 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH) |
|
200 |
endif |
|
201 |
ifeq ($(PLATFORM), linux) |
|
202 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH) |
|
203 |
endif |
|
204 |
ifeq ($(PLATFORM), solaris) |
|
205 |
# historically for Solaris we have slightly different devtools |
|
206 |
# naming conventions |
|
207 |
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH) |
|
208 |
endif |
|
209 |
||
210 |
DEVTOOLS_FT_DIR_EXISTS = $(shell \ |
|
211 |
if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \ |
|
212 |
echo true; \ |
|
213 |
else \ |
|
214 |
echo false; \ |
|
215 |
fi) |
|
216 |
||
217 |
ifdef ALT_FREETYPE_LIB_PATH |
|
218 |
FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH) |
|
219 |
else |
|
220 |
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) |
|
221 |
FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib |
|
222 |
else |
|
223 |
FREETYPE_LIB_PATH = /usr/lib |
|
224 |
USING_SYSTEM_FT_LIB=true |
|
225 |
endif |
|
226 |
endif |
|
227 |
||
228 |
ifeq ($(PLATFORM), windows) |
|
229 |
FREETYPE_LIB = $(FREETYPE_LIB_PATH)/freetype.lib |
|
230 |
else |
|
231 |
FREETYPE_LIB = -L$(FREETYPE_LIB_PATH) -lfreetype |
|
232 |
endif |
|
233 |
||
234 |
ifdef ALT_FREETYPE_HEADERS_PATH |
|
235 |
FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH) |
|
236 |
else |
|
237 |
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true) |
|
238 |
FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include |
|
239 |
else |
|
240 |
FREETYPE_HEADERS_PATH = /usr/include |
|
241 |
endif |
|
242 |
endif |
|
243 |
endif |
|
244 |
||
245 |
# |
|
246 |
# Localizations for the different parts of the product beyond English |
|
247 |
# |
|
248 |
||
249 |
JRE_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK |
|
250 |
PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK |
|
251 |
JDK_LOCALES = ja zh_CN |
|
252 |
||
253 |
# |
|
254 |
# A list of locales we support but don't have resource files. |
|
255 |
# This is defined to optimize the search of resource bundles. |
|
256 |
# |
|
257 |
JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh |
|
258 |
||
259 |
# |
|
260 |
# All libraries except libjava and libjvm itself link against libjvm and |
|
261 |
# libjava, the latter for its exported common utilities. libjava only links |
|
262 |
# against libjvm. Programs' makefiles take their own responsibility for |
|
263 |
# adding other libs. |
|
264 |
# |
|
265 |
ifdef PACKAGE |
|
266 |
# put JAVALIB first, but do not lose any platform specific values.... |
|
267 |
LDLIBS_COMMON = $(JAVALIB) |
|
268 |
endif # PACKAGE |
|
269 |
||
270 |
# |
|
271 |
# Libraries that must appear ahead of libc.so on the link command line |
|
272 |
# |
|
273 |
ifdef PROGRAM |
|
274 |
||
275 |
ifeq ($(PLATFORM), solaris) |
|
276 |
LDLIBS_COMMON = -lthread -ldl |
|
277 |
endif |
|
278 |
||
279 |
ifeq ($(PLATFORM), linux) |
|
280 |
LDLIBS_COMMON = -ldl |
|
281 |
endif |
|
282 |
||
283 |
endif # PROGRAM |
|
284 |
||
285 |
LDLIBS_COMMON += $(EXTRA_LIBS) |
|
286 |
||
287 |
# |
|
288 |
# Default is to build, not import native binaries |
|
289 |
# |
|
290 |
ifndef IMPORT_NATIVE_BINARIES |
|
291 |
IMPORT_NATIVE_BINARIES=false |
|
292 |
endif |
|
293 |
# If importing libraries in, no incremental builds |
|
294 |
ifeq ($(IMPORT_NATIVE_BINARIES),true) |
|
295 |
INCREMENTAL_BUILD=false |
|
296 |
endif |
|
297 |
||
298 |
# for generated libraries |
|
299 |
LIBDIR = $(OUTPUTDIR)/lib |
|
300 |
ABS_LIBDIR = $(ABS_OUTPUTDIR)/lib |
|
301 |
# Optional place to save the windows .lib files |
|
302 |
LIBFILES_DIR = $(OUTPUTDIR)/libfiles |
|
303 |
# for ext jre files |
|
304 |
EXTDIR = $(LIBDIR)/ext |
|
305 |
# for generated include files |
|
306 |
INCLUDEDIR = $(OUTPUTDIR)/include |
|
307 |
# for generated class files |
|
308 |
CLASSBINDIR = $(OUTPUTDIR)/classes |
|
309 |
DEMOCLASSDIR = $(OUTPUTDIR)/democlasses |
|
310 |
# for generated tool class files |
|
311 |
BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses |
|
312 |
# for build tool jar files |
|
313 |
BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars |
|
314 |
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars |
|
305
9b905a071b0e
6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents:
139
diff
changeset
|
315 |
# for generated tool class files |
9b905a071b0e
6672405: OPENJDK build: jdk7/jdk/make/tools/freetypecheck leaves dirt behind
ohair
parents:
139
diff
changeset
|
316 |
BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins |
2 | 317 |
# for generated java source files |
318 |
GENSRCDIR = $(OUTPUTDIR)/gensrc |
|
319 |
# for generated C source files (not javah) |
|
320 |
GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc |
|
321 |
# for imported source files |
|
322 |
IMPORTSRCDIR = $(OUTPUTDIR)/impsrc |
|
323 |
# for imported documents |
|
324 |
IMPORTDOCDIR = $(OUTPUTDIR)/impdoc |
|
325 |
# for generated demo |
|
326 |
DEMODIR = $(OUTPUTDIR)/demo |
|
327 |
# for sample code |
|
328 |
SAMPLEDIR = $(OUTPUTDIR)/sample |
|
329 |
# for generated documentation |
|
330 |
DOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX) |
|
331 |
DOCSDIRSUFFIX = |
|
332 |
||
333 |
# The MESSAGE, WARNING and ERROR files are used to store sanityck and |
|
334 |
# SCCS check messages, warnings and errors. |
|
335 |
ifndef ERROR_FILE |
|
336 |
ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt |
|
337 |
endif |
|
338 |
ifndef WARNING_FILE |
|
339 |
WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt |
|
340 |
endif |
|
341 |
ifndef MESSAGE_FILE |
|
342 |
MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt |
|
343 |
endif |
|
344 |
||
345 |
JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2sdk-image |
|
346 |
JRE_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-image |
|
347 |
||
348 |
#where the demo source can be found |
|
349 |
DEMOSRCDIR = $(SHARE_SRC)/demo |
|
350 |
||
351 |
# An attempt is made to generate unique enough directories for the |
|
352 |
# generated files to not have name collisisons. Most build units |
|
353 |
# defines PRODUCT (except Release.gmk), but then they may or may |
|
354 |
# not define PACKAGE, THREADIR (only HPI uses this), PROGRAM, and |
|
355 |
# LIBRARY. This code chunk attempts to generate a unique |
|
356 |
# OBJDIR/CLASSHDRDIR for each build unit based on which of those |
|
357 |
# values are set within each build unit. |
|
358 |
||
359 |
UNIQUE_LOCATION_STRING = tmp |
|
360 |
||
361 |
ifneq ($(PRODUCT),) |
|
362 |
UNIQUE_LOCATION_STRING += /$(PRODUCT) |
|
363 |
endif |
|
364 |
||
365 |
ifneq ($(PACKAGE),) |
|
366 |
UNIQUE_LOCATION_STRING += /$(PACKAGE) |
|
367 |
endif |
|
368 |
||
369 |
ifneq ($(PROGRAM),) |
|
370 |
UNIQUE_LOCATION_STRING += /$(PROGRAM) |
|
371 |
endif |
|
372 |
||
373 |
ifneq ($(LIBRARY),) |
|
374 |
ifneq ($(LIBRARY_OUTPUT),) |
|
375 |
UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT) |
|
376 |
else |
|
377 |
UNIQUE_LOCATION_STRING += /$(LIBRARY) |
|
378 |
endif |
|
379 |
endif |
|
380 |
||
381 |
ifneq ($(THREADDIR),) |
|
382 |
UNIQUE_LOCATION_STRING += /$(THREADDIR) |
|
383 |
endif |
|
384 |
||
385 |
# the use of += above makes a space separated list which we need to |
|
386 |
# remove for filespecs. |
|
387 |
# |
|
388 |
NULLSTRING := |
|
389 |
ONESPACE := $(NULLSTRING) # space before this comment is required. |
|
390 |
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING)) |
|
391 |
||
392 |
# TEMPDIR is a unique general purpose directory |
|
393 |
# need to use 'override' because GNU Make on Linux exports the wrong |
|
394 |
# value. |
|
395 |
override TEMPDIR = $(OUTPUTDIR)/$(UNIQUE_PATH) |
|
396 |
override ABS_TEMPDIR = $(ABS_OUTPUTDIR)/$(UNIQUE_PATH) |
|
397 |
||
398 |
# This must be created right away for pattern rules in Sanity.gmk to work. |
|
399 |
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR)) |
|
400 |
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK)) |
|
401 |
||
402 |
# OBJDIRNAME is the name of the directory where the object code is to |
|
403 |
# be placed. It's name depends on whether the data model architecture |
|
404 |
# is 32-bit or not. |
|
405 |
ifneq ($(ARCH_DATA_MODEL), 32) |
|
406 |
OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX) |
|
407 |
else |
|
408 |
OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX) |
|
409 |
endif |
|
410 |
OBJDIR = $(TEMPDIR)/$(OBJDIRNAME) |
|
411 |
||
412 |
# CLASSHDRDIR is where the generated C Class Header files go. |
|
413 |
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders |
|
414 |
||
415 |
# |
|
416 |
# CLASSDESTDIR can be used to specify the directory where generated classes |
|
417 |
# are to be placed. The default is CLASSBINDIR. |
|
418 |
# |
|
419 |
ifndef CLASSDESTDIR |
|
420 |
CLASSDESTDIR = $(CLASSBINDIR) |
|
421 |
endif |
|
422 |
||
423 |
INCLUDES = -I. -I$(CLASSHDRDIR) \ |
|
424 |
$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES) |
|
425 |
OTHER_CPPFLAGS = $(INCLUDES) |
|
426 |
||
427 |
||
428 |
# |
|
429 |
# vpaths. These are the default locations searched for source files. |
|
430 |
# GNUmakefiles of individual areas often override the default settings. |
|
431 |
# There are no longer default vpath entries for C and assembler files |
|
432 |
# so we can ensure that libraries don't get their hands on JVM files. |
|
433 |
# |
|
434 |
# We define an intermediate variable for Java files because |
|
435 |
# we use its value later to help define $SOURCEPATH |
|
436 |
||
437 |
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes |
|
438 |
ifdef OPENJDK |
|
439 |
VPATH.java = $(VPATH0.java) |
|
440 |
else |
|
441 |
# |
|
442 |
# If filenames are duplicated between open/closed workspaces, prefer |
|
443 |
# the closed files. |
|
444 |
# |
|
445 |
# Source ordering is important: some targets depend on closed files |
|
446 |
# replacing open ones, and thus the closed file sources must be found |
|
447 |
# before the open ones. |
|
448 |
# |
|
449 |
# Don't reorder without consulting the teams that depend on this behavior. |
|
450 |
# |
|
451 |
VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java) |
|
452 |
endif |
|
453 |
vpath %.java $(VPATH.java) |
|
454 |
vpath %.class $(CLASSBINDIR) |
|
455 |
vpath %.$(OBJECT_SUFFIX) $(OBJDIR) |
|
456 |
||
457 |
# |
|
458 |
# VPATH.h is used elsewhere to generate include flags. By default, |
|
459 |
# anyone has access to the include files that the JVM area exports, |
|
460 |
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific |
|
461 |
# relatives. |
|
462 |
# |
|
1090
c5805b1672a6
6732421: Removed old javavm and Classic VM files from the jdk7 sources
ohair
parents:
919
diff
changeset
|
463 |
VPATH.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export |
2 | 464 |
vpath %.h $(VPATH.h) |
465 |
||
466 |
# |
|
467 |
# Used in two ways: helps link against libjava.so. Also if overridden |
|
468 |
# determines where your shared library is installed. |
|
469 |
# |
|
470 |
ifndef LIB_LOCATION |
|
471 |
LIB_LOCATION = $(LIBDIR)/$(LIBARCH) |
|
472 |
endif |
|
473 |
||
474 |
# |
|
475 |
# Java header and stub variables |
|
476 |
# |
|
477 |
CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export))) |
|
478 |
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX) |
|
479 |
STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h |
|
480 |
||
481 |
# |
|
482 |
# Classpath seen by javac (different from the one seen by the VM |
|
483 |
# running javac), and useful variables. |
|
484 |
# |
|
485 |
SOURCEPATH = $(VPATH.java) |
|
486 |
PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)') |
|
487 |
PKGDIR = $(subst .,/,$(PACKAGE)) |
|
488 |
||
489 |
# |
|
490 |
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.) |
|
491 |
# |
|
492 |
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk |
|
493 |
||
494 |
# |
|
495 |
# Convenient macros |
|
496 |
# |
|
497 |
||
498 |
# Prepare $@ target, remove old one and making sure directory exists |
|
499 |
define prep-target |
|
500 |
$(MKDIR) -p $(@D) |
|
501 |
$(RM) $@ |
|
502 |
endef |
|
503 |
||
504 |
# Simple install of $< file to $@ |
|
505 |
define install-file |
|
506 |
$(prep-target) |
|
507 |
$(CP) $< $@ |
|
508 |
endef |
|
509 |
||
510 |
# Cleanup rule for after debug java run (hotspot.log file is left around) |
|
511 |
# (This could be an old leftover file in a read-only area, use the @- prefix) |
|
512 |
HOTSPOT_LOG_NAME = hotspot.log |
|
513 |
define java-vm-cleanup |
|
514 |
if [ -w $(HOTSPOT_LOG_NAME) ] ; then $(RM) $(HOTSPOT_LOG_NAME); fi |
|
515 |
endef |
|
516 |
||
517 |
# Default make settings for processing SUBDIRS with clobber or clean names |
|
518 |
SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false |
|
519 |
SUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false |
|
520 |
||
521 |
# Current directory |
|
522 |
CURRENT_DIRECTORY := $(shell $(PWD)) |
|
523 |
||
524 |
# If no timing wanted, we need to define these as empty |
|
525 |
ifdef NO_TIMING |
|
526 |
||
527 |
TIMING_ID:=NA |
|
528 |
||
529 |
define TIMING_start |
|
530 |
t=0:0:0:0 |
|
531 |
endef |
|
532 |
||
533 |
define TIMING_end |
|
534 |
time_used=0 |
|
535 |
endef |
|
536 |
||
537 |
else # NO_TIMING |
|
538 |
||
539 |
# Default timing id |
|
540 |
TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY)) |
|
541 |
||
542 |
# Timing start (must be used in same shell, e.g. same command line) |
|
543 |
# Defines the shell variable $1 to have the start time. |
|
544 |
define TIMING_start |
|
545 |
$1=`$(DATE) +%j:%H:%M:%S` |
|
546 |
endef |
|
547 |
||
548 |
# Timing end (must be used in same shell, e.g. same command line) |
|
549 |
# Expects shell variable $1 to have been defined as the start time. |
|
550 |
# Expects shell variable $2 to have timing id string |
|
551 |
# Sets total_seconds shell variable as the total seconds used. |
|
552 |
# Sets time_used shell variable to contain format "%dh%dm%ds" |
|
553 |
define TIMING_end |
|
554 |
begTime="$${$1}"; \ |
|
555 |
timing_id="$${$2}"; \ |
|
556 |
endTime=`$(DATE) +%j:%H:%M:%S`; \ |
|
557 |
d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ |
|
558 |
if [ "$${d1}" = "" ] ; then d1=0; fi; \ |
|
559 |
h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ |
|
560 |
if [ "$${h1}" = "" ] ; then h1=0; fi; \ |
|
561 |
m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ |
|
562 |
if [ "$${m1}" = "" ] ; then m1=0; fi; \ |
|
563 |
s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ |
|
564 |
if [ "$${s1}" = "" ] ; then s1=0; fi; \ |
|
565 |
d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ |
|
566 |
if [ "$${d2}" = "" ] ; then d2=0; fi; \ |
|
567 |
h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ |
|
568 |
if [ "$${h2}" = "" ] ; then h2=0; fi; \ |
|
569 |
m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ |
|
570 |
if [ "$${m2}" = "" ] ; then m2=0; fi; \ |
|
571 |
s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ |
|
572 |
if [ "$${s2}" = "" ] ; then s2=0; fi; \ |
|
573 |
t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \ |
|
574 |
'+' $${m1} '*' 60 '+' $${s1}`; \ |
|
575 |
t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \ |
|
576 |
'+' $${m2} '*' 60 '+' $${s2}`; \ |
|
577 |
total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \ |
|
578 |
if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \ |
|
579 |
t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \ |
|
580 |
t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \ |
|
581 |
t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \ |
|
582 |
time_used=$${t_sec}; \ |
|
583 |
if [ "$${t_hour}" != "0h" ] ; then \ |
|
584 |
time_used=$${t_hour}$${t_min}$${t_sec}; \ |
|
585 |
elif [ "$${t_min}" != "0m" ] ; then \ |
|
586 |
time_used=$${t_min}$${t_sec}; \ |
|
587 |
else \ |
|
588 |
time_used=$${t_sec}; \ |
|
589 |
fi; \ |
|
590 |
$(PRINTF) " Timing: %05d seconds or %s for %s\n" \ |
|
591 |
$${total_seconds} $${time_used} $${timing_id} |
|
592 |
endef |
|
593 |
||
594 |
endif # NO_TIMING |
|
595 |
||
596 |
# Given a SUBDIRS list, cd into them and make them |
|
597 |
# SUBDIRS_MAKEFLAGS Make settings for a subdir make |
|
598 |
# SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target |
|
599 |
define SUBDIRS-loop |
|
600 |
@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)" |
|
601 |
@for i in DUMMY $(SUBDIRS) ; do \ |
|
602 |
if [ "$$i" != "DUMMY" ] ; then \ |
|
603 |
$(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ |
|
604 |
timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ |
|
605 |
$(call TIMING_start,startTime); \ |
|
606 |
curDir=$(CURRENT_DIRECTORY); \ |
|
607 |
$(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ |
|
608 |
$(SUBDIRS_MAKEFLAGS) \ |
|
609 |
$(SUBDIRS_MAKEFLAGS-$@) \ |
|
610 |
FULL_VERSION=$(FULL_VERSION) \ |
|
611 |
RELEASE=$(RELEASE) || exit 1; \ |
|
612 |
$(CD) $${curDir}; \ |
|
613 |
$(call TIMING_end,startTime,timing_id); \ |
|
614 |
$(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \ |
|
615 |
fi ; \ |
|
616 |
done |
|
617 |
@$(ECHO) "Done Processing SUBDIRS: $(SUBDIRS)" |
|
618 |
endef |
|
619 |
||
620 |
# Given a OTHERSUBDIRS list, cd into them and make them (extra loop define) |
|
621 |
# OTHERSUBDIRS_MAKEFLAGS Make settings for a subdir make |
|
622 |
define OTHERSUBDIRS-loop |
|
623 |
@$(ECHO) "Begin Processing OTHERSUBDIRS: $(OTHERSUBDIRS)" |
|
624 |
@for i in DUMMY $(OTHERSUBDIRS) ; do \ |
|
625 |
if [ "$$i" != "DUMMY" ] ; then \ |
|
626 |
$(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ |
|
627 |
timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ |
|
628 |
$(call TIMING_start,startTime); \ |
|
629 |
curDir=$(CURRENT_DIRECTORY); \ |
|
630 |
$(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ |
|
631 |
$(OTHERSUBDIRS_MAKEFLAGS) \ |
|
632 |
FULL_VERSION=$(FULL_VERSION) \ |
|
633 |
RELEASE=$(RELEASE) || exit 1; \ |
|
634 |
$(CD) $${curDir}; \ |
|
635 |
$(call TIMING_end,startTime,timing_id); \ |
|
636 |
$(ECHO) "<<<Finished Recursively making "$$i" "$@" @ `$(DATE)`." ; \ |
|
637 |
fi ; \ |
|
638 |
done |
|
639 |
@$(ECHO) "Done Processing OTHERSUBDIRS: $(OTHERSUBDIRS)" |
|
640 |
endef |
|
641 |
||
642 |
# |
|
643 |
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is |
|
644 |
# used for this file, otherwise the default settings are used. |
|
645 |
# |
|
646 |
CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \ |
|
647 |
$(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F))) |
|
648 |
CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \ |
|
649 |
$(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F))) |
|
650 |
||
651 |
# |
|
652 |
# Tool flags |
|
653 |
# |
|
654 |
ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS) |
|
655 |
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) |
|
656 |
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) |
|
657 |
CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \ |
|
658 |
$(DEFINES) $(OPTIONS:%=-D%) |
|
659 |
LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS) |
|
660 |
LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON) |
|
661 |
LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \ |
|
662 |
$(OTHER_LINTFLAGS) |
|
663 |
||
664 |
# this should be moved into Defs-<platform>.gmk..... |
|
665 |
ifeq ($(PLATFORM), windows) |
|
666 |
VERSION_DEFINES = -DRELEASE="\"$(RELEASE)\"" |
|
667 |
else |
|
668 |
VERSION_DEFINES = -DRELEASE='"$(RELEASE)"' |
|
669 |
endif |
|
670 |
||
671 |
# Note: As a rule, GNU Make rules should not appear in any of the |
|
672 |
# Defs*.gmk files. These were added for Kestrel-Solaris and do address |
|
673 |
# a TeamWare bug. They should be moved elsewhere for Merlin. |
|
674 |
# |
|
675 |
# Override gnumake built-in rules which do sccs get operations badly. |
|
676 |
# (They put the checked out code in the current directory, not in the |
|
677 |
# directory of the original file.) |
|
678 |
# Since this is a symptom of a teamware failure, complain and die on the spot. |
|
679 |
||
680 |
# This message immediately goes to stdout and the build terminates. |
|
681 |
define SCCS-trouble |
|
682 |
$(error \ |
|
683 |
"ERROR: File $@ referenced while building in $(CURRENT_DIRECTORY) \ |
|
684 |
is out of date with respect to its SCCS file $<. \ |
|
685 |
This can happen from an unresolved Teamware conflict, a file movement, or \ |
|
686 |
a failure in which SCCS files are updated but the 'sccs get' was not done. \ |
|
687 |
You should double check for other out of date files in your workspace. \ |
|
688 |
Or run: cd $(TOPDIR) && $(MAKE) sccs_get") |
|
689 |
endef |
|
690 |
||
691 |
%:: s.% |
|
692 |
@$(SCCS-trouble) |
|
693 |
%:: SCCS/s.% |
|
694 |
@$(SCCS-trouble) |
|
695 |
@$(ECHO) " is out of date with respect to its SCCS file." >> $(WARNING_FILE) |
|
696 |
@$(ECHO) " This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE) |
|
697 |
@$(ECHO) " This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE) |
|
698 |
@$(ECHO) " in which SCCS files are updated but not checked out." >> $(WARNING_FILE) |
|
699 |
@$(ECHO) " Check for other out of date files in your workspace." >> $(WARNING_FILE) |
|
700 |
@$(ECHO) "" >> $(WARNING_FILE) |
|
701 |
@#exit 666 |
|
702 |
||
703 |
ifdef INSANE |
|
704 |
export INSANE |
|
705 |
endif |
|
706 |
||
707 |
ifdef ALT_COPYRIGHT_YEAR |
|
708 |
COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) |
|
709 |
else |
|
847 | 710 |
COPYRIGHT_YEAR := $(shell $(DATE) '+%Y') |
2 | 711 |
endif |
712 |
||
713 |
# Install of imported file (JDK_IMPORT_PATH, or some other external location) |
|
714 |
define install-import-file |
|
715 |
@$(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
|
716 |
$(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
|
717 |
$(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
|
718 |
@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
|
719 |
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
|
720 |
/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
|
721 |
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
|
722 |
$(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
|
723 |
/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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
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
|
728 |
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
|
729 |
fi |
2 | 730 |
endef |
731 |
||
732 |
.PHONY: all build clean clobber |