Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 2715fe6

Browse files
committed
Adjust copied scripts to be happy in their new corefx home
1 parent 314d081 commit 2715fe6

File tree

2 files changed

+19
-32
lines changed

2 files changed

+19
-32
lines changed

src/Native/build.sh

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ setup_dirs()
1616
{
1717
echo Setting up directories for build
1818

19-
mkdir -p "$__RootBinDir"
2019
mkdir -p "$__BinDir"
21-
mkdir -p "$__LogsDir"
2220
mkdir -p "$__IntermediatesDir"
2321
}
2422

@@ -29,11 +27,6 @@ clean()
2927
echo Cleaning previous output for the selected configuration
3028
rm -rf "$__BinDir"
3129
rm -rf "$__IntermediatesDir"
32-
33-
rm -rf "$__TestWorkingDir"
34-
rm -rf "$__TestIntermediatesDir"
35-
36-
rm -rf "$__LogsDir/*_$__BuildOS__$__BuildArch__$__BuildType.*"
3730
}
3831

3932
# Check the system to ensure the right pre-reqs are in place
@@ -49,16 +42,16 @@ check_prereqs()
4942
hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null || hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null || hash clang 2>/dev/null || { echo >&2 "Please install clang before running this script"; exit 1; }
5043
}
5144

52-
build_coreclr()
45+
build_corefx_native()
5346
{
5447
# All set to commence the build
5548

56-
echo "Commencing build of native components for $__BuildOS.$__BuildArch.$__BuildType"
49+
echo "Commencing build of corefx native components for $__BuildOS.$__BuildArch.$__BuildType"
5750
cd "$__IntermediatesDir"
5851

5952
# Regenerate the CMake solution
60-
echo "Invoking cmake with arguments: \"$__ProjectRoot\" $__CMakeArgs"
61-
"$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $__CMakeArgs
53+
echo "Invoking cmake with arguments: \"$__ScriptDir\" $__CMakeArgs"
54+
"$__ScriptDir/gen-buildsys-clang.sh" "$__ScriptDir" $__ClangMajorVersion $__ClangMinorVersion $__CMakeArgs
6255

6356
# Check that the makefiles were created.
6457

@@ -75,19 +68,19 @@ build_coreclr()
7568
else
7669
NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
7770
fi
78-
79-
# Build CoreCLR
71+
72+
# Build
8073

8174
echo "Executing make install -j $NumProc $__UnprocessedBuildArgs"
8275

8376
make install -j $NumProc $__UnprocessedBuildArgs
8477
if [ $? != 0 ]; then
85-
echo "Failed to build coreclr components."
78+
echo "Failed to build corefx native components."
8679
exit 1
8780
fi
8881
}
8982

90-
echo "Commencing CoreCLR Repo build"
83+
echo "Commencing CoreFX Native build"
9184

9285
# Argument types supported by this script:
9386
#
@@ -97,7 +90,10 @@ echo "Commencing CoreCLR Repo build"
9790
# Set the default arguments for build
9891

9992
# Obtain the location of the bash script to figure out whether the root of the repo is.
100-
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
93+
94+
__ScriptDir="$( dirname "${BASH_SOURCE[0]}" )"
95+
__ScriptDir="$( cd $__ScriptDir && pwd )"
96+
__ProjectRoot="$( cd $__ScriptDir && cd ../.. && pwd )"
10197
__BuildArch=x64
10298
# Use uname to determine what the OS is.
10399
OSName=$(uname -s)
@@ -127,18 +123,14 @@ case $OSName in
127123
__BuildOS=Linux
128124
;;
129125
esac
130-
__MSBuildBuildArch=x64
131126
__BuildType=Debug
132127
__CMakeArgs=DEBUG
133128

134129
# Set the various build properties here so that CMake and MSBuild can pick them up
135130
__ProjectDir="$__ProjectRoot"
136-
__SourceDir="$__ProjectDir/src"
137-
__PackagesDir="$__ProjectDir/packages"
131+
__SourceDir="$__ScriptDir"
138132
__RootBinDir="$__ProjectDir/bin"
139-
__LogsDir="$__RootBinDir/Logs"
140133
__UnprocessedBuildArgs=
141-
__MSBCleanBuildArgs=
142134
__CleanBuild=false
143135
__VerboseBuild=false
144136
__ClangMajorVersion=3
@@ -187,12 +179,8 @@ for i in "$@"
187179
done
188180

189181
# Set the remaining variables based upon the determined build configuration
190-
__BinDir="$__RootBinDir/Product/$__BuildOS.$__BuildArch.$__BuildType"
191-
__PackagesBinDir="$__BinDir/.nuget"
192-
__ToolsDir="$__RootBinDir/tools"
193-
__TestWorkingDir="$__RootBinDir/tests/$__BuildOS.$__BuildArch.$__BuildType"
194-
__IntermediatesDir="$__RootBinDir/obj/$__BuildOS.$__BuildArch.$__BuildType"
195-
__TestIntermediatesDir="$__RootBinDir/tests/obj/$__BuildOS.$__BuildArch.$__BuildType"
182+
__IntermediatesDir="$__RootBinDir/obj/$__BuildOS.$__BuildArch.$__BuildType/Native"
183+
__BinDir="$__RootBinDir/$__BuildOS.$__BuildArch.$__BuildType/Native"
196184

197185
# Specify path to be set for CMAKE_INSTALL_PREFIX.
198186
# This is where all built CoreClr libraries will copied to.
@@ -216,12 +204,12 @@ setup_dirs
216204

217205
check_prereqs
218206

219-
# Build the coreclr (native) components.
207+
# Build the corefx native components.
220208

221-
build_coreclr
209+
build_corefx_native
222210

223211
# Build complete
224212

225-
echo "Repo successfully built."
213+
echo "CoreFX native components successfully built."
226214
echo "Product binaries are available at $__BinDir"
227215
exit 0

src/Native/gen-buildsys-clang.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ $# -lt 3 -o $# -gt 4 ]
77
then
88
echo "Usage..."
99
echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> [build flavor]"
10-
echo "Specify the path to the top level CMake file - <ProjectK>/src/NDP"
10+
echo "Specify the path to the top level CMake file - <corefx>/src/Native"
1111
echo "Specify the clang version to use, split into major and minor version"
1212
echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG."
1313
exit 1
@@ -104,7 +104,6 @@ if [[ -n "$LLDB_INCLUDE_DIR" ]]; then
104104
fi
105105

106106
cmake \
107-
"-DCMAKE_USER_MAKE_RULES_OVERRIDE=$1/src/pal/tools/clang-compiler-override.txt" \
108107
"-DCMAKE_AR=$llvm_ar" \
109108
"-DCMAKE_LINKER=$llvm_link" \
110109
"-DCMAKE_NM=$llvm_nm" \

0 commit comments

Comments
 (0)