Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/windows/create_obj_files.sh
32284 views
#1# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324set -e2526# Note that we currently do not have a way to set HotSpotMksHome in27# the batch build, but so far this has not seemed to be a problem. The28# reason this environment variable is necessary is that it seems that29# Windows truncates very long PATHs when executing shells like MKS's30# sh, and it has been found that sometimes `which sh` fails.3132if [ "x$HotSpotMksHome" != "x" ]; then33TOOL_DIR="$HotSpotMksHome"34else35# HotSpotMksHome is not set so use the directory that contains "sh".36# This works with both MKS and Cygwin.37SH=`which sh`38TOOL_DIR=`dirname "$SH"`39fi4041DIRNAME="$TOOL_DIR/dirname"42FIND="$TOOL_DIR/find"4344TYPE=$145Platform_arch=$246Platform_arch_model=$347Platform_os_family=windows48Platform_os_arch=windows_$Platform_arch4950WorkSpace=$451GENERATED=$55253COMMONSRC_REL=src54ALTSRC_REL=src/closed # Change this to pick up alt sources from somewhere else5556COMMONSRC=${WorkSpace}/${COMMONSRC_REL}57ALTSRC=${WorkSpace}/${ALTSRC_REL}5859BASE_PATHS="`if [ -d ${ALTSRC}/share/vm ]; then $FIND ${ALTSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt -o -name jfr \); fi`"60BASE_PATHS="${BASE_PATHS} ` $FIND ${COMMONSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt -o -name jfr \)`"6162for sd in \63share/vm/gc_implementation/shared \64os/${Platform_os_family}/vm \65cpu/${Platform_arch}/vm \66os_cpu/${Platform_os_arch}/vm; do67if [ -d "${ALTSRC}/${sd}" ]; then68BASE_PATHS="${BASE_PATHS} ${ALTSRC}/${sd}"69fi70BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/${sd}"71done7273BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles ${GENERATED}/jfrfiles"7475if [ "$ENABLE_JFR" = "true" ]; then76BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/jfr -type d`"77fi7879BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/prims/wbtestmethods"80BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/gc_implementation/shenandoah/c1"81BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/gc_implementation/shenandoah/c2"82BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/gc_implementation/shenandoah/heuristics"83BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/share/vm/gc_implementation/shenandoah/mode"8485# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.86if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then87BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"88fi89BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"9091if [ -d "${ALTSRC}/share/vm/c1" ]; then92COMPILER1_PATHS="${ALTSRC}/share/vm/c1"93fi94COMPILER1_PATHS="${COMPILER1_PATHS} ${COMMONSRC}/share/vm/c1"9596if [ -d "${ALTSRC}/share/vm/opto" ]; then97COMPILER2_PATHS="${ALTSRC}/share/vm/opto"98fi99COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/opto"100if [ -d "${ALTSRC}/share/vm/libadt" ]; then101COMPILER2_PATHS="${COMPILER2_PATHS} ${ALTSRC}/share/vm/libadt"102fi103COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/libadt"104COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"105106# Include dirs per type.107case "${TYPE}" in108"compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;109"compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;110"tiered") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;111"zero") Src_Dirs="${BASE_PATHS}" ;;112"shark") Src_Dirs="${BASE_PATHS}" ;;113esac114115COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"116COMPILER1_SPECIFIC_FILES="c1_*"117SHARK_SPECIFIC_FILES="shark"118ZERO_SPECIFIC_FILES="zero"119120# Always exclude these.121Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"122123# Exclude per type.124case "${TYPE}" in125"compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;126"compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;127"tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;128"zero") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;129"shark") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES}" ;;130esac131132# Special handling of arch model.133case "${Platform_arch_model}" in134"x86_32") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_64*" ;;135"x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;;136esac137138# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.139function findsrc {140$FIND ${1}/. ! -name . -prune \141-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \142-a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \143| sed 's/.*\/\(.*\)/\1/';144}145146Src_Files=147for e in ${Src_Dirs}; do148Src_Files="${Src_Files}`findsrc ${e}` "149done150151Obj_Files=" "152for e in ${Src_Files}; do153o="${e%\.[!.]*}.obj"154set +e155chk=`expr "${Obj_Files}" : ".* $o"`156set -e157if [ "$chk" != 0 ]; then158echo "# INFO: skipping duplicate $o"159continue160fi161Obj_Files="${Obj_Files}$o "162done163164echo Obj_Files=${Obj_Files}165166167