jdk/make/Makefile
changeset 6681 e721d11e4826
parent 5506 202f599c92aa
child 7174 5a56e43d896c
equal deleted inserted replaced
6680:b770b6b96142 6681:e721d11e4826
    73 import            -- copy in the pre-built components (e.g. VM) \n\
    73 import            -- copy in the pre-built components (e.g. VM) \n\
    74 import_product    -- copy in the product components \n\
    74 import_product    -- copy in the product components \n\
    75 import_fastdebug  -- copy in the fastdebug components \n\
    75 import_fastdebug  -- copy in the fastdebug components \n\
    76 import_debug      -- copy in the debug components \n\
    76 import_debug      -- copy in the debug components \n\
    77 modules           -- build the jdk and jre module images (experimental) \n\
    77 modules           -- build the jdk and jre module images (experimental) \n\
    78 sccs_get          -- make sure all SCCS files are up-to-date (need SCCS) \n\
       
    79 create_links      -- create softlinks in Solaris 32bit build to 64bit dirs \n\
    78 create_links      -- create softlinks in Solaris 32bit build to 64bit dirs \n\
    80 "
    79 "
    81 
    80 
    82 # Variable help (only common ones used by this workspace)
    81 # Variable help (only common ones used by this workspace)
    83 variable_help: variable_help_intro variable_list variable_help_end
    82 variable_help: variable_help_intro variable_list variable_help_end
   276 include $(BUILDDIR)/common/Sanity.gmk
   275 include $(BUILDDIR)/common/Sanity.gmk
   277 
   276 
   278 $(OUTPUTDIR) $(TEMPDIR):
   277 $(OUTPUTDIR) $(TEMPDIR):
   279 	$(MKDIR) -p $@
   278 	$(MKDIR) -p $@
   280 
   279 
   281 # cleanup everything. If the workspace is not being built by the control
       
   282 # workspace, and if it is a Teamware workspace, then see if there are
       
   283 # any files which are not under SCCS control.
       
   284 clean clobber:: 
       
   285 ifndef EXTERNALSANITYCONTROL
       
   286 	@if [ -d $(TOPDIR)/Codemgr_wsdata ]; then \
       
   287 	  $(ECHO) '\nPerforming workspace scan for remnant files.\n' \
       
   288 		'  Any files listed below are not under SCCS control in the workspace\n' \
       
   289 		'  and you should review them and possibly remove them manually:' ; \
       
   290 	  $(FIND) $(TOPDIR)/make $(TOPDIR)/src -type f | \
       
   291 		$(SED) 's+SCCS/[ps]\.++' | $(SORT) | $(UNIQ) -c | $(NAWK) '$$1<2 {print $$2;}' ; \
       
   292 	  $(ECHO) 'End of workspace scan.' ; \
       
   293 	fi
       
   294 endif
       
   295 
       
   296 # this should be the last rule in this file:
   280 # this should be the last rule in this file:
   297 all::
   281 all::
   298 	@if [ -r $(WARNING_FILE) ]; then \
   282 	@if [ -r $(WARNING_FILE) ]; then \
   299 	  $(CAT) $(WARNING_FILE) ; \
   283 	  $(CAT) $(WARNING_FILE) ; \
   300 	fi
   284 	fi
   339 # Binary Plug rules and macros
   323 # Binary Plug rules and macros
   340 #
   324 #
   341 include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
   325 include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
   342 
   326 
   343 #
   327 #
   344 # Get top level sccs_get rule
   328 # Test rule
   345 #
   329 #
   346 include $(BUILDDIR)/common/Rules-SCCS.gmk
   330 
   347 
   331 .NOTPARALLEL: test_run
       
   332 
       
   333 test:
       
   334 	$(MAKE) test_run
       
   335 
       
   336 test_run: test_clean test_start test_summary
       
   337 
       
   338 test_start:
       
   339 	@$(ECHO) "Tests started at `$(DATE)`"
       
   340 
       
   341 test_clean:
       
   342 	$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
       
   343 
       
   344 test_summary: $(OUTPUTDIR)/test_failures.txt
       
   345 	@$(ECHO) "#################################################"
       
   346 	@$(ECHO) "Tests completed at `$(DATE)`"
       
   347 	@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
       
   348           || $(ECHO) "No TEST STATS seen in log" )
       
   349 	@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
       
   350 	@$(ECHO) "#################################################"
       
   351 	@if [ -s $< ] ; then                                           \
       
   352           $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
       
   353           $(CAT) $<;                                                   \
       
   354           exit 1;                                                      \
       
   355         else                                                           \
       
   356           $(ECHO) "Success! No failures detected";                     \
       
   357         fi
       
   358 
       
   359 # Get failure list from log
       
   360 $(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
       
   361 	@$(RM) $@
       
   362 	@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
       
   363 
       
   364 # Get log file of all tests run
       
   365 JDK_TO_TEST := $(shell 							\
       
   366   if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then 			\
       
   367     $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; 				\
       
   368   elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then 				\
       
   369     $(ECHO) "$(ABS_OUTPUTDIR)"; 					\
       
   370   elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then 	\
       
   371     $(ECHO) "$(PRODUCT_HOME)"; 						\
       
   372   fi 									\
       
   373 )
       
   374 
       
   375 TEST_TARGETS=jdk_all
       
   376 $(OUTPUTDIR)/test_log.txt:
       
   377 	$(RM) $@
       
   378 	( $(CD) ../test &&                                              \
       
   379           $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
       
   380         ) | tee $@
       
   381 
       
   382 #
   348 # JPRT rules
   383 # JPRT rules
       
   384 #
       
   385 
   349 include jprt.gmk
   386 include jprt.gmk
   350 
   387 
   351 #
   388 #
   352 # Phonies to avoid accidents.
   389 # Phonies to avoid accidents.
   353 #
   390 #
   354 .PHONY: all build clean clobber optimized debug fastdebug create_links \
   391 .PHONY: all build clean clobber optimized debug fastdebug create_links \
   355 	import import_product import_fastdebug import_debug
   392 	import import_product import_fastdebug import_debug \
   356 
   393 	test test_run test_start test_clean test_summary
       
   394