Makefile
changeset 310 fd6bbe697bf6
parent 20 41658053480c
child 668 982030fabc32
equal deleted inserted replaced
309:bda219d843f6 310:fd6bbe697bf6
    21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    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
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
    23 # have any questions.
    23 # have any questions.
    24 #
    24 #
    25 
    25 
       
    26 BUILD_PARENT_DIRECTORY=.
       
    27 
    26 ifndef TOPDIR
    28 ifndef TOPDIR
    27   TOPDIR:=$(shell \
    29   TOPDIR:=.
    28     if [ -r ./j2se/make/Makefile -o -r ./jdk/make/Makefile ]; then \
       
    29       echo "."; \
       
    30     else \
       
    31       echo "../.."; \
       
    32     fi)
       
    33 endif
    30 endif
    34 
    31 
    35 ifndef CONTROL_TOPDIR
    32 ifndef CONTROL_TOPDIR
    36   CONTROL_TOPDIR=$(TOPDIR)/control
    33   CONTROL_TOPDIR=$(TOPDIR)
    37   CONTROL_TOPDIR:=$(shell \
    34 endif
    38     if [ -r $(TOPDIR)/control/make/Makefile ]; then \
    35 
    39       echo "$(TOPDIR)/control"; \
    36 # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
    40     else \
    37 OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
    41       echo "$(TOPDIR)"; \
    38 OPENJDK_BUILDDIR:=$(shell \
    42     fi)
    39   if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
    43 endif
    40     echo "$(OPENJDK_SOURCETREE)"; \
       
    41   else \
       
    42     echo "."; \
       
    43   fi)
    44 
    44 
    45 ifndef JDK_TOPDIR
    45 ifndef JDK_TOPDIR
    46   JDK_TOPDIR=$(TOPDIR)/jdk
    46   JDK_TOPDIR=$(TOPDIR)/jdk
    47 endif
    47 endif
    48 ifndef JDK_MAKE_SHARED_DIR
    48 ifndef JDK_MAKE_SHARED_DIR
    53 
    53 
    54 include ./make/Defs-internal.gmk
    54 include ./make/Defs-internal.gmk
    55 
    55 
    56 all::
    56 all::
    57 	@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: `$(DATE) '+%y-%m-%d %H:%M'`
    57 	@$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: `$(DATE) '+%y-%m-%d %H:%M'`
       
    58 	$(MKDIR) -p $(OUTPUTDIR)
    58 
    59 
    59 # Rules for sanity checks
    60 # Rules for sanity checks
    60 include ./make/sanity-rules.gmk
    61 include ./make/sanity-rules.gmk
    61 
    62 
    62 dev : dev-build
    63 dev : dev-build
    79 include ./make/sponsors-rules.gmk
    80 include ./make/sponsors-rules.gmk
    80 include ./make/deploy-rules.gmk
    81 include ./make/deploy-rules.gmk
    81 
    82 
    82 all:: setup build
    83 all:: setup build
    83 
    84 
    84 setup:
    85 setup: openjdk_check
    85 	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
    86 	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
    86 	$(MKDIR) -p $(ABS_OUTPUTDIR)/j2sdk-image
    87 
    87 	$(MKDIR) -p $(OUTPUTDIR)-fastdebug/j2sdk-image
    88 # Check on whether we really can build the openjdk, need source etc.
    88 	$(MKDIR) -p $(ABS_OUTPUTDIR)-fastdebug/j2sdk-image
    89 openjdk_check: FRC
       
    90 ifneq ($(SKIP_OPENJDK_BUILD), true)
       
    91 	@$(ECHO) " "
       
    92 	@$(ECHO) "================================================="
       
    93 	@if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
       
    94 	    $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
       
    95 	    exit 1; \
       
    96 	else \
       
    97 	    $(ECHO) "OpenJDK will be built after JDK is built"; \
       
    98 	    $(ECHO) "  OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
       
    99 	fi
       
   100 	@$(ECHO) "================================================="
       
   101 	@$(ECHO) " "
       
   102 endif
    89 
   103 
    90 build:: sanity 
   104 build:: sanity 
    91 
   105 
    92 clobber::
   106 clobber::
    93 
   107 
   141 #     look for INSTALL_DEBUG_NAME in the install rules.
   155 #     look for INSTALL_DEBUG_NAME in the install rules.
   142 #
   156 #
   143 
   157 
   144 COMMON_DEBUG_FLAGS= \
   158 COMMON_DEBUG_FLAGS= \
   145 	DEBUG_NAME=$(DEBUG_NAME) \
   159 	DEBUG_NAME=$(DEBUG_NAME) \
   146 	ALT_OUTPUTDIR=$(_OUTPUTDIR)-$(DEBUG_NAME) \
   160 	ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
   147 	NO_DOCS=true
   161 	NO_DOCS=true
   148 
   162 
   149 product_build: setup
   163 product_build: setup
   150 	@$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
   164 	@$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
   151 	$(MAKE) SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=true all
   165 	$(MAKE) SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=true all
   188 
   202 
   189 ifneq ($(SKIP_COMPARE_IMAGES), true)
   203 ifneq ($(SKIP_COMPARE_IMAGES), true)
   190   all :: compare-image
   204   all :: compare-image
   191 endif
   205 endif
   192 
   206 
   193 ifeq ($(SKIP_OPENJDK_BUILD), false)
   207 ifneq ($(SKIP_OPENJDK_BUILD), true)
       
   208   all :: openjdk_build
       
   209 endif
       
   210 
       
   211 # If we have bundle rules, we have a chance here to do a complete cycle
       
   212 #   build, of production and open build.
       
   213 # FIXUP: We should create the openjdk source bundle and build that?
       
   214 #   But how do we reliable create or get at a formal openjdk source tree?
       
   215 #   The one we have needs to be trimmed of built bits and closed dirs.
       
   216 #   The repositories might not be available.
       
   217 #   The openjdk source bundle is probably not available.
       
   218 
       
   219 ifneq ($(SKIP_OPENJDK_BUILD), true)
   194   ifeq ($(BUILD_JDK), true)
   220   ifeq ($(BUILD_JDK), true)
   195     ifeq ($(BUNDLE_RULES_AVAILABLE), true)
   221     ifeq ($(BUNDLE_RULES_AVAILABLE), true)
   196       # If we have bundle rules, we have a chance here to do a complete cycle
   222 
   197       #   build, of closed and open build.
   223 OPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
   198       # FIXUP: We should create the openjdk source bundle and build that?
   224 OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
   199       ABS_OPENJDK_PLUGS=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME)
   225 OPENJDK_BUILD_NAME \
   200       ABS_OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/openjdk
   226   = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
   201       OPENJDK_BUILD_NAME_PREFIX \
   227 OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
   202 	= $(J2SDK_NAME)-$(JDK_MKTG_UNDERSCORE_VERSION)-$(MILESTONE)
   228 BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image
   203       OPENJDK_BUILD_NAME_SUFFIX \
   229 ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
   204 	= $(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
   230   OPENJDK_BOOTDIR=$(BOOTDIR)
   205       OPENJDK_BUILD_NAME \
   231   OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH)
   206 	= $(OPENJDK_BUILD_NAME_PREFIX)-openjdk-$(OPENJDK_BUILD_NAME_SUFFIX)
   232 else
   207       OPENJDK_BUILD_BINARY_ZIP \
   233   OPENJDK_BOOTDIR=$(BUILT_IMAGE)
   208 	= $(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
   234   OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
   209   all :: openjdk-build
   235 endif
   210   openjdk-build:
   236 
       
   237 openjdk_build:
   211 	@$(ECHO) " "
   238 	@$(ECHO) " "
   212 	@$(ECHO) "================================================="
   239 	@$(ECHO) "================================================="
   213 	@$(ECHO) "Starting openjdk build"
   240 	@$(ECHO) "Starting openjdk build"
   214 	@$(ECHO) "================================================="
   241 	@$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
   215 	@$(ECHO) " "
   242 	@$(ECHO) "================================================="
   216 	$(RM) -r $(ABS_OPENJDK_OUTPUTDIR)
   243 	@$(ECHO) " "
   217 	$(MKDIR) -p $(ABS_OPENJDK_OUTPUTDIR)
   244 	$(RM) -r $(OPENJDK_OUTPUTDIR)
   218 	$(MAKE) OPENJDK=true \
   245 	$(MKDIR) -p $(OPENJDK_OUTPUTDIR)
   219 	  BUILD_LANGTOOLS=$(BUILD_LANGTOOLS) \
   246 	($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
   220 	  BUILD_CORBA=$(BUILD_CORBA) \
   247 	  OPENJDK=true \
   221 	  BUILD_JAXP=$(BUILD_JAXP) \
   248 	  ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
   222 	  BUILD_JAXWS=$(BUILD_JAXWS) \
   249 	  ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
   223 	  BUILD_HOTSPOT=$(BUILD_HOTSPOT) \
   250 	  ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \
   224 	  ALT_OUTPUTDIR=$(ABS_OPENJDK_OUTPUTDIR) \
   251 	  ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
   225 	  ALT_BINARY_PLUGS_PATH=$(ABS_OUTPUTDIR)/$(OPENJDK_BINARY_PLUGS_INAME) \
   252 	  ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
   226 	  ALT_BOOTDIR=$(ABS_OUTPUTDIR)/j2sdk-image \
   253 		product_build )
   227 	  ALT_JDK_IMPORT_PATH=$(ABS_OUTPUTDIR)/j2sdk-image \
       
   228 		product_build
       
   229 	$(RM) $(OPENJDK_BUILD_BINARY_ZIP)
   254 	$(RM) $(OPENJDK_BUILD_BINARY_ZIP)
   230 	( $(CD) $(ABS_OPENJDK_OUTPUTDIR)/j2sdk-image && \
   255 	( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
   231 	  $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
   256 	  $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
   232 	$(RM) -r $(ABS_OPENJDK_OUTPUTDIR)
   257 	$(RM) -r $(OPENJDK_OUTPUTDIR)
       
   258 	@$(ECHO) " "
       
   259 	@$(ECHO) "================================================="
       
   260 	@$(ECHO) "Finished openjdk build"
       
   261 	@$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
       
   262 	@$(ECHO) "================================================="
       
   263 	@$(ECHO) " "
       
   264     
   233     endif
   265     endif
   234   endif
   266   endif
   235 endif
   267 endif
   236 
   268 
   237 clobber::
   269 clobber::
   430 
   462 
   431 ################################################################
   463 ################################################################
   432 # Cycle build. Build the jdk, use it to build the jdk again.
   464 # Cycle build. Build the jdk, use it to build the jdk again.
   433 ################################################################
   465 ################################################################
   434   
   466   
   435 ABS_BOOTJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
   467 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
   436   
   468   
   437 boot_cycle:
   469 boot_cycle:
   438 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTJDK_OUTPUTDIR) product_build
   470 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) product_build
   439 	$(MAKE) ALT_BOOTDIR=$(ABS_BOOTJDK_OUTPUTDIR)/j2sdk-image product_build
   471 	$(MAKE) ALT_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image product_build
   440 
   472 
   441 ################################################################
   473 ################################################################
   442 # JPRT rule to build
   474 # JPRT rule to build
   443 ################################################################
   475 ################################################################
   444 
   476 
   450 
   482 
   451 .PHONY: all build what clobber insane \
   483 .PHONY: all build what clobber insane \
   452 	fastdebug_build debug_build product_build setup \
   484 	fastdebug_build debug_build product_build setup \
   453         dev dev-build dev-sanity dev-clobber
   485         dev dev-build dev-sanity dev-clobber
   454 
   486 
   455 # FIXUP: Old j2se targets
   487 # Force target
   456 j2se_fastdebug_only: jdk_fastdebug_only
   488 FRC:
   457 j2se_only: jdk_only
   489 
   458