1.1 --- a/Makefile Thu Jun 10 13:58:55 2010 -0700 1.2 +++ b/Makefile Mon Jun 21 11:00:15 2010 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 # 1.5 -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved. 1.6 +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. 1.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 # 1.9 # This code is free software; you can redistribute it and/or modify it 1.10 @@ -29,10 +29,6 @@ 1.11 TOPDIR:=. 1.12 endif 1.13 1.14 -ifndef CONTROL_TOPDIR 1.15 - CONTROL_TOPDIR=$(TOPDIR) 1.16 -endif 1.17 - 1.18 # Openjdk sources (only used if SKIP_OPENJDK_BUILD!=true) 1.19 OPENJDK_SOURCETREE=$(TOPDIR)/openjdk 1.20 OPENJDK_BUILDDIR:=$(shell \ 1.21 @@ -120,7 +116,7 @@ 1.22 all_product_build:: 1.23 @$(FINISH_ECHO) 1.24 1.25 -# Generis build of basic repo series 1.26 +# Generic build of basic repo series 1.27 generic_build_repo_series:: 1.28 $(MKDIR) -p $(OUTPUTDIR) 1.29 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image 1.30 @@ -179,11 +175,15 @@ 1.31 # The install process needs to know what the DEBUG_NAME is, so 1.32 # look for INSTALL_DEBUG_NAME in the install rules. 1.33 # 1.34 +# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME). 1.35 +# Due to the use of short paths in $(ABS_OUTPUTDIR), this may 1.36 +# not be the same location. 1.37 +# 1.38 1.39 # Location of fresh bootdir output 1.40 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk 1.41 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image 1.42 -FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image 1.43 +FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image 1.44 1.45 create_fresh_product_bootdir: FRC 1.46 @$(START_ECHO) 1.47 @@ -248,10 +248,14 @@ 1.48 generic_build_repo_series 1.49 @$(FINISH_ECHO) 1.50 1.51 +# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). 1.52 +# Due to the use of short paths in $(ABS_OUTPUTDIR), this may 1.53 +# not be the same location. 1.54 + 1.55 generic_debug_build: 1.56 @$(START_ECHO) 1.57 $(MAKE) \ 1.58 - ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \ 1.59 + ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \ 1.60 DEBUG_NAME=$(DEBUG_NAME) \ 1.61 GENERATE_DOCS=false \ 1.62 $(BOOT_CYCLE_DEBUG_SETTINGS) \ 1.63 @@ -348,8 +352,8 @@ 1.64 1.65 clobber:: 1.66 $(RM) -r $(OUTPUTDIR)/* 1.67 - $(RM) -r $(OUTPUTDIR)-debug/* 1.68 - $(RM) -r $(OUTPUTDIR)-fastdebug/* 1.69 + $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* 1.70 + $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/* 1.71 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) 1.72 1.73 clean: clobber 1.74 @@ -551,6 +555,56 @@ 1.75 endif 1.76 1.77 ################################################################ 1.78 +# rule to test 1.79 +################################################################ 1.80 + 1.81 +.NOTPARALLEL: test 1.82 + 1.83 +test: test_clean test_start test_summary 1.84 + 1.85 +test_start: 1.86 + @$(ECHO) "Tests started at `$(DATE)`" 1.87 + 1.88 +test_clean: 1.89 + $(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt 1.90 + 1.91 +test_summary: $(OUTPUTDIR)/test_failures.txt 1.92 + @$(ECHO) "#################################################" 1.93 + @$(ECHO) "Tests completed at `$(DATE)`" 1.94 + @( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \ 1.95 + || $(ECHO) "No TEST STATS seen in log" ) 1.96 + @$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt" 1.97 + @$(ECHO) "#################################################" 1.98 + @if [ -s $< ] ; then \ 1.99 + $(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \ 1.100 + $(CAT) $<; \ 1.101 + exit 1; \ 1.102 + else \ 1.103 + $(ECHO) "Success! No failures detected"; \ 1.104 + fi 1.105 + 1.106 +# Get failure list from log 1.107 +$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt 1.108 + @$(RM) $@ 1.109 + @( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) > $@ 1.110 + 1.111 +# Get log file of all tests run 1.112 +JDK_TO_TEST := $(shell \ 1.113 + if [ -d "$(ABS_OUTPUTDIR)/j2sdk-image" ] ; then \ 1.114 + $(ECHO) "$(ABS_OUTPUTDIR)/j2sdk-image"; \ 1.115 + elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \ 1.116 + $(ECHO) "$(ABS_OUTPUTDIR)"; \ 1.117 + elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \ 1.118 + $(ECHO) "$(PRODUCT_HOME)"; \ 1.119 + fi \ 1.120 +) 1.121 +$(OUTPUTDIR)/test_log.txt: 1.122 + $(RM) $@ 1.123 + ( $(CD) test && \ 1.124 + $(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) \ 1.125 + ) | tee $@ 1.126 + 1.127 +################################################################ 1.128 # JPRT rule to build 1.129 ################################################################ 1.130 1.131 @@ -560,7 +614,7 @@ 1.132 # PHONY 1.133 ################################################################ 1.134 1.135 -.PHONY: all \ 1.136 +.PHONY: all test test_start test_summary test_clean \ 1.137 generic_build_repo_series \ 1.138 what clobber insane \ 1.139 dev dev-build dev-sanity dev-clobber \