diff -r c04dd1303294 make/Main.gmk --- a/make/Main.gmk Wed Aug 21 19:53:17 2019 +0300 +++ b/make/Main.gmk Fri Sep 06 18:22:35 2019 +0300 @@ -177,6 +177,15 @@ @$(call TargetEnter) @($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 -k MAKEFLAGS= JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true @$(call TargetExit) +test-image: start-make + @$(call TargetEnter) + ($(CD) $(SRC_ROOT)/hotspot/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 MAKEFLAGS= SPEC=$(SPEC) \ + JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) \ + -f JtregNativeHotspot.gmk build-test-hotspot-jtreg-native) + ($(CD) $(SRC_ROOT)/hotspot/test && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 MAKEFLAGS= SPEC=$(SPEC) \ + JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) \ + -f JtregNativeHotspot.gmk test-image-hotspot-jtreg-native) + @$(call TargetExit) # Stores the tips for each repository. This file is be used when constructing the jdk image and can be # used to track the exact sources used to build that image. diff -r c04dd1303294 make/common/MakeBase.gmk --- a/make/common/MakeBase.gmk Wed Aug 21 19:53:17 2019 +0300 +++ b/make/common/MakeBase.gmk Fri Sep 06 18:22:35 2019 +0300 @@ -512,4 +512,32 @@ ################################################################################ +isTargetOs = \ + $(strip $(if $(filter $(OPENJDK_TARGET_OS), $1), true, false)) + +# Find non directories using the find utility in the shell. Safe to call for +# non existing directories, or directories containing wildcards. +# +# Files containing space will get spaces replaced with ? because GNU Make +# cannot handle lists of files with space in them. By using ?, make will match +# the wildcard to space in many situations so we don't need to replace back +# to space on every use. While not a complete solution it does allow some uses +# of FindFiles to function with spaces in file names, including for +# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so +# if files with spaces are anticipated, use ShellFindFiles directly. +# +# $1 - Directories to start search in. +# $2 - Optional search patterns, empty means find everything. Patterns use +# standard file wildcards (* and ?) and should not be quoted. +# $3 - Optional options to find. +ShellFindFiles = \ + $(if $(wildcard $1), \ + $(sort \ + $(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \ + $(if $(strip $2), -a \( -name "$(firstword $2)" \ + $(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \ + | $(TR) ' ' '?' \ + ) \ + ) \ + ) endif # _MAKEBASE_GMK diff -r c04dd1303294 make/common/NativeCompilation.gmk --- a/make/common/NativeCompilation.gmk Wed Aug 21 19:53:17 2019 +0300 +++ b/make/common/NativeCompilation.gmk Fri Sep 06 18:22:35 2019 +0300 @@ -150,6 +150,7 @@ # EXCLUDES do not pick source from these directories # INCLUDE_FILES only compile exactly these files! # EXCLUDE_FILES with these names + # EXTRA_FILES List of extra files not in any of the SRC dirs # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run # RC_FLAGS flags for RC. # MAPFILE mapfile @@ -280,6 +281,9 @@ ifneq (,$$(strip $$($1_INCLUDE_FILES))) $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS)) endif + + $1_SRCS += $$($1_EXTRA_FILES) + ifeq (,$$($1_SRCS)) $$(error No sources found for $1 when looking inside the dirs $$($1_SRC)) endif