Makefile
changeset 9618 83db8167c9f6
parent 9309 334bea52fc16
child 13697 5262b00bc10c
equal deleted inserted replaced
9617:fed1b5c32b33 9618:83db8167c9f6
    22 # or visit www.oracle.com if you need additional information or have any
    22 # or visit www.oracle.com if you need additional information or have any
    23 # questions.
    23 # questions.
    24 #
    24 #
    25 
    25 
    26 BUILD_PARENT_DIRECTORY=.
    26 BUILD_PARENT_DIRECTORY=.
       
    27 
       
    28 # Basename of any originally supplied ALT_OUTPUTDIR directory
       
    29 ifndef ORIG_OUTPUTDIR_BASENAME
       
    30   ifdef ALT_OUTPUTDIR
       
    31     ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
       
    32   else
       
    33     ORIG_OUTPUTDIR_BASENAME  = $(PLATFORM)-$(ARCH)
       
    34   endif
       
    35 endif
       
    36 export ORIG_OUTPUTDIR_BASENAME
       
    37 
       
    38 # The three possible directories created for output (3 build flavors)
       
    39 OUTPUTDIR_BASENAME-          = $(ORIG_OUTPUTDIR_BASENAME)
       
    40 OUTPUTDIR_BASENAME-debug     = $(ORIG_OUTPUTDIR_BASENAME)-debug
       
    41 OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
       
    42 
       
    43 # Relative path to a debug output area
       
    44 REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
       
    45 
       
    46 # The created jdk image directory
       
    47 JDK_IMAGE_DIRNAME = j2sdk-image
       
    48 JDK_IMAGE_DIR     = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
       
    49 ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
       
    50 
       
    51 # Relative path from an output directory to the image directory
       
    52 REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
       
    53 REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
       
    54 REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
    27 
    55 
    28 ifndef TOPDIR
    56 ifndef TOPDIR
    29   TOPDIR:=.
    57   TOPDIR:=.
    30 endif
    58 endif
    31 
    59 
    96 	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
   124 	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
    97 endef
   125 endef
    98 
   126 
    99 # Generic build of basic repo series
   127 # Generic build of basic repo series
   100 generic_build_repo_series:: $(SOURCE_TIPS)
   128 generic_build_repo_series:: $(SOURCE_TIPS)
   101 	$(MKDIR) -p $(OUTPUTDIR)
   129 	$(MKDIR) -p $(JDK_IMAGE_DIR)
   102 	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
       
   103 	@$(call StartTimer)
   130 	@$(call StartTimer)
   104 
   131 
   105 ifeq ($(BUILD_LANGTOOLS), true)
   132 ifeq ($(BUILD_LANGTOOLS), true)
   106   generic_build_repo_series:: langtools
   133   generic_build_repo_series:: langtools
   107   clobber:: langtools-clobber
   134   clobber:: langtools-clobber
   144 #  Note that debug builds do NOT do INSTALL steps, but must be done
   171 #  Note that debug builds do NOT do INSTALL steps, but must be done
   145 #  after the product build and before the INSTALL step of the product build.
   172 #  after the product build and before the INSTALL step of the product build.
   146 #
   173 #
   147 #   DEBUG_NAME is fastdebug or debug
   174 #   DEBUG_NAME is fastdebug or debug
   148 #   ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
   175 #   ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
   149 #   The resulting j2sdk-image is used by the install makefiles to create a
   176 #   The resulting image directory (j2sdk-image) is used by the install makefiles
   150 #     debug install bundle jdk-*-debug-** bundle (tar or zip) 
   177 #     to create a debug install bundle jdk-*-debug-** bundle (tar or zip) 
   151 #     which will install in the debug or fastdebug subdirectory of the
   178 #     which will install in the debug or fastdebug subdirectory of the
   152 #     normal product install area.
   179 #     normal product install area.
   153 #     The install process needs to know what the DEBUG_NAME is, so
   180 #     The install process needs to know what the DEBUG_NAME is, so
   154 #     look for INSTALL_DEBUG_NAME in the install rules.
   181 #     look for INSTALL_DEBUG_NAME in the install rules.
   155 #
   182 #
   158 #         not be the same location.
   185 #         not be the same location.
   159 #
   186 #
   160 
   187 
   161 # Location of fresh bootdir output
   188 # Location of fresh bootdir output
   162 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
   189 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
   163 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
   190 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
   164 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
   191 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
   165   
   192   
   166 create_fresh_product_bootdir: FRC
   193 create_fresh_product_bootdir: FRC
   167 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   194 	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   168 		GENERATE_DOCS=false \
   195 		GENERATE_DOCS=false \
   169 		BOOT_CYCLE_SETTINGS= \
   196 		BOOT_CYCLE_SETTINGS= \
   224 #         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
   251 #         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
   225 #         not be the same location.
   252 #         not be the same location.
   226 
   253 
   227 generic_debug_build:
   254 generic_debug_build:
   228 	$(MAKE) \
   255 	$(MAKE) \
   229 		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
   256 		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
   230 	        DEBUG_NAME=$(DEBUG_NAME) \
   257 	        DEBUG_NAME=$(DEBUG_NAME) \
   231 		GENERATE_DOCS=false \
   258 		GENERATE_DOCS=false \
   232 	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
   259 	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
   233 		generic_build_repo_series
   260 		generic_build_repo_series
   234 
   261 
   252 	@$(call GetSourceTips)
   279 	@$(call GetSourceTips)
   253 
   280 
   254 clobber:: REPORT_BUILD_TIMES=
   281 clobber:: REPORT_BUILD_TIMES=
   255 clobber:: 
   282 clobber:: 
   256 	$(RM) -r $(OUTPUTDIR)/*
   283 	$(RM) -r $(OUTPUTDIR)/*
   257 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
       
   258 	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
       
   259 	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
   284 	-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
   260 
   285 
   261 clean: clobber
   286 clean: clobber
   262 
   287 
   263 #
   288 #
   487 	@$(RM) $@
   512 	@$(RM) $@
   488 	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
   513 	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
   489 
   514 
   490 # Get log file of all tests run
   515 # Get log file of all tests run
   491 JDK_TO_TEST := $(shell 							\
   516 JDK_TO_TEST := $(shell 							\
   492   if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then 			\
   517   if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then 				\
   493     $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; 				\
   518     $(ECHO) "$(ABS_JDK_IMAGE_DIR)"; 					\
   494   elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then 				\
   519   elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then 				\
   495     $(ECHO) "$(ABS_OUTPUTDIR)"; 					\
   520     $(ECHO) "$(ABS_OUTPUTDIR)"; 					\
   496   elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then 	\
   521   elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then 	\
   497     $(ECHO) "$(PRODUCT_HOME)"; 						\
   522     $(ECHO) "$(PRODUCT_HOME)"; 						\
   498   fi 									\
   523   fi 									\