< prev index next >

make/RunTestsPrebuilt.gmk

Print this page




  78   # and if wildcard is empty, then complain that the file is missing.
  79   ifeq ($3, MKDIR)
  80     ifneq ($$(findstring $$(LOG), info debug trace), )
  81       $$(info Creating directory for $1)
  82     endif
  83     $$(shell mkdir -p $$($1))
  84   else ifneq ($3, NO_CHECK)
  85     ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
  86       $$(info Error: Prebuilt variable $1 points to missing file/directory:)
  87       $$(info '$$($1)')
  88       $$(error Cannot continue.)
  89     endif
  90   endif
  91 endef
  92 
  93 # Create an ephemeral spec file
  94 #
  95 # $1: The output file name
  96 # $2..$N: The lines to output to the file
  97 define CreateNewSpec
  98   $(if $(strip $(30)), \
  99     $(error Internal makefile error: \
 100       Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
 101   ) \
 102   $(shell $(RM) $1) \
 103   $(foreach i, $(call sequence, 2, 29), \
 104     $(if $(strip $($i)), \
 105       $(call AppendFile, $(strip $($i)), $1) \
 106     ) \
 107   )
 108 endef
 109 
 110 ################################################################################
 111 # Check input and setup basic buildsystem support
 112 ################################################################################
 113 
 114 # Verify that user has given correct additional input.
 115 
 116 # These variables are absolutely necessary
 117 $(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
 118 $(eval $(call SetupVariable,BOOT_JDK))
 119 $(eval $(call SetupVariable,JT_HOME))
 120 
 121 # These can have default values based on the ones above
 122 $(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
 123 $(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))


 203 
 204 OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU)
 205 ifeq ($(OPENJDK_TARGET_CPU), x86_64)
 206   OPENJDK_TARGET_CPU_ARCH := x86
 207 else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 208   OPENJDK_TARGET_CPU_ARCH := sparc
 209 endif
 210 
 211 ifeq ($(OPENJDK_TARGET_OS), windows)
 212   ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
 213     $(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
 214     $(error Cannot continue.)
 215   endif
 216   FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
 217   PATH_SEP:=;
 218 else
 219   FIXPATH :=
 220   PATH_SEP:=:
 221 endif
 222 
 223 # Check number of cores
 224 ifeq ($(OPENJDK_TARGET_OS), linux)
 225   NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)



 226 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 227   NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)

 228 else ifeq ($(OPENJDK_TARGET_OS), solaris)
 229   NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)



 230 else ifeq ($(OPENJDK_TARGET_OS), windows)
 231   NUM_CORES := $(NUMBER_OF_PROCESSORS)




 232 endif
 233 ifeq ($(NUM_CORES), )
 234   $(warn Could not find number of CPUs, assuming 1)
 235   NUM_CORES := 1
 236 endif




 237 
 238 # Setup LD for AOT support
 239 ifneq ($(DEVKIT_HOME), )
 240   ifeq ($(OPENJDK_TARGET_OS), windows)
 241     LD := $(DEVKIT_HOME)/VC/bin/x64/link
 242     LIBRARY_PREFIX :=
 243     SHARED_LIBRARY_SUFFIX := .dll
 244     EXE_SUFFIX := .exe
 245   else ifeq ($(OPENJDK_TARGET_OS), linux)
 246     LD := $(DEVKIT_HOME)/bin/ld
 247     LIBRARY_PREFIX := lib
 248     SHARED_LIBRARY_SUFFIX := .so
 249     EXE_SUFFIX :=
 250   else ifeq ($(OPENJDK_TARGET_OS), macosx)
 251     LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
 252     LIBRARY_PREFIX := lib
 253     SHARED_LIBRARY_SUFFIX := .dylib
 254     EXE_SUFFIX :=
 255   else ifeq ($(OPENJDK_TARGET_OS), solaris)
 256     # Prefer system linker for AOT on Solaris.


 281     TOPDIR := $(TOPDIR), \
 282     OUTPUTDIR := $(OUTPUTDIR), \
 283     BOOT_JDK := $(BOOT_JDK), \
 284     JT_HOME := $(JT_HOME), \
 285     JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
 286     TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
 287     SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
 288     MAKE := $(MAKE), \
 289     BASH := $(BASH), \
 290     JIB_JAR := $(JIB_JAR), \
 291     FIXPATH := $(FIXPATH), \
 292     PATH_SEP := $(PATH_SEP), \
 293     OPENJDK_TARGET_OS := $(OPENJDK_TARGET_OS), \
 294     OPENJDK_TARGET_OS_TYPE := $(OPENJDK_TARGET_OS_TYPE), \
 295     OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS_ENV), \
 296     OPENJDK_TARGET_CPU := $(OPENJDK_TARGET_CPU), \
 297     OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU_ARCH), \
 298     OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \
 299     OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
 300     NUM_CORES := $(NUM_CORES), \

 301     LD := $(LD), \
 302     LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
 303     SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
 304     EXE_SUFFIX := $(EXE_SUFFIX), \
 305     include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
 306     $(CUSTOM_NEW_SPEC_LINE), \
 307 )
 308 
 309 ################################################################################
 310 # The run-test-prebuilt target
 311 ################################################################################
 312 
 313 SPEC := $(NEW_SPEC)
 314 
 315 default: all
 316 
 317 run-test-prebuilt:
 318         @$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
 319         @cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
 320             TEST="$(TEST)"


  78   # and if wildcard is empty, then complain that the file is missing.
  79   ifeq ($3, MKDIR)
  80     ifneq ($$(findstring $$(LOG), info debug trace), )
  81       $$(info Creating directory for $1)
  82     endif
  83     $$(shell mkdir -p $$($1))
  84   else ifneq ($3, NO_CHECK)
  85     ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
  86       $$(info Error: Prebuilt variable $1 points to missing file/directory:)
  87       $$(info '$$($1)')
  88       $$(error Cannot continue.)
  89     endif
  90   endif
  91 endef
  92 
  93 # Create an ephemeral spec file
  94 #
  95 # $1: The output file name
  96 # $2..$N: The lines to output to the file
  97 define CreateNewSpec
  98   $(if $(strip $(31)), \
  99     $(error Internal makefile error: \
 100       Too many arguments to macro, please update CreateNewSpec in RunTestsPrebuilt.gmk) \
 101   ) \
 102   $(shell $(RM) $1) \
 103   $(foreach i, $(call sequence, 2, 30), \
 104     $(if $(strip $($i)), \
 105       $(call AppendFile, $(strip $($i)), $1) \
 106     ) \
 107   )
 108 endef
 109 
 110 ################################################################################
 111 # Check input and setup basic buildsystem support
 112 ################################################################################
 113 
 114 # Verify that user has given correct additional input.
 115 
 116 # These variables are absolutely necessary
 117 $(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
 118 $(eval $(call SetupVariable,BOOT_JDK))
 119 $(eval $(call SetupVariable,JT_HOME))
 120 
 121 # These can have default values based on the ones above
 122 $(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
 123 $(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))


 203 
 204 OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU)
 205 ifeq ($(OPENJDK_TARGET_CPU), x86_64)
 206   OPENJDK_TARGET_CPU_ARCH := x86
 207 else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
 208   OPENJDK_TARGET_CPU_ARCH := sparc
 209 endif
 210 
 211 ifeq ($(OPENJDK_TARGET_OS), windows)
 212   ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
 213     $(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
 214     $(error Cannot continue.)
 215   endif
 216   FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
 217   PATH_SEP:=;
 218 else
 219   FIXPATH :=
 220   PATH_SEP:=:
 221 endif
 222 
 223 # Check number of cores and memory in MB
 224 ifeq ($(OPENJDK_TARGET_OS), linux)
 225   NUM_CORES := $(shell $(CAT) /proc/cpuinfo  | $(GREP) -c processor)
 226   MEMORY_SIZE := $(shell \
 227       $(EXPR) `$(CAT) /proc/meminfo | $(GREP) MemTotal | $(AWK) '{print $$2}'` / 1024 \
 228   )
 229 else ifeq ($(OPENJDK_TARGET_OS), macosx)
 230   NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
 231   MEMORY_SIZE := $(shell $(EXPR) `/usr/sbin/sysctl -n hw.memsize` / 1024 / 1024)
 232 else ifeq ($(OPENJDK_TARGET_OS), solaris)
 233   NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | $(GREP) -c on-line)
 234   MEMORY_SIZE := $(shell \
 235       /usr/sbin/prtconf 2> /dev/null | $(GREP) "^Memory [Ss]ize" | $(AWK) '{print $$3}' \
 236   )
 237 else ifeq ($(OPENJDK_TARGET_OS), windows)
 238   NUM_CORES := $(NUMBER_OF_PROCESSORS)
 239   MEMORY_SIZE := $(shell \
 240       $(EXPR) `wmic computersystem get totalphysicalmemory -value | $(GREP) = \
 241           | $(CUT) -d "=" -f 2-` / 1024 / 1024 \
 242   )
 243 endif
 244 ifeq ($(NUM_CORES), )
 245   $(warn Could not find number of CPUs, assuming 1)
 246   NUM_CORES := 1
 247 endif
 248 ifeq ($(MEMORY_SIZE), )
 249   $(warn Could not find memory size, assuming 1024 MB)
 250   MEMORY_SIZE := 1024
 251 endif
 252 
 253 # Setup LD for AOT support
 254 ifneq ($(DEVKIT_HOME), )
 255   ifeq ($(OPENJDK_TARGET_OS), windows)
 256     LD := $(DEVKIT_HOME)/VC/bin/x64/link
 257     LIBRARY_PREFIX :=
 258     SHARED_LIBRARY_SUFFIX := .dll
 259     EXE_SUFFIX := .exe
 260   else ifeq ($(OPENJDK_TARGET_OS), linux)
 261     LD := $(DEVKIT_HOME)/bin/ld
 262     LIBRARY_PREFIX := lib
 263     SHARED_LIBRARY_SUFFIX := .so
 264     EXE_SUFFIX :=
 265   else ifeq ($(OPENJDK_TARGET_OS), macosx)
 266     LD := $(DEVKIT_HOME)/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
 267     LIBRARY_PREFIX := lib
 268     SHARED_LIBRARY_SUFFIX := .dylib
 269     EXE_SUFFIX :=
 270   else ifeq ($(OPENJDK_TARGET_OS), solaris)
 271     # Prefer system linker for AOT on Solaris.


 296     TOPDIR := $(TOPDIR), \
 297     OUTPUTDIR := $(OUTPUTDIR), \
 298     BOOT_JDK := $(BOOT_JDK), \
 299     JT_HOME := $(JT_HOME), \
 300     JDK_IMAGE_DIR := $(JDK_IMAGE_DIR), \
 301     TEST_IMAGE_DIR := $(TEST_IMAGE_DIR), \
 302     SYMBOLS_IMAGE_DIR := $(SYMBOLS_IMAGE_DIR), \
 303     MAKE := $(MAKE), \
 304     BASH := $(BASH), \
 305     JIB_JAR := $(JIB_JAR), \
 306     FIXPATH := $(FIXPATH), \
 307     PATH_SEP := $(PATH_SEP), \
 308     OPENJDK_TARGET_OS := $(OPENJDK_TARGET_OS), \
 309     OPENJDK_TARGET_OS_TYPE := $(OPENJDK_TARGET_OS_TYPE), \
 310     OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS_ENV), \
 311     OPENJDK_TARGET_CPU := $(OPENJDK_TARGET_CPU), \
 312     OPENJDK_TARGET_CPU_ARCH := $(OPENJDK_TARGET_CPU_ARCH), \
 313     OPENJDK_TARGET_CPU_BITS := $(OPENJDK_TARGET_CPU_BITS), \
 314     OPENJDK_TARGET_CPU_ENDIAN := $(OPENJDK_TARGET_CPU_ENDIAN), \
 315     NUM_CORES := $(NUM_CORES), \
 316     MEMORY_SIZE := $(MEMORY_SIZE), \
 317     LD := $(LD), \
 318     LIBRARY_PREFIX := $(LIBRARY_PREFIX), \
 319     SHARED_LIBRARY_SUFFIX := $(SHARED_LIBRARY_SUFFIX), \
 320     EXE_SUFFIX := $(EXE_SUFFIX), \
 321     include $(TOPDIR)/make/RunTestsPrebuiltSpec.gmk, \
 322     $(CUSTOM_NEW_SPEC_LINE), \
 323 )
 324 
 325 ################################################################################
 326 # The run-test-prebuilt target
 327 ################################################################################
 328 
 329 SPEC := $(NEW_SPEC)
 330 
 331 default: all
 332 
 333 run-test-prebuilt:
 334         @$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
 335         @cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
 336             TEST="$(TEST)"
< prev index next >