Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/make/windows/create_obj_files.sh
48773 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"8081# shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.82if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then83BASE_PATHS="${BASE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"84fi85BASE_PATHS="${BASE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"8687if [ -d "${ALTSRC}/share/vm/c1" ]; then88COMPILER1_PATHS="${ALTSRC}/share/vm/c1"89fi90COMPILER1_PATHS="${COMPILER1_PATHS} ${COMMONSRC}/share/vm/c1"9192if [ -d "${ALTSRC}/share/vm/opto" ]; then93COMPILER2_PATHS="${ALTSRC}/share/vm/opto"94fi95COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/opto"96if [ -d "${ALTSRC}/share/vm/libadt" ]; then97COMPILER2_PATHS="${COMPILER2_PATHS} ${ALTSRC}/share/vm/libadt"98fi99COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/libadt"100COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"101102# Include dirs per type.103case "${TYPE}" in104"compiler1") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;;105"compiler2") Src_Dirs="${BASE_PATHS} ${COMPILER2_PATHS}" ;;106"tiered") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;;107"zero") Src_Dirs="${BASE_PATHS}" ;;108"shark") Src_Dirs="${BASE_PATHS}" ;;109esac110111COMPILER2_SPECIFIC_FILES="opto libadt bcEscapeAnalyzer.cpp c2_* runtime_*"112COMPILER1_SPECIFIC_FILES="c1_*"113SHARK_SPECIFIC_FILES="shark"114ZERO_SPECIFIC_FILES="zero"115116# Always exclude these.117Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp"118119# Exclude per type.120case "${TYPE}" in121"compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;122"compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;123"tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;124"zero") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;;125"shark") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES}" ;;126esac127128# Special handling of arch model.129case "${Platform_arch_model}" in130"x86_32") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_64*" ;;131"x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;;132esac133134# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.135function findsrc {136$FIND ${1}/. ! -name . -prune \137-a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \138-a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \139| sed 's/.*\/\(.*\)/\1/';140}141142Src_Files=143for e in ${Src_Dirs}; do144Src_Files="${Src_Files}`findsrc ${e}` "145done146147Obj_Files=" "148for e in ${Src_Files}; do149o="${e%\.[!.]*}.obj"150set +e151chk=`expr "${Obj_Files}" : ".* $o"`152set -e153if [ "$chk" != 0 ]; then154echo "# INFO: skipping duplicate $o"155continue156fi157Obj_Files="${Obj_Files}$o "158done159160echo Obj_Files=${Obj_Files}161162163