Makefile
changeset 8373 7e8b793dbf91
parent 7876 c2a288bdcca1
child 8441 30f5ad688d4a
equal deleted inserted replaced
8372:786e091594a0 8373:7e8b793dbf91
    26 BUILD_PARENT_DIRECTORY=.
    26 BUILD_PARENT_DIRECTORY=.
    27 
    27 
    28 ifndef TOPDIR
    28 ifndef TOPDIR
    29   TOPDIR:=.
    29   TOPDIR:=.
    30 endif
    30 endif
    31 
       
    32 # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true)
       
    33 OPENJDK_SOURCETREE=$(TOPDIR)/openjdk
       
    34 OPENJDK_BUILDDIR:=$(shell \
       
    35   if [ -r $(OPENJDK_SOURCETREE)/Makefile ]; then \
       
    36     echo "$(OPENJDK_SOURCETREE)"; \
       
    37   else \
       
    38     echo "."; \
       
    39   fi)
       
    40 
    31 
    41 ifndef JDK_TOPDIR
    32 ifndef JDK_TOPDIR
    42   JDK_TOPDIR=$(TOPDIR)/jdk
    33   JDK_TOPDIR=$(TOPDIR)/jdk
    43 endif
    34 endif
    44 ifndef JDK_MAKE_SHARED_DIR
    35 ifndef JDK_MAKE_SHARED_DIR
    68 
    59 
    69 # What "all" means
    60 # What "all" means
    70 all::
    61 all::
    71 	@$(START_ECHO)
    62 	@$(START_ECHO)
    72 
    63 
    73 all:: openjdk_check sanity
    64 all:: sanity
    74 
    65 
    75 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
    66 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
    76   all:: fastdebug_build
    67   all:: fastdebug_build
    77 endif
    68 endif
    78 
    69 
    79 ifeq ($(SKIP_DEBUG_BUILD), false)
    70 ifeq ($(SKIP_DEBUG_BUILD), false)
    80   all:: debug_build
    71   all:: debug_build
    81 endif
       
    82 
       
    83 ifneq ($(SKIP_OPENJDK_BUILD), true)
       
    84   all:: openjdk_build
       
    85 endif
    72 endif
    86 
    73 
    87 all:: all_product_build 
    74 all:: all_product_build 
    88 
    75 
    89 all:: 
    76 all:: 
   265 # Build final image
   252 # Build final image
   266 product_build:: build_product_image
   253 product_build:: build_product_image
   267 debug_build:: build_debug_image
   254 debug_build:: build_debug_image
   268 fastdebug_build:: build_fastdebug_image
   255 fastdebug_build:: build_fastdebug_image
   269 
   256 
   270 # Check on whether we really can build the openjdk, need source etc.
       
   271 openjdk_check: FRC
       
   272 ifneq ($(SKIP_OPENJDK_BUILD), true)
       
   273 	@$(ECHO) " "
       
   274 	@$(ECHO) "================================================="
       
   275 	@if [ ! -r $(OPENJDK_BUILDDIR)/Makefile ] ; then \
       
   276 	    $(ECHO) "ERROR: No openjdk source tree available at: $(OPENJDK_BUILDDIR)"; \
       
   277 	    exit 1; \
       
   278 	else \
       
   279 	    $(ECHO) "OpenJDK will be built after JDK is built"; \
       
   280 	    $(ECHO) "  OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
       
   281 	fi
       
   282 	@$(ECHO) "================================================="
       
   283 	@$(ECHO) " "
       
   284 endif
       
   285 
       
   286 # If we have bundle rules, we have a chance here to do a complete cycle
       
   287 #   build, of production and open build.
       
   288 # FIXUP: We should create the openjdk source bundle and build that?
       
   289 #   But how do we reliable create or get at a formal openjdk source tree?
       
   290 #   The one we have needs to be trimmed of built bits and closed dirs.
       
   291 #   The repositories might not be available.
       
   292 #   The openjdk source bundle is probably not available.
       
   293 
       
   294 ifneq ($(SKIP_OPENJDK_BUILD), true)
       
   295   ifeq ($(BUILD_JDK), true)
       
   296     ifeq ($(BUNDLE_RULES_AVAILABLE), true)
       
   297 
       
   298 OPENJDK_OUTPUTDIR=$(ABS_OUTPUTDIR)/open-output
       
   299 OPENJDK_BUILD_NAME \
       
   300   = openjdk-$(JDK_MINOR_VERSION)-$(BUILD_NUMBER)-$(PLATFORM)-$(ARCH)-$(BUNDLE_DATE)
       
   301 OPENJDK_BUILD_BINARY_ZIP=$(ABS_BIN_BUNDLEDIR)/$(OPENJDK_BUILD_NAME).zip
       
   302 BUILT_IMAGE=$(ABS_OUTPUTDIR)/j2sdk-image
       
   303 ifeq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
       
   304   OPENJDK_BOOTDIR=$(BOOTDIR)
       
   305   OPENJDK_IMPORTJDK=$(JDK_IMPORT_PATH)
       
   306 else
       
   307   OPENJDK_BOOTDIR=$(BUILT_IMAGE)
       
   308   OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
       
   309 endif
       
   310 
       
   311 openjdk_build:
       
   312 	@$(START_ECHO)
       
   313 	@$(ECHO) " "
       
   314 	@$(ECHO) "================================================="
       
   315 	@$(ECHO) "Starting openjdk build"
       
   316 	@$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
       
   317 	@$(ECHO) "================================================="
       
   318 	@$(ECHO) " "
       
   319 	$(RM) -r $(OPENJDK_OUTPUTDIR)
       
   320 	$(MKDIR) -p $(OPENJDK_OUTPUTDIR)
       
   321 	($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
       
   322 	  OPENJDK=true \
       
   323 	  GENERATE_DOCS=false \
       
   324 	  ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
       
   325 	  ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
       
   326 	  ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
       
   327 	  ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
       
   328 		product_build )
       
   329 	$(RM) $(OPENJDK_BUILD_BINARY_ZIP)
       
   330 	( $(CD) $(OPENJDK_OUTPUTDIR)/j2sdk-image && \
       
   331 	  $(ZIPEXE) -q -r $(OPENJDK_BUILD_BINARY_ZIP) .)
       
   332 	$(RM) -r $(OPENJDK_OUTPUTDIR)
       
   333 	@$(ECHO) " "
       
   334 	@$(ECHO) "================================================="
       
   335 	@$(ECHO) "Finished openjdk build"
       
   336 	@$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
       
   337 	@$(ECHO) "================================================="
       
   338 	@$(ECHO) " "
       
   339 	@$(FINISH_ECHO)
       
   340     
       
   341     endif
       
   342   endif
       
   343 endif
       
   344 
       
   345 clobber::
   257 clobber::
   346 	$(RM) -r $(OUTPUTDIR)/*
   258 	$(RM) -r $(OUTPUTDIR)/*
   347 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
   259 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
   348 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
   260 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
   349 	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
   261 	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
   446 COMPILER_PATH.desc         = Compiler install directory
   358 COMPILER_PATH.desc         = Compiler install directory
   447 CACERTS_FILE.desc          = Location of certificates file
   359 CACERTS_FILE.desc          = Location of certificates file
   448 DEVTOOLS_PATH.desc         = Directory containing zip and gnumake
   360 DEVTOOLS_PATH.desc         = Directory containing zip and gnumake
   449 CUPS_HEADERS_PATH.desc     = Include directory location for CUPS header files
   361 CUPS_HEADERS_PATH.desc     = Include directory location for CUPS header files
   450 DXSDK_PATH.desc            = Root directory of DirectX SDK
   362 DXSDK_PATH.desc            = Root directory of DirectX SDK
   451 MSVCRT_DLL_PATH.desc       = Directory containing mscvrt.dll
       
   452 
   363 
   453 # Make variables to print out (description and value)
   364 # Make variables to print out (description and value)
   454 VARIABLE_PRINTVAL_LIST +=       \
   365 VARIABLE_PRINTVAL_LIST +=       \
   455     OUTPUTDIR                   \
   366     OUTPUTDIR                   \
   456     PARALLEL_COMPILE_JOBS       \
   367     PARALLEL_COMPILE_JOBS       \
   475 
   386 
   476 # Some are windows specific
   387 # Some are windows specific
   477 ifeq ($(PLATFORM), windows)
   388 ifeq ($(PLATFORM), windows)
   478 
   389 
   479 VARIABLE_PRINTVAL_LIST +=       \
   390 VARIABLE_PRINTVAL_LIST +=       \
   480     DXSDK_PATH                  \
   391     DXSDK_PATH
   481     MSVCRT_DLL_PATH
       
   482 
   392 
   483 VARIABLE_CHECKDIR_LIST +=       \
   393 VARIABLE_CHECKDIR_LIST +=       \
   484     DXSDK_PATH                  \
   394     DXSDK_PATH
   485     MSVCRT_DLL_PATH
       
   486 
   395 
   487 endif
   396 endif
   488 
   397 
   489 # For pattern rules below, so all are treated the same
   398 # For pattern rules below, so all are treated the same
   490 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
   399 DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)