make/Makefile

Fri, 16 Sep 2011 16:21:20 -0700

author
dcubed
date
Fri, 16 Sep 2011 16:21:20 -0700
changeset 3150
da0999c4b733
parent 2544
b76d12f4ab2d
child 3162
5d871c1ff17c
permissions
-rw-r--r--

7071904: 4/4 HotSpot: Full Debug Symbols
Summary: Add support for .debuginfo files for HSX libraries.
Reviewed-by: poonam, dholmes, never

     1 #
     2 # Copyright (c) 2005, 2011, 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 #
    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 #
    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_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling
    47 #  ALT_BUILD_WIN_SA           Building SA on Windows is disabled by default.
    48 #                             Set ALT_BUILD_WIN_SA=1 to enable building SA on
    49 #                             Windows.
    50 # Version strings and numbers:
    51 #  JDK_VERSION                Current JDK version (e.g. 1.6.0)
    52 #  PREVIOUS_JDK_VERSION       Previous (bootdir) JDK version (e.g. 1.5.0)
    53 #  FULL_VERSION               Full version string to use (e.g. "1.6.0-ea-b42")
    54 #
    55 # Version strings and numbers especially needed on Windows:
    56 #  COOKED_JDK_UPDATE_VERSION  Just the update release number (e.g. 02)
    57 #  COOKED_BUILD_NUMBER        Just the build number (e.g. 42)
    58 #  JDK_MKTG_VERSION           Marketing JDK version (e.g. 6.0)
    59 #  JDK_MAJOR_VERSION          Major number for version (e.g. 1) always 1?
    60 #  JDK_MINOR_VERSION          Minor number for version (e.g. 6)
    61 #  JDK_MICRO_VERSION          Micro number for version (e.g. 0)
    62 #
    64 # Default is build both product fastdebug and create export area
    66 # Allow to build HotSpot in local directory from sources specified by GAMMADIR.
    67 # After make/defs.make GAMMADIR is defined.
    68 ifdef GAMMADIR
    69   ifndef ALT_OUTPUTDIR
    70     ALT_OUTPUTDIR := $(shell pwd)
    71   endif
    72   include $(GAMMADIR)/make/defs.make
    73 else
    74   include defs.make
    75 endif
    77 include $(GAMMADIR)/make/altsrc.make
    79 ifneq ($(ALT_OUTPUTDIR),)
    80   ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
    81 else
    82   ALT_OUT=
    83 endif
    85 # Typical C1/C2 targets made available with this Makefile
    86 C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
    87 C2_VM_TARGETS=product  fastdebug  optimized  jvmg
    88 KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
    89 ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
    90 SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
    92 # JDK directory list
    93 JDK_DIRS=bin include jre lib demo
    95 all:           all_product all_fastdebug
    96 ifndef BUILD_CLIENT_ONLY
    97 all_product:   product product1 productkernel docs export_product
    98 all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
    99 all_debug:     jvmg jvmg1 jvmgkernel docs export_debug
   100 else
   101 all_product:   product1 docs export_product
   102 all_fastdebug: fastdebug1 docs export_fastdebug
   103 all_debug:     jvmg1 docs export_debug
   104 endif
   105 all_optimized: optimized optimized1 optimizedkernel docs export_optimized
   107 allzero:           all_productzero all_fastdebugzero
   108 all_productzero:   productzero docs export_product
   109 all_fastdebugzero: fastdebugzero docs export_fastdebug
   110 all_debugzero:     jvmgzero docs export_debug
   111 all_optimizedzero: optimizedzero docs export_optimized
   113 allshark:           all_productshark all_fastdebugshark
   114 all_productshark:   productshark docs export_product
   115 all_fastdebugshark: fastdebugshark docs export_fastdebug
   116 all_debugshark:     jvmgshark docs export_debug
   117 all_optimizedshark: optimizedshark docs export_optimized
   119 # Do everything
   120 world:         all create_jdk
   122 # Build or export docs
   123 docs:
   124 ifeq ($(OSNAME),windows)
   125 	@$(ECHO) "No docs ($(VM_TARGET)) for windows"
   126 else
   127 	$(CD) $(OUTPUTDIR); \
   128 	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
   129 		      $(MAKE_ARGS) docs
   130 endif
   132 # Build variation of hotspot
   133 $(C1_VM_TARGETS):
   134 	$(CD) $(GAMMADIR)/make; \
   135 	$(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
   137 $(C2_VM_TARGETS):
   138 	$(CD) $(GAMMADIR)/make; \
   139 	$(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
   141 $(KERNEL_VM_TARGETS):
   142 	$(CD) $(GAMMADIR)/make; \
   143 	$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
   145 $(ZERO_VM_TARGETS):
   146 	$(CD) $(GAMMADIR)/make; \
   147 	$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
   149 $(SHARK_VM_TARGETS):
   150 	$(CD) $(GAMMADIR)/make; \
   151 	$(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
   153 # Build compiler1 (client) rule, different for platforms
   154 generic_build1:
   155 	$(MKDIR) -p $(OUTPUTDIR)
   156 ifeq ($(OSNAME),windows)
   157   ifeq ($(ARCH_DATA_MODEL), 32)
   158 	$(CD) $(OUTPUTDIR); \
   159 	    $(NMAKE) -f $(ABS_OS_MAKEFILE) \
   160 		      Variant=compiler1 \
   161                       WorkSpace=$(ABS_GAMMADIR) \
   162 		      BootStrapDir=$(ABS_BOOTDIR) \
   163                       BuildUser=$(USERNAME) \
   164 		      $(MAKE_ARGS) $(VM_TARGET:%1=%)
   165   else
   166 	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
   167   endif
   168 else
   169   ifeq ($(ARCH_DATA_MODEL), 32)
   170 	$(CD) $(OUTPUTDIR); \
   171 	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
   172 		      $(MAKE_ARGS) $(VM_TARGET)
   173   else
   174 	@$(ECHO) "No compiler1 ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
   175   endif
   176 endif
   178 # Build compiler2 (server) rule, different for platforms
   179 generic_build2:
   180 	$(MKDIR) -p $(OUTPUTDIR)
   181 ifeq ($(OSNAME),windows)
   182 	$(CD) $(OUTPUTDIR); \
   183 	    $(NMAKE) -f $(ABS_OS_MAKEFILE) \
   184 		      Variant=compiler2 \
   185                       WorkSpace=$(ABS_GAMMADIR) \
   186 		      BootStrapDir=$(ABS_BOOTDIR) \
   187                       BuildUser=$(USERNAME) \
   188 		      $(MAKE_ARGS) $(VM_TARGET)
   189 else
   190 	$(CD) $(OUTPUTDIR); \
   191 	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
   192 		      $(MAKE_ARGS) $(VM_TARGET)
   193 endif
   195 generic_buildkernel:
   196 	$(MKDIR) -p $(OUTPUTDIR)
   197 ifeq ($(OSNAME),windows)
   198   ifeq ($(ARCH_DATA_MODEL), 32)
   199 	$(CD) $(OUTPUTDIR); \
   200 	    $(NMAKE) -f $(ABS_OS_MAKEFILE) \
   201 		      Variant=kernel \
   202                       WorkSpace=$(ABS_GAMMADIR) \
   203 		      BootStrapDir=$(ABS_BOOTDIR) \
   204                       BuildUser=$(USERNAME) \
   205 		      $(MAKE_ARGS) $(VM_TARGET:%kernel=%)
   206   else
   207 	@$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
   208   endif
   209 else
   210 	@$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
   211 endif
   213 generic_buildzero:
   214 	$(MKDIR) -p $(OUTPUTDIR)
   215 	$(CD) $(OUTPUTDIR); \
   216 		$(MAKE) -f $(ABS_OS_MAKEFILE) \
   217 			$(MAKE_ARGS) $(VM_TARGET)
   219 generic_buildshark:
   220 	$(MKDIR) -p $(OUTPUTDIR)
   221 	$(CD) $(OUTPUTDIR); \
   222 		$(MAKE) -f $(ABS_OS_MAKEFILE) \
   223 			$(MAKE_ARGS) $(VM_TARGET) 
   225 # Export file rule
   226 generic_export: $(EXPORT_LIST)
   227 export_product:
   228 	$(MAKE) VM_SUBDIR=product                            generic_export
   229 export_fastdebug:
   230 	$(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
   231 export_debug:
   232 	$(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug   generic_export
   233 export_optimized:
   234 	$(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
   235 export_product_jdk:
   236 	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
   237 		VM_SUBDIR=product                            generic_export
   238 export_optimized_jdk:
   239 	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
   240 		VM_SUBDIR=optimized                          generic_export
   241 export_fastdebug_jdk:
   242 	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
   243 		VM_SUBDIR=fastdebug                          generic_export
   244 export_debug_jdk:
   245 	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
   246 		VM_SUBDIR=${VM_DEBUG}                        generic_export
   249 # Export file copy rules
   250 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
   251 DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
   252 C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
   253 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
   254 KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
   255 ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
   256 SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark
   257 C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
   258 C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
   259 KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
   260 ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
   261 SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
   263 # Misc files and generated files need to come from C1 or C2 area
   264 ifeq ($(ZERO_BUILD), true)
   265 ifeq ($(SHARK_BUILD), true)
   266   MISC_DIR=$(SHARK_DIR)
   267   GEN_DIR=$(SHARK_BASE_DIR)/generated
   268 else
   269   MISC_DIR=$(ZERO_DIR)
   270   GEN_DIR=$(ZERO_BASE_DIR)/generated
   271 endif
   272 else
   273 ifeq ($(ARCH_DATA_MODEL), 32)
   274   MISC_DIR=$(C1_DIR)
   275   GEN_DIR=$(C1_BASE_DIR)/generated
   276 else
   277   MISC_DIR=$(C2_DIR)
   278   GEN_DIR=$(C2_BASE_DIR)/generated
   279 endif
   280 endif
   282 # Bin files (windows)
   283 ifeq ($(OSNAME),windows)
   285 # Get jvm.lib 
   286 $(EXPORT_LIB_DIR)/%.lib:  $(MISC_DIR)/%.lib
   287 	$(install-file)
   289 # Other libraries (like SA)
   290 $(EXPORT_JRE_BIN_DIR)/%.dll: $(MISC_DIR)/%.dll
   291 	$(install-file)
   292 $(EXPORT_JRE_BIN_DIR)/%.pdb: $(MISC_DIR)/%.pdb
   293 	$(install-file)
   294 $(EXPORT_JRE_BIN_DIR)/%.map: $(MISC_DIR)/%.map
   295 	$(install-file)
   297 # Client files always come from C1 area
   298 $(EXPORT_CLIENT_DIR)/%.dll:  $(C1_DIR)/%.dll
   299 	$(install-file)
   300 $(EXPORT_CLIENT_DIR)/%.pdb:  $(C1_DIR)/%.pdb
   301 	$(install-file)
   302 $(EXPORT_CLIENT_DIR)/%.map:  $(C1_DIR)/%.map
   303 	$(install-file)
   305 # Server files always come from C2 area
   306 $(EXPORT_SERVER_DIR)/%.dll:  $(C2_DIR)/%.dll
   307 	$(install-file)
   308 $(EXPORT_SERVER_DIR)/%.pdb:  $(C2_DIR)/%.pdb
   309 	$(install-file)
   310 $(EXPORT_SERVER_DIR)/%.map:  $(C2_DIR)/%.map
   311 	$(install-file)
   313 # Kernel files always come from kernel area
   314 $(EXPORT_KERNEL_DIR)/%.dll:  $(KERNEL_DIR)/%.dll
   315 	$(install-file)
   316 $(EXPORT_KERNEL_DIR)/%.pdb:  $(KERNEL_DIR)/%.pdb
   317 	$(install-file)
   318 $(EXPORT_KERNEL_DIR)/%.map:  $(KERNEL_DIR)/%.map
   319 	$(install-file)
   320 endif
   322 # Shared Library
   323 ifneq ($(OSNAME),windows)
   324   ifeq ($(ZERO_BUILD), true)
   325     ifeq ($(SHARK_BUILD), true)
   326 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(SHARK_DIR)/%.so
   327 	$(install-file)
   328 $(EXPORT_SERVER_DIR)/%.so:       $(SHARK_DIR)/%.so
   329 	$(install-file)
   330     else
   331 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
   332 	$(install-file)
   333 $(EXPORT_SERVER_DIR)/%.so:       $(ZERO_DIR)/%.so
   334 	$(install-file)
   335     endif
   336   else
   337 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
   338 	$(install-file)
   339 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
   340 	$(install-file)
   341 $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
   342 	$(install-file)
   343 $(EXPORT_CLIENT_DIR)/64/%.so:    $(C1_DIR)/%.so
   344 	$(install-file)
   345 $(EXPORT_SERVER_DIR)/%.so:       $(C2_DIR)/%.so
   346 	$(install-file)
   347 $(EXPORT_SERVER_DIR)/64/%.so:    $(C2_DIR)/%.so
   348 	$(install-file)
   350 # Debug info for shared library
   351 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C1_DIR)/%.debuginfo
   352 	$(install-file)
   353 $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(C2_DIR)/%.debuginfo
   354 	$(install-file)
   355 $(EXPORT_CLIENT_DIR)/%.debuginfo:       $(C1_DIR)/%.debuginfo
   356 	$(install-file)
   357 $(EXPORT_CLIENT_DIR)/64/%.debuginfo:    $(C1_DIR)/%.debuginfo
   358 	$(install-file)
   359 $(EXPORT_SERVER_DIR)/%.debuginfo:       $(C2_DIR)/%.debuginfo
   360 	$(install-file)
   361 $(EXPORT_SERVER_DIR)/64/%.debuginfo:    $(C2_DIR)/%.debuginfo
   362 	$(install-file)
   363   endif
   364 endif
   366 # Jar file (sa-jdi.jar)
   367 $(EXPORT_LIB_DIR)/%.jar: $(GEN_DIR)/%.jar
   368 	$(install-file)
   370 # Include files (jvmti.h, jvmticmlr.h, jni.h, $(JDK_INCLUDE_SUBDIR)/jni_md.h, jmm.h)
   371 $(EXPORT_INCLUDE_DIR)/%: $(GEN_DIR)/jvmtifiles/%
   372 	$(install-file)
   374 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/%
   375 	$(install-file)
   377 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
   378 	$(install-file)
   380 HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h)
   381 $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
   382 	$(install-file)
   384 $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
   385 	$(install-file)
   387 # Doc files (jvmti.html)
   388 $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
   389 	$(install-file)
   391 # Xusage file
   392 $(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
   393 	$(prep-target)
   394 	$(RM) $@.temp
   395 	$(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
   396 	$(MV) $@.temp $@
   398 #
   399 # Clean rules
   400 #
   401 clobber clean: clean_build clean_export clean_jdk
   402 clean_build:
   403 	$(RM) -r $(C1_DIR)
   404 	$(RM) -r $(C2_DIR)
   405 	$(RM) -r $(KERNEL_DIR)
   406 	$(RM) -r $(ZERO_DIR)
   407 	$(RM) -r $(SHARK_DIR)
   408 clean_export:
   409 	$(RM) -r $(EXPORT_PATH)
   410 clean_jdk:
   411 	$(RM) -r $(JDK_IMAGE_DIR)
   413 #
   414 # Create JDK and place this build into it
   415 #
   416 create_jdk: copy_jdk update_jdk
   418 update_jdk: export_product_jdk export_fastdebug_jdk test_jdk
   420 copy_jdk: $(JDK_IMAGE_DIR)/jre/lib/rt.jar
   422 $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
   423 	$(RM) -r $(JDK_IMAGE_DIR)
   424 	$(MKDIR) -p $(JDK_IMAGE_DIR)
   425 	($(CD) $(JDK_IMPORT_PATH) && \
   426 	 $(TAR) -cf - *) | \
   427 	 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
   429 test_jdk:
   430   ifneq ($(ZERO_BUILD), true)
   431     ifeq ($(ARCH_DATA_MODEL), 32)
   432 	$(JDK_IMAGE_DIR)/bin/java -client -version
   433     endif
   434   endif
   435 	$(JDK_IMAGE_DIR)/bin/java -server -version
   437 copy_product_jdk:
   438 	$(RM) -r $(JDK_IMAGE_DIR)
   439 	$(MKDIR) -p $(JDK_IMAGE_DIR)
   440 	($(CD) $(JDK_IMPORT_PATH) && \
   441 	 $(TAR) -cf - $(JDK_DIRS)) | \
   442 	 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
   444 copy_fastdebug_jdk:
   445 	$(RM) -r $(JDK_IMAGE_DIR)/fastdebug
   446 	$(MKDIR) -p $(JDK_IMAGE_DIR)/fastdebug
   447 	if [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
   448 	  ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
   449 	   $(TAR) -cf - $(JDK_DIRS)) | \
   450 	   ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
   451 	else \
   452 	  ($(CD) $(JDK_IMPORT_PATH) && \
   453 	   $(TAR) -cf - $(JDK_DIRS)) | \
   454 	   ($(CD) $(JDK_IMAGE_DIR)/fastdebug && $(TAR) -xf -) ; \
   455 	fi
   457 copy_debug_jdk:
   458 	$(RM) -r $(JDK_IMAGE_DIR)/debug
   459 	$(MKDIR) -p $(JDK_IMAGE_DIR)/debug
   460 	if [ -d $(JDK_IMPORT_PATH)/debug ] ; then \
   461 	  ($(CD) $(JDK_IMPORT_PATH)/debug && \
   462 	   $(TAR) -cf - $(JDK_DIRS)) | \
   463 	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
   464 	elif [ -d $(JDK_IMPORT_PATH)/fastdebug ] ; then \
   465 	  ($(CD) $(JDK_IMPORT_PATH)/fastdebug && \
   466 	   $(TAR) -cf - $(JDK_DIRS)) | \
   467 	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
   468 	else \
   469 	  ($(CD) $(JDK_IMPORT_PATH) && \
   470 	   $(TAR) -cf - $(JDK_DIRS)) | \
   471 	   ($(CD) $(JDK_IMAGE_DIR)/debug && $(TAR) -xf -) ; \
   472 	fi
   474 #
   475 # Check target
   476 #
   477 check: variable_check
   479 #
   480 # Help target
   481 #
   482 help: intro_help target_help variable_help notes_help examples_help
   484 # Intro help message
   485 intro_help:
   486 	@$(ECHO) \
   487 "Makefile for the Hotspot workspace." 
   488 	@$(ECHO) \
   489 "Default behavior is to build and create an export area for the j2se builds."
   491 # Target help
   492 target_help:
   493 	@$(ECHO) "help:             This help message"
   494 	@$(ECHO) "all:              Same as: all_product all_fastdebug"
   495 	@$(ECHO) "world:            Same as: all create_jdk"
   496 	@$(ECHO) "all_product:      Same as: product product1 export_product"
   497 	@$(ECHO) "all_fastdebug:    Same as: fastdebug fastdebug1 export_fastdebug"
   498 	@$(ECHO) "all_debug:        Same as: jvmg jvmg1 export_debug"
   499 	@$(ECHO) "all_optimized:    Same as: optimized optimized1 export_optimized"
   500 	@$(ECHO) "clean:            Clean all areas"
   501 	@$(ECHO) "export_product:   Export product files to EXPORT_PATH"
   502 	@$(ECHO) "export_fastdebug: Export fastdebug files to EXPORT_PATH"
   503 	@$(ECHO) "export_debug:     Export debug files to EXPORT_PATH"
   504 	@$(ECHO) "export_optimized: Export optimized files to EXPORT_PATH"
   505 	@$(ECHO) "create_jdk:       Create JDK image, export all files into it"
   506 	@$(ECHO) "update_jdk:       Update JDK image with fresh exported files"
   507 	@$(ECHO) " "
   508 	@$(ECHO) "Others targets are:"
   509 	@$(ECHO) "   $(C1_VM_TARGETS)"
   510 	@$(ECHO) "   $(C2_VM_TARGETS)"
   511 	@$(ECHO) "   $(KERNEL_VM_TARGETS)"
   513 # Variable help (only common ones used by this workspace)
   514 variable_help: variable_help_intro variable_list variable_help_end
   515 variable_help_intro:
   516 	@$(ECHO) "--- Common Variables ---"
   517 variable_help_end:
   518 	@$(ECHO) " "
   519 	@$(ECHO) "--- Make Arguments ---"
   520 	@$(ECHO) "MAKE_ARGS=$(MAKE_ARGS)"
   522 # One line descriptions for the variables
   523 SLASH_JAVA.desc            = Root of all build tools, e.g. /java or J:
   524 OUTPUTDIR.desc             = Output directory, default is build/<osname>
   525 BOOTDIR.desc               = JDK used to compile agent java source and test with
   526 JDK_IMPORT_PATH.desc       = Promoted JDK to copy for 'create_jdk'
   527 EXPORT_PATH.desc           = Directory to place files to export for JDK build
   529 # Make variables to print out (description and value)
   530 VARIABLE_PRINTVAL_LIST +=       \
   531     SLASH_JAVA                  \
   532     OUTPUTDIR                   \
   533     BOOTDIR                     \
   534     JDK_IMPORT_PATH             \
   535     EXPORT_PATH
   537 # Make variables that should refer to directories that exist
   538 VARIABLE_CHECKDIR_LIST +=       \
   539     SLASH_JAVA                  \
   540     BOOTDIR                     \
   541     JDK_IMPORT_PATH
   543 # For pattern rules below, so all are treated the same
   544 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
   545 DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
   547 # Complete variable check
   548 variable_check: $(DO_CHECKDIR_LIST)
   549 variable_list: $(DO_PRINTVAL_LIST) variable_check
   551 # Pattern rule for printing out a variable
   552 %.printval:
   553 	@$(ECHO) "  ALT_$* - $($*.desc)"
   554 	@$(ECHO) "        $*=$($*)"
   556 # Pattern rule for checking to see if a variable with a directory exists
   557 %.checkdir:
   558 	@if [ ! -d $($*) ] ; then \
   559 	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
   560 	fi
   562 # Pattern rule for checking to see if a variable with a file exists
   563 %.checkfil:
   564 	@if [ ! -f $($*) ] ; then \
   565 	    $(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
   566 	fi
   568 # Misc notes on help
   569 notes_help:
   570 	@$(ECHO) \
   571 "--- Notes --- "
   572 	@$(ECHO) \
   573 "- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted"
   574 	@$(ECHO) \
   575 "        builds or previous release JDK builds will work."
   576 	@$(ECHO) \
   577 "- The fastest builds have been when the workspace and the BOOTDIR are on"
   578 	@$(ECHO) \
   579 "        local disk."
   581 examples_help:
   582 	@$(ECHO) \
   583 "--- Examples --- "
   584 	@$(ECHO) \
   585 "  $(MAKE) all"
   586 	@$(ECHO) \
   587 "  $(MAKE) world"
   588 	@$(ECHO) \
   589 "  $(MAKE) ALT_BOOTDIR=/opt/java/jdk$(PREVIOUS_JDK_VERSION)" 
   590 	@$(ECHO) \
   591 "  $(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk$(JDK_VERSION)"
   593 # JPRT rule to build this workspace
   594 include $(GAMMADIR)/make/jprt.gmk
   596 .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
   597         $(KERNEL_VM_TARGETS) \
   598 	generic_build1 generic_build2 generic_buildkernel generic_export \
   599 	export_product export_fastdebug export_debug export_optimized \
   600 	export_jdk_product export_jdk_fastdebug export_jdk_debug \
   601 	create_jdk copy_jdk update_jdk test_jdk \
   602 	copy_product_jdk copy_fastdebug_jdk copy_debug_jdk

mercurial