1 | #
|
---|
2 | # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
---|
3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
---|
4 | #
|
---|
5 | # This code is free software; you can redistribute it and/or modify it
|
---|
6 | # under the terms of the GNU General Public License version 2 only, as
|
---|
7 | # published by the Free Software Foundation.
|
---|
8 | #
|
---|
9 | # This code is distributed in the hope that it will be useful, but WITHOUT
|
---|
10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
---|
12 | # version 2 for more details (a copy is included in the LICENSE file that
|
---|
13 | # accompanied this code).
|
---|
14 | #
|
---|
15 | # You should have received a copy of the GNU General Public License version
|
---|
16 | # 2 along with this work; if not, write to the Free Software Foundation,
|
---|
17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
18 | #
|
---|
19 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
---|
20 | # or visit www.oracle.com if you need additional information or have any
|
---|
21 | # questions.
|
---|
22 | #
|
---|
23 | #
|
---|
24 |
|
---|
25 | # Top level gnumake file for hotspot builds
|
---|
26 | #
|
---|
27 | # Default is to build the both product images and construct an export dir.
|
---|
28 | # The default export directory name is `pwd`/export-$(PLATFORM).
|
---|
29 | #
|
---|
30 | # Use: 'gnumake help' for more information.
|
---|
31 | #
|
---|
32 | # This makefile uses the default settings for where to find compilers and
|
---|
33 | # tools, and obeys the ALT_* variable settings used by the other JDK
|
---|
34 | # workspaces.
|
---|
35 | #
|
---|
36 |
|
---|
37 | # Expected/optional make variables defined on make command line:
|
---|
38 | # LP64=1 or ARCH_DATA_MODEL=64 for 64bit build
|
---|
39 | #
|
---|
40 | # Expected/optional make variables or environment variables:
|
---|
41 | # ALT_SLASH_JAVA Location of /java or J:
|
---|
42 | # ALT_BOOTDIR Previous JDK home directory for javac compiler
|
---|
43 | # ALT_OUTPUTDIR Output directory to use for hotspot build
|
---|
44 | # ALT_EXPORT_PATH Directory to export hotspot build to
|
---|
45 | # ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules)
|
---|
46 | # ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
|
---|
47 | # Set ALT_BUILD_WIN_SA=1 to enable building SA on
|
---|
48 | # Windows.
|
---|
49 | # Version strings and numbers:
|
---|
50 | # JDK_VERSION Current JDK version (e.g. 1.6.0)
|
---|
51 | # PREVIOUS_JDK_VERSION Previous (bootdir) JDK version (e.g. 1.5.0)
|
---|
52 | # FULL_VERSION Full version string to use (e.g. "1.6.0-ea-b42")
|
---|
53 | #
|
---|
54 | # Version strings and numbers especially needed on Windows:
|
---|
55 | # COOKED_JDK_UPDATE_VERSION Just the update release number (e.g. 02)
|
---|
56 | # COOKED_BUILD_NUMBER Just the build number (e.g. 42)
|
---|
57 | # JDK_MKTG_VERSION Marketing JDK version (e.g. 6.0)
|
---|
58 | # JDK_MAJOR_VERSION Major number for version (e.g. 1) always 1?
|
---|
59 | # JDK_MINOR_VERSION Minor number for version (e.g. 6)
|
---|
60 | # JDK_MICRO_VERSION Micro number for version (e.g. 0)
|
---|
61 | #
|
---|
62 |
|
---|
63 | # Default is build both product fastdebug and create export area
|
---|
64 |
|
---|
65 | # Allow to build HotSpot in local directory from sources specified by GAMMADIR.
|
---|
66 | # After make/defs.make GAMMADIR is defined.
|
---|
67 | ifdef GAMMADIR
|
---|
68 | ifndef ALT_OUTPUTDIR
|
---|
69 | ALT_OUTPUTDIR := $(shell pwd)
|
---|
70 | endif
|
---|
71 | include $(GAMMADIR)/make/defs.make
|
---|
72 | else
|
---|
73 | include defs.make
|
---|
74 | endif
|
---|
75 |
|
---|
76 |
|
---|
77 | ifneq ($(ALT_OUTPUTDIR),)
|
---|
78 | ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
|
---|
79 | else
|
---|
80 | ALT_OUT=
|
---|
81 | endif
|
---|
82 |
|
---|
83 | # Typical C1/C2 targets made available with this Makefile
|
---|
84 | C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
|
---|
85 | C2_VM_TARGETS=product fastdebug optimized jvmg
|
---|
86 | KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
|
---|
87 | ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
|
---|
88 | SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
|
---|
89 |
|
---|
90 | # JDK directory list
|
---|
91 | JDK_DIRS=bin include jre lib demo
|
---|
92 |
|
---|
93 | all: all_product all_fastdebug
|
---|
94 | ifndef BUILD_CLIENT_ONLY
|
---|
95 | all_product: product product1 productkernel docs export_product
|
---|
96 | all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
|
---|
97 | all_debug: jvmg jvmg1 jvmgkernel docs export_debug
|
---|
98 | else
|
---|
99 | all_product: product1 docs export_product
|
---|
100 | all_fastdebug: fastdebug1 docs export_fastdebug
|
---|
101 | all_debug: jvmg1 docs export_debug
|
---|
102 | endif
|
---|
103 | all_optimized: optimized optimized1 optimizedkernel docs export_optimized
|
---|
104 |
|
---|
105 | allzero: all_productzero all_fastdebugzero
|
---|
106 | all_productzero: productzero docs export_product
|
---|
107 | all_fastdebugzero: fastdebugzero docs export_fastdebug
|
---|
108 | all_debugzero: jvmgzero docs export_debug
|
---|
109 | all_optimizedzero: optimizedzero docs export_optimized
|
---|
110 |
|
---|
111 | allshark: all_productshark all_fastdebugshark
|
---|
112 | all_productshark: productshark docs export_product
|
---|
113 | all_fastdebugshark: fastdebugshark docs export_fastdebug
|
---|
114 | all_debugshark: jvmgshark docs export_debug
|
---|
115 | all_optimizedshark: optimizedshark docs export_optimized
|
---|
116 |
|
---|
117 | # Do everything
|
---|
118 | world: all create_jdk
|
---|
119 |
|
---|
120 | # Build or export docs
|
---|
121 | docs:
|
---|
122 | ifeq ($(filter-out windows os2,$(OSNAME)),)
|
---|
123 | @$(ECHO) "No docs ($(VM_TARGET)) for windows/os2"
|
---|
124 | else
|
---|
125 | $(CD) $(OUTPUTDIR); \
|
---|
126 | $(MAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
127 | $(MAKE_ARGS) docs
|
---|
128 | endif
|
---|
129 |
|
---|
130 | # Build variation of hotspot
|
---|
131 | $(C1_VM_TARGETS):
|
---|
132 | $(CD) $(GAMMADIR)/make; \
|
---|
133 | $(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
|
---|
134 |
|
---|
135 | $(C2_VM_TARGETS):
|
---|
136 | $(CD) $(GAMMADIR)/make; \
|
---|
137 | $(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
|
---|
138 |
|
---|
139 | $(KERNEL_VM_TARGETS):
|
---|
140 | $(CD) $(GAMMADIR)/make; \
|
---|
141 | $(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
|
---|
142 |
|
---|
143 | $(ZERO_VM_TARGETS):
|
---|
144 | $(CD) $(GAMMADIR)/make; \
|
---|
145 | $(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
|
---|
146 |
|
---|
147 | $(SHARK_VM_TARGETS):
|
---|
148 | $(CD) $(GAMMADIR)/make; \
|
---|
149 | $(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
|
---|
150 |
|
---|
151 | # Build compiler1 (client) rule, different for platforms
|
---|
152 | generic_build1:
|
---|
153 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
154 | ifeq ($(filter-out windows os2,$(OSNAME)),)
|
---|
155 | ifeq ($(ARCH_DATA_MODEL), 32)
|
---|
156 | $(CD) $(OUTPUTDIR); \
|
---|
157 | $(NMAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
158 | Variant=compiler1 \
|
---|
159 | WorkSpace=$(ABS_GAMMADIR) \
|
---|
160 | BootStrapDir=$(ABS_BOOTDIR) \
|
---|
161 | BuildUser=$(USERNAME) \
|
---|
162 | $(MAKE_ARGS) $(VM_TARGET:%1=%)
|
---|
163 | else
|
---|
164 | @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
|
---|
165 | endif
|
---|
166 | else
|
---|
167 | ifeq ($(ARCH_DATA_MODEL), 32)
|
---|
168 | $(CD) $(OUTPUTDIR); \
|
---|
169 | $(MAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
170 | $(MAKE_ARGS) $(VM_TARGET)
|
---|
171 | else
|
---|
172 | @$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
|
---|
173 | endif
|
---|
174 | endif
|
---|
175 |
|
---|
176 | # Build compiler2 (server) rule, different for platforms
|
---|
177 | generic_build2:
|
---|
178 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
179 | ifeq ($(filter-out windows os2,$(OSNAME)),)
|
---|
180 | $(CD) $(OUTPUTDIR); \
|
---|
181 | $(NMAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
182 | Variant=compiler2 \
|
---|
183 | WorkSpace=$(ABS_GAMMADIR) \
|
---|
184 | BootStrapDir=$(ABS_BOOTDIR) \
|
---|
185 | BuildUser=$(USERNAME) \
|
---|
186 | $(MAKE_ARGS) $(VM_TARGET)
|
---|
187 | else
|
---|
188 | $(CD) $(OUTPUTDIR); \
|
---|
189 | $(MAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
190 | $(MAKE_ARGS) $(VM_TARGET)
|
---|
191 | endif
|
---|
192 |
|
---|
193 | generic_buildkernel:
|
---|
194 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
195 | ifeq ($(filter-out windows os2,$(OSNAME)),)
|
---|
196 | ifeq ($(ARCH_DATA_MODEL), 32)
|
---|
197 | $(CD) $(OUTPUTDIR); \
|
---|
198 | $(NMAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
199 | Variant=kernel \
|
---|
200 | WorkSpace=$(ABS_GAMMADIR) \
|
---|
201 | BootStrapDir=$(ABS_BOOTDIR) \
|
---|
202 | BuildUser=$(USERNAME) \
|
---|
203 | $(MAKE_ARGS) $(VM_TARGET:%kernel=%)
|
---|
204 | else
|
---|
205 | @$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
|
---|
206 | endif
|
---|
207 | else
|
---|
208 | @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
|
---|
209 | endif
|
---|
210 |
|
---|
211 | generic_buildzero:
|
---|
212 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
213 | $(CD) $(OUTPUTDIR); \
|
---|
214 | $(MAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
215 | $(MAKE_ARGS) $(VM_TARGET)
|
---|
216 |
|
---|
217 | generic_buildshark:
|
---|
218 | $(MKDIR) -p $(OUTPUTDIR)
|
---|
219 | $(CD) $(OUTPUTDIR); \
|
---|
220 | $(MAKE) -f $(ABS_OS_MAKEFILE) \
|
---|
221 | $(MAKE_ARGS) $(VM_TARGET)
|
---|
222 |
|
---|
223 | # Export file rule
|
---|
224 | generic_export: $(EXPORT_LIST)
|
---|
225 | export_product:
|
---|
226 | $(MAKE) VM_SUBDIR=product generic_export
|
---|
227 | export_fastdebug:
|
---|
228 | $(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
|
---|
229 | export_debug:
|
---|
230 | $(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug generic_export
|
---|
231 | export_optimized:
|
---|
232 | $(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
|
---|
233 | export_product_jdk:
|
---|
234 | $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
|
---|
235 | VM_SUBDIR=product generic_export
|
---|
236 | export_optimized_jdk:
|
---|
237 | $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
|
---|
238 | VM_SUBDIR=optimized generic_export
|
---|
239 | export_fastdebug_jdk:
|
---|
240 | $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
|
---|
241 | VM_SUBDIR=fastdebug generic_export
|
---|
242 | export_debug_jdk:
|
---|
243 | $(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
|
---|
244 | VM_SUBDIR=${VM_DEBUG} generic_export
|
---|
245 |
|
---|
246 |
|
---|
247 | # Export file copy rules
|
---|
248 | XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
|
---|
249 | DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
|
---|
250 | C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
|
---|
251 | C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
|
---|
252 | KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
|
---|
253 | ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
|
---|
254 | SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
|
---|
255 | C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
|
---|
256 | C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
|
---|
257 | KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
|
---|
258 | ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
|
---|
259 | SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
|
---|
260 |
|
---|
261 | # Misc files and generated files need to come from C1 or C2 area
|
---|
262 | ifeq ($(ZERO_BUILD), true)
|
---|
263 | ifeq ($(SHARK_BUILD), true)
|
---|
264 | MISC_DIR=$(SHARK_DIR)
|
---|
265 | GEN_DIR=$(SHARK_BASE_DIR)/generated
|
---|
266 | else
|
---|
267 | MISC_DIR=$(ZERO_DIR)
|
---|
268 | GEN_DIR=$(ZERO_BASE_DIR)/generated
|
---|
269 | endif
|
---|
270 | else
|
---|
271 | ifeq ($(ARCH_DATA_MODEL), 32)
|
---|
272 | MISC_DIR=$(C1_DIR)
|
---|
273 | GEN_DIR=$(C1_BASE_DIR)/generated
|
---|
274 | else
|
---|
275 | MISC_DIR=$(C2_DIR)
|
---|
276 | GEN_DIR=$(C2_BASE_DIR)/generated
|
---|
277 | endif
|
---|
278 | endif
|
---|
279 |
|
---|
280 | # Bin files (windows, os2)
|
---|
281 | ifeq ($(filter-out windows os2,$(OSNAME)),)
|
---|
282 |
|
---|
283 | # Get jvm.lib
|
---|
284 | $(EXPORT_LIB_DIR)/%.lib: $(MISC_DIR)/%.lib
|
---|
285 | $(install-file)
|
---|
286 |
|
---|
287 | # Other libraries (like SA)
|
---|
288 | $(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
|
---|
289 | $(install-file)
|
---|
290 | ifneq ($(OSNAME),os2)
|
---|
291 | $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
|
---|
292 | $(install-file)
|
---|
293 | endif
|
---|
294 | $(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
|
---|
295 | $(install-file)
|
---|
296 |
|
---|
297 | # Client files always come from C1 area
|
---|
298 | $(EXPORT_CLIENT_DIR)/%.dll: $(C1_DIR)/%.dll
|
---|
299 | $(install-file)
|
---|
300 | ifneq ($(OSNAME),os2)
|
---|
301 | $(EXPORT_CLIENT_DIR)/%.pdb: $(C1_DIR)/%.pdb
|
---|
302 | $(install-file)
|
---|
303 | endif
|
---|
304 | $(EXPORT_CLIENT_DIR)/%.map: $(C1_DIR)/%.map
|
---|
305 | $(install-file)
|
---|
306 |
|
---|
307 | # Server files always come from C2 area
|
---|
308 | $(EXPORT_SERVER_DIR)/%.dll: $(C2_DIR)/%.dll
|
---|
309 | $(install-file)
|
---|
310 | ifneq ($(OSNAME),os2)
|
---|
311 | $(EXPORT_SERVER_DIR)/%.pdb: $(C2_DIR)/%.pdb
|
---|
312 | $(install-file)
|
---|
313 | endif
|
---|
314 | $(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map
|
---|
315 | $(install-file)
|
---|
316 |
|
---|
317 | # Kernel files always come from kernel area
|
---|
318 | $(EXPORT_KERNEL_DIR)/%.dll: $(KERNEL_DIR)/%.dll
|
---|
319 | $(install-file)
|
---|
320 | ifneq ($(OSNAME),os2)
|
---|
321 | $(EXPORT_KERNEL_DIR)/%.pdb: $(KERNEL_DIR)/%.pdb
|
---|
322 | $(install-file)
|
---|
323 | endif
|
---|
324 | $(EXPORT_KERNEL_DIR)/%.map: $(KERNEL_DIR)/%.map
|
---|
325 | $(install-file)
|
---|
326 | endif
|
---|
327 |
|
---|
328 | # Shared Library
|
---|
329 | ifneq ($(filter-out windows os2,$(OSNAME)),)
|
---|
330 | ifeq ($(ZERO_BUILD), true)
|
---|
331 | ifeq ($(SHARK_BUILD), true)
|
---|
332 | $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
|
---|
333 | $(install-file)
|
---|
334 | $(EXPORT_SERVER_DIR)/%.so: $(SHARK_DIR)/%.so
|
---|
335 | $(install-file)
|
---|
336 | else
|
---|
337 | $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
|
---|
338 | $(install-file)
|
---|
339 | $(EXPORT_SERVER_DIR)/%.so: $(ZERO_DIR)/%.so
|
---|
340 | $(install-file)
|
---|
341 | endif
|
---|
342 | else
|
---|
343 | $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
|
---|
344 | $(install-file)
|
---|
345 | $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
|
---|
346 | $(install-file)
|
---|
347 | $(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
|
---|
348 | $(install-file)
|
---|
349 | $(EXPORT_CLIENT_DIR)/64/%.so: $(C1_DIR)/%.so
|
---|
350 | $(install-file)
|
---|
351 | $(EXPORT_SERVER_DIR)/%.so: $(C2_DIR)/%.so
|
---|
352 | $(install-file)
|
---|
353 | $(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
|
---|
354 | $(install-file)
|
---|
355 | endif
|
---|
356 | endif
|
---|
357 |
|
---|
358 | # Jar file (sa-jdi.jar)
|
---|
359 | $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
|
---|
360 | $(install-file)
|
---|
361 |
|
---|
362 | # Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
|
---|
363 | $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
|
---|
364 | $(install-file)
|
---|
365 |
|
---|
366 | $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
|
---|
367 | $(install-file)
|
---|
368 |
|
---|
369 | $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
|
---|
370 | $(install-file)
|
---|
371 |
|
---|
372 | $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h
|
---|
373 | $(install-file)
|
---|
374 |
|
---|
375 | $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
|
---|
376 | $(install-file)
|
---|
377 |
|
---|
378 | # Doc files (jvmti.html)
|
---|
379 | $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
|
---|
380 | $(install-file)
|
---|
381 |
|
---|
382 | # Xusage file
|
---|
383 | $(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
|
---|
384 | $(prep-target)
|
---|
385 | $(RM) $@.temp
|
---|
386 | $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
|
---|
387 | $(MV) $@.temp $@
|
---|
388 |
|
---|
389 | #
|
---|
390 | # Clean rules
|
---|
391 | #
|
---|
392 | clobber clean: clean_build clean_export clean_jdk
|
---|
393 | clean_build:
|
---|
394 | $(RM) -r $(C1_DIR)
|
---|
395 | $(RM) -r $(C2_DIR)
|
---|
396 | $(RM) -r $(KERNEL_DIR)
|
---|
397 | $(RM) -r $(ZERO_DIR)
|
---|
398 | $(RM) -r $(SHARK_DIR)
|
---|
399 | clean_export:
|
---|
400 | $(RM) -r $(EXPORT_PATH)
|
---|
401 | clean_jdk:
|
---|
402 | $(RM) -r $(JDK_IMAGE_DIR)
|
---|
403 |
|
---|
404 | #
|
---|
405 | # Create JDK and place this build into it
|
---|
406 | #
|
---|
407 | create_jdk: copy_jdk update_jdk
|
---|
408 |
|
---|
409 | update_jdk: export_product_jdk export_fastdebug_jdk test_jdk
|
---|
410 |
|
---|
411 | copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar
|
---|
412 |
|
---|
413 | $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
|
---|
414 | $(RM) -r $(JDK_IMAGE_DIR)
|
---|
415 | $(MKDIR) -p $(JDK_IMAGE_DIR)
|
---|
416 | ($(CD) $(JDK_IMPORT_PATH) && \
|
---|
417 | $(TAR) -cf - *) | \
|
---|
418 | ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
|
---|
419 |
|
---|
420 | test_jdk:
|
---|
421 | ifneq ($(ZERO_BUILD), true)
|
---|
422 | ifeq ($(ARCH_DATA_MODEL), 32)
|
---|
423 | $(JDK_IMAGE_DIR)/bin/java -client -version
|
---|
424 | endif
|
---|
425 | endif
|
---|
426 | $(JDK_IMAGE_DIR)/bin/java -server -version
|
---|
427 |
|
---|
428 | copy_product_jdk:
|
---|
429 | $(RM) -r $(JDK_IMAGE_DIR)
|
---|
430 | $(MKDIR) -p $(JDK_IMAGE_DIR)
|
---|
431 | ($(CD) $(JDK_IMPORT_PATH) && \
|
---|
432 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
433 | ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
|
---|
434 |
|
---|
435 | copy_fastdebug_jdk:
|
---|
436 | $(RM) -r $(JDK_IMAGE_DIR)/fastdebug
|
---|
437 | $(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
|
---|
438 | if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
|
---|
439 | ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
|
---|
440 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
441 | ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
|
---|
442 | else \
|
---|
443 | ($(CD) $(JDK_IMPORT_PATH) && \
|
---|
444 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
445 | ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
|
---|
446 | fi
|
---|
447 |
|
---|
448 | copy_debug_jdk:
|
---|
449 | $(RM) -r $(JDK_IMAGE_DIR)/debug
|
---|
450 | $(MKDIR) -p $(JDK_IMAGE_DIR)/debug
|
---|
451 | if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
|
---|
452 | ($(CD) $(JDK_IMPORT_PATH)/debug && \
|
---|
453 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
454 | ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
|
---|
455 | elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
|
---|
456 | ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
|
---|
457 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
458 | ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
|
---|
459 | else \
|
---|
460 | ($(CD) $(JDK_IMPORT_PATH) && \
|
---|
461 | $(TAR) -cf - $(JDK_DIRS)) | \
|
---|
462 | ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
|
---|
463 | fi
|
---|
464 |
|
---|
465 | #
|
---|
466 | # Check target
|
---|
467 | #
|
---|
468 | check: variable_check
|
---|
469 |
|
---|
470 | #
|
---|
471 | # Help target
|
---|
472 | #
|
---|
473 | help: intro_help target_help variable_help notes_help examples_help
|
---|
474 |
|
---|
475 | # Intro help message
|
---|
476 | intro_help:
|
---|
477 | @$(ECHO) \
|
---|
478 | "Makefile for the Hotspot workspace."
|
---|
479 | @$(ECHO) \
|
---|
480 | "Default behavior is to build and create an export area for the j2se builds."
|
---|
481 |
|
---|
482 | # Target help
|
---|
483 | target_help:
|
---|
484 | @$(ECHO) "help: This help message"
|
---|
485 | @$(ECHO) "all: Same as: all_product all_fastdebug"
|
---|
486 | @$(ECHO) "world: Same as: all create_jdk"
|
---|
487 | @$(ECHO) "all_product: Same as: product product1 export_product"
|
---|
488 | @$(ECHO) "all_fastdebug: Same as: fastdebug fastdebug1 export_fastdebug"
|
---|
489 | @$(ECHO) "all_debug: Same as: jvmg jvmg1 export_debug"
|
---|
490 | @$(ECHO) "all_optimized: Same as: optimized optimized1 export_optimized"
|
---|
491 | @$(ECHO) "clean: Clean all areas"
|
---|
492 | @$(ECHO) "export_product: Export product files to EXPORT_PATH"
|
---|
493 | @$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
|
---|
494 | @$(ECHO) "export_debug: Export debug files to EXPORT_PATH"
|
---|
495 | @$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
|
---|
496 | @$(ECHO) "create_jdk: Create JDK image, export all files into it"
|
---|
497 | @$(ECHO) "update_jdk: Update JDK image with fresh exported files"
|
---|
498 | @$(ECHO) " "
|
---|
499 | @$(ECHO) "Others targets are:"
|
---|
500 | @$(ECHO) " $(C1_VM_TARGETS)"
|
---|
501 | @$(ECHO) " $(C2_VM_TARGETS)"
|
---|
502 | @$(ECHO) " $(KERNEL_VM_TARGETS)"
|
---|
503 |
|
---|
504 | # Variable help (only common ones used by this workspace)
|
---|
505 | variable_help: variable_help_intro variable_list variable_help_end
|
---|
506 | variable_help_intro:
|
---|
507 | @$(ECHO) "--- Common Variables ---"
|
---|
508 | variable_help_end:
|
---|
509 | @$(ECHO) " "
|
---|
510 | @$(ECHO) "--- Make Arguments ---"
|
---|
511 | @$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"
|
---|
512 |
|
---|
513 | # One line descriptions for the variables
|
---|
514 | SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
|
---|
515 | OUTPUTDIR.desc = Output directory, default is build/<osname>
|
---|
516 | BOOTDIR.desc = JDK used to compile agent java source and test with
|
---|
517 | JDK_IMPORT_PATH.desc = Promoted JDK to copy for 'create_jdk'
|
---|
518 | EXPORT_PATH.desc = Directory to place files to export for JDK build
|
---|
519 |
|
---|
520 | # Make variables to print out (description and value)
|
---|
521 | VARIABLE_PRINTVAL_LIST += \
|
---|
522 | SLASH_JAVA \
|
---|
523 | OUTPUTDIR \
|
---|
524 | BOOTDIR \
|
---|
525 | JDK_IMPORT_PATH \
|
---|
526 | EXPORT_PATH
|
---|
527 |
|
---|
528 | # Make variables that should refer to directories that exist
|
---|
529 | VARIABLE_CHECKDIR_LIST += \
|
---|
530 | SLASH_JAVA \
|
---|
531 | BOOTDIR \
|
---|
532 | JDK_IMPORT_PATH
|
---|
533 |
|
---|
534 | # For pattern rules below, so all are treated the same
|
---|
535 | DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
|
---|
536 | DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
|
---|
537 |
|
---|
538 | # Complete variable check
|
---|
539 | variable_check: $(DO_CHECKDIR_LIST)
|
---|
540 | variable_list: $(DO_PRINTVAL_LIST) variable_check
|
---|
541 |
|
---|
542 | # Pattern rule for printing out a variable
|
---|
543 | %.printval:
|
---|
544 | @$(ECHO) " ALT_$* - $($*.desc)"
|
---|
545 | @$(ECHO) " $*=$($*)"
|
---|
546 |
|
---|
547 | # Pattern rule for checking to see if a variable with a directory exists
|
---|
548 | %.checkdir:
|
---|
549 | @if [ ! -d $($*) ] ; then \
|
---|
550 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
|
---|
551 | fi
|
---|
552 |
|
---|
553 | # Pattern rule for checking to see if a variable with a file exists
|
---|
554 | %.checkfil:
|
---|
555 | @if [ ! -f $($*) ] ; then \
|
---|
556 | $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
|
---|
557 | fi
|
---|
558 |
|
---|
559 | # Misc notes on help
|
---|
560 | notes_help:
|
---|
561 | @$(ECHO) \
|
---|
562 | "--- Notes --- "
|
---|
563 | @$(ECHO) \
|
---|
564 | "- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
|
---|
565 | @$(ECHO) \
|
---|
566 | " builds or previous release JDK builds will work."
|
---|
567 | @$(ECHO) \
|
---|
568 | "- The fastest builds have been when the workspace and the BOOTDIR are on"
|
---|
569 | @$(ECHO) \
|
---|
570 | " local disk."
|
---|
571 |
|
---|
572 | examples_help:
|
---|
573 | @$(ECHO) \
|
---|
574 | "--- Examples --- "
|
---|
575 | @$(ECHO) \
|
---|
576 | " $(MAKE) all"
|
---|
577 | @$(ECHO) \
|
---|
578 | " $(MAKE) world"
|
---|
579 | @$(ECHO) \
|
---|
580 | " $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)"
|
---|
581 | @$(ECHO) \
|
---|
582 | " $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"
|
---|
583 |
|
---|
584 | # JPRT rule to build this workspace
|
---|
585 | include $(GAMMADIR)/make/jprt.gmk
|
---|
586 |
|
---|
587 | .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
|
---|
588 | $(KERNEL_VM_TARGETS) \
|
---|
589 | generic_build1 generic_build2 generic_buildkernel generic_export \
|
---|
590 | export_product export_fastdebug export_debug export_optimized \
|
---|
591 | export_jdk_product export_jdk_fastdebug export_jdk_debug \
|
---|
592 | create_jdk copy_jdk update_jdk test_jdk \
|
---|
593 | copy_product_jdk copy_fastdebug_jdk copy_debug_jdk
|
---|
594 |
|
---|