Merge pull request #6764 from swgillespie/gc-interface-3
[platform/upstream/coreclr.git] / build.sh
1 #!/usr/bin/env bash
2
3 # resolve python-version to use
4 if [ "$PYTHON" == "" ] ; then
5     if which python >/dev/null 2>&1
6     then
7        PYTHON=python
8     elif which python2 >/dev/null 2>&1
9     then
10        PYTHON=python2
11     elif which python2.7 >/dev/null 2>&1
12     then
13        PYTHON=python2.7
14     else
15        echo "Unable to locate build-dependency python2.x!" 1>&2
16        exit 1
17     fi
18 fi
19
20 # validate python-dependency
21 # useful in case of explicitly set option.
22 if ! which $PYTHON > /dev/null 2>&1
23 then
24    echo "Unable to locate build-dependency python2.x ($PYTHON)!" 1>&2
25    exit 1
26 fi
27
28 usage()
29 {
30     echo "Usage: $0 [BuildArch] [BuildType] [verbose] [coverage] [cross] [clangx.y] [ninja] [configureonly] [skipconfigure] [skipnative] [skipmscorlib] [skiptests] [cmakeargs] [bindir]"
31     echo "BuildArch can be: x64, x86, arm, arm-softfp, arm64"
32     echo "BuildType can be: debug, checked, release"
33     echo "coverage - optional argument to enable code coverage build (currently supported only for Linux and OSX)."
34     echo "ninja - target ninja instead of GNU make"
35     echo "clangx.y - optional argument to build using clang version x.y."
36     echo "cross - optional argument to signify cross compilation,"
37     echo "      - will use ROOTFS_DIR environment variable if set."
38     echo "configureonly - do not perform any builds; just configure the build."
39     echo "skipconfigure - skip build configuration."
40     echo "skipnative - do not build native components."
41     echo "skipmscorlib - do not build mscorlib.dll."
42     echo "skiptests - skip the tests in the 'tests' subdirectory."
43     echo "skipnuget - skip building nuget packages."
44     echo "verbose - optional argument to enable verbose build output."
45     echo "-skiprestore: skip restoring packages ^(default: packages are restored during build^)."
46         echo "-disableoss: Disable Open Source Signing for System.Private.CoreLib."
47         echo "-sequential: force a non-parallel build ^(default is to build in parallel"
48         echo "   using all processors^)."
49         echo "-officialbuildid=^<ID^>: specify the official build ID to be used by this build."
50         echo "-Rebuild: passes /t:rebuild to the build projects."
51     echo "skipgenerateversion - disable version generation even if MSBuild is supported."
52     echo "cmakeargs - user-settable additional arguments passed to CMake."
53     echo "bindir - output directory (defaults to $__ProjectRoot/bin)"
54
55     exit 1
56 }
57
58 initDistroRid()
59 {
60     if [ "$__BuildOS" == "Linux" ]; then
61         if [ ! -e /etc/os-release ]; then
62             echo "WARNING: Can not determine runtime id for current distro."
63             export __DistroRid=""
64         else
65             source /etc/os-release
66             export __DistroRid="$ID.$VERSION_ID-$__HostArch"
67         fi
68     fi
69 }
70
71 setup_dirs()
72 {
73     echo Setting up directories for build
74
75     mkdir -p "$__RootBinDir"
76     mkdir -p "$__BinDir"
77     mkdir -p "$__LogsDir"
78     mkdir -p "$__IntermediatesDir"
79 }
80
81 # Check the system to ensure the right prereqs are in place
82
83 check_prereqs()
84 {
85     echo "Checking prerequisites..."
86
87     # Check presence of CMake on the path
88     hash cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script"; exit 1; }
89
90     # Check for clang
91     hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null ||  hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null ||  hash clang 2>/dev/null || { echo >&2 "Please install clang-$__ClangMajorVersion.$__ClangMinorVersion before running this script"; exit 1; }
92
93 }
94
95 build_coreclr()
96 {
97
98     if [ $__SkipCoreCLR == 1 ]; then
99         echo "Skipping CoreCLR build."
100         return
101     fi
102
103 # Event Logging Infrastructure
104    __GeneratedIntermediate="$__IntermediatesDir/Generated"
105    __GeneratedIntermediateEventProvider="$__GeneratedIntermediate/eventprovider_new"
106     if [[ -d "$__GeneratedIntermediateEventProvider" ]]; then
107         rm -rf  "$__GeneratedIntermediateEventProvider"
108     fi
109
110     if [[ ! -d "$__GeneratedIntermediate/eventprovider" ]]; then
111         mkdir -p "$__GeneratedIntermediate/eventprovider"
112     fi
113
114     mkdir -p "$__GeneratedIntermediateEventProvider"
115     if [[ $__SkipCoreCLR == 0 || $__ConfigureOnly == 1 ]]; then
116         echo "Laying out dynamically generated files consumed by the build system "
117         echo "Laying out dynamically generated Event Logging Test files"
118         $PYTHON -B -Wall -Werror "$__ProjectRoot/src/scripts/genXplatEventing.py" --man "$__ProjectRoot/src/vm/ClrEtwAll.man" --exc "$__ProjectRoot/src/vm/ClrEtwAllMeta.lst" --testdir "$__GeneratedIntermediateEventProvider/tests"
119
120         if  [[ $? != 0 ]]; then
121             exit
122         fi
123
124         #determine the logging system
125         case $__BuildOS in
126             Linux)
127                 echo "Laying out dynamically generated Event Logging Implementation of Lttng"
128                 $PYTHON -B -Wall -Werror "$__ProjectRoot/src/scripts/genXplatLttng.py" --man "$__ProjectRoot/src/vm/ClrEtwAll.man" --intermediate "$__GeneratedIntermediateEventProvider"
129                 if  [[ $? != 0 ]]; then
130                     exit
131                 fi
132                 ;;
133             *)
134                 ;;
135         esac
136     fi
137
138     echo "Cleaning the temp folder of dynamically generated Event Logging files"
139     $PYTHON -B -Wall -Werror -c "import sys;sys.path.insert(0,\"$__ProjectRoot/src/scripts\"); from Utilities import *;UpdateDirectory(\"$__GeneratedIntermediate/eventprovider\",\"$__GeneratedIntermediateEventProvider\")"
140     if  [[ $? != 0 ]]; then
141         exit
142     fi
143
144     rm -rf "$__GeneratedIntermediateEventProvider"
145
146     # All set to commence the build
147
148     echo "Commencing build of native components for $__BuildOS.$__BuildArch.$__BuildType in $__IntermediatesDir"
149
150     generator=""
151     buildFile="Makefile"
152     buildTool="make"
153     if [ $__UseNinja == 1 ]; then
154         generator="ninja"
155         buildFile="build.ninja"
156         if which ninja >/dev/null 2>&1; then
157             buildTool="ninja"
158         elif which ninja-build >/dev/null 2>&1; then
159             buildTool="ninja-build"
160         else
161            echo "Unable to locate ninja!" 1>&2
162            exit 1
163         fi
164     fi
165
166     if [ $__SkipConfigure == 0 ]; then
167         # if msbuild is not supported, then set __SkipGenerateVersion to 1
168         if [ $__isMSBuildOnNETCoreSupported == 0 ]; then __SkipGenerateVersion=1; fi
169         # Drop version.c file
170         __versionSourceFile=$__IntermediatesDir/version.cpp
171         if [ $__SkipGenerateVersion == 0 ]; then
172             "$__ProjectRoot/run.sh" build -Project=$__ProjectDir/build.proj -generateHeaderUnix -NativeVersionSourceFile=$__versionSourceFile $__RunArgs $__UnprocessedBuildArgs
173         else
174             __versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
175             echo $__versionSourceLine > $__versionSourceFile
176         fi
177
178                 pushd "$__IntermediatesDir"
179         # Regenerate the CMake solution
180         echo "Invoking \"$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh\" \"$__ProjectRoot\" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator $__cmakeargs"
181         "$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator "$__cmakeargs"
182         popd
183     fi
184
185     # Check that the makefiles were created.
186     pushd "$__IntermediatesDir"
187     
188     if [ ! -f "$__IntermediatesDir/$buildFile" ]; then
189         echo "Failed to generate native component build project!"
190         exit 1
191     fi
192
193     # Get the number of processors available to the scheduler
194     # Other techniques such as `nproc` only get the number of
195     # processors available to a single process.
196     if [ `uname` = "FreeBSD" ]; then
197         NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
198     elif [ `uname` = "NetBSD" ]; then
199         NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
200     else
201         NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
202     fi
203
204     # Build CoreCLR
205
206     if [ $__ConfigureOnly == 1 ]; then
207         echo "Skipping CoreCLR build."
208         return
209     fi
210
211     echo "Executing $buildTool install -j $NumProc"
212
213     $buildTool install -j $NumProc
214     if [ $? != 0 ]; then
215         echo "Failed to build coreclr components."
216         exit 1
217     fi
218         popd
219 }
220
221 isMSBuildOnNETCoreSupported()
222 {
223     # This needs to be updated alongwith corresponding changes to netci.groovy.
224     __isMSBuildOnNETCoreSupported=0
225
226     if [ "$__HostArch" == "x64" ]; then
227         if [ "$__HostOS" == "Linux" ]; then
228             case "$__DistroRid" in
229                 "centos.7-x64")
230                     __isMSBuildOnNETCoreSupported=1
231                     ;;
232                 "debian.8-x64")
233                     __isMSBuildOnNETCoreSupported=1
234                     ;;
235                 "fedora.23-x64")
236                     __isMSBuildOnNETCoreSupported=1
237                     ;;
238                 "fedora.24-x64")
239                     __isMSBuildOnNETCoreSupported=1
240                     ;;
241                 "opensuse.13.2-x64")
242                     __isMSBuildOnNETCoreSupported=1
243                     ;;
244                 "opensuse.42.1-x64")
245                     __isMSBuildOnNETCoreSupported=1
246                     ;;
247                 "rhel.7.2-x64")
248                     __isMSBuildOnNETCoreSupported=1
249                     ;;
250                 "ubuntu.14.04-x64")
251                     __isMSBuildOnNETCoreSupported=1
252                     ;;
253                 "ubuntu.16.04-x64")
254                     __isMSBuildOnNETCoreSupported=1
255                     ;;
256                 "ubuntu.16.10-x64")
257                     __isMSBuildOnNETCoreSupported=1
258                     ;;
259                 *)
260             esac
261         elif [ "$__HostOS" == "OSX" ]; then
262             __isMSBuildOnNETCoreSupported=1
263         fi
264     fi
265 }
266
267 build_CoreLib_ni()
268 {
269     if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then
270         echo "Generating native image for System.Private.CoreLib."
271         $__BinDir/crossgen $__BinDir/System.Private.CoreLib.dll
272         if [ $? -ne 0 ]; then
273             echo "Failed to generate native image for System.Private.CoreLib."
274             exit 1
275         fi
276
277         echo "Generating native image for MScorlib Facade."
278         $__BinDir/crossgen $__BinDir/mscorlib.dll
279         if [ $? -ne 0 ]; then
280             echo "Failed to generate native image for mscorlib facade."
281             exit 1
282         fi
283
284         if [ "$__BuildOS" == "Linux" ]; then
285             echo "Generating symbol file for System.Private.CoreLib."
286             $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.ni.dll
287             if [ $? -ne 0 ]; then
288                 echo "Failed to generate symbol file for System.Private.CoreLib."
289                 exit 1
290             fi
291         fi
292     fi
293 }
294
295 build_CoreLib()
296 {
297
298     if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
299         echo "System.Private.CoreLib.dll build unsupported."
300         return
301     fi
302
303     if [ $__SkipMSCorLib == 1 ]; then
304        echo "Skipping building System.Private.CoreLib."
305        return
306     fi
307
308     echo "Commencing build of managed components for $__BuildOS.$__BuildArch.$__BuildType"
309
310     # Invoke MSBuild
311     $__ProjectRoot/run.sh build -Project=$__ProjectDir/build.proj -MsBuildLog="/flp:Verbosity=normal;LogFile=$__LogsDir/System.Private.CoreLib_$__BuildOS__$__BuildArch__$__BuildType.log" -BuildTarget -__IntermediatesDir=$__IntermediatesDir -__RootBinDir=$__RootBinDir -BuildNugetPackage=false -UseSharedCompilation=false $__RunArgs $__UnprocessedBuildArgs
312
313     if [ $? -ne 0 ]; then
314         echo "Failed to build managed components."
315         exit 1
316     fi
317
318     # The cross build generates a crossgen with the target architecture.
319     if [ $__CrossBuild != 1 ]; then
320        # The architecture of host pc must be same architecture with target.
321        if [[ ( "$__HostArch" == "$__BuildArch" ) ]]; then
322            build_CoreLib_ni
323        elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "x86" ) ]]; then
324            build_CoreLib_ni
325        elif [[ ( "$__HostArch" == "arm64" ) && ( "$__BuildArch" == "arm" ) ]]; then
326            build_CoreLib_ni
327        else 
328            exit 1
329        fi
330     fi 
331 }
332
333 generate_NugetPackages()
334 {
335     # We can only generate nuget package if we also support building mscorlib as part of this build.
336     if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
337         echo "Nuget package generation unsupported."
338         return
339     fi
340
341     # Since we can build mscorlib for this OS, did we build the native components as well?
342     if [ $__SkipCoreCLR == 1 ]; then
343         echo "Unable to generate nuget packages since native components were not built."
344         return
345     fi
346
347     echo "Generating nuget packages for "$__BuildOS
348
349     # Build the packages
350     $__ProjectRoot/run.sh build -Project=$__SourceDir/.nuget/packages.builds -MsBuildLog="/flp:Verbosity=normal;LogFile=$__LogsDir/Nuget_$__BuildOS__$__BuildArch__$__BuildType.log" -BuildTarget -__IntermediatesDir=$__IntermediatesDir -__RootBinDir=$__RootBinDir -BuildNugetPackage=false -UseSharedCompilation=false $__RunArgs $__UnprocessedBuildArgs
351
352     if [ $? -ne 0 ]; then
353         echo "Failed to generate Nuget packages."
354         exit 1
355     fi
356 }
357
358 echo "Commencing CoreCLR Repo build"
359
360 # Argument types supported by this script:
361 #
362 # Build architecture - valid values are: x64, ARM.
363 # Build Type         - valid values are: Debug, Checked, Release
364 #
365 # Set the default arguments for build
366
367 # Obtain the location of the bash script to figure out where the root of the repo is.
368 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
369
370 # Use uname to determine what the CPU is.
371 CPUName=$(uname -p)
372 # Some Linux platforms report unknown for platform, but the arch for machine.
373 if [ "$CPUName" == "unknown" ]; then
374     CPUName=$(uname -m)
375 fi
376
377 case $CPUName in
378     i686)
379         echo "Unsupported CPU $CPUName detected, build might not succeed!"
380         __BuildArch=x86
381         __HostArch=x86
382         ;;
383
384     x86_64)
385         __BuildArch=x64
386         __HostArch=x64
387         ;;
388
389     armv7l)
390         echo "Unsupported CPU $CPUName detected, build might not succeed!"
391         __BuildArch=arm
392         __HostArch=arm
393         ;;
394
395     aarch64)
396         echo "Unsupported CPU $CPUName detected, build might not succeed!"
397         __BuildArch=arm64
398         __HostArch=arm64
399         ;;
400
401     *)
402         echo "Unknown CPU $CPUName detected, configuring as if for x64"
403         __BuildArch=x64
404         __HostArch=x64
405         ;;
406 esac
407
408 # Use uname to determine what the OS is.
409 OSName=$(uname -s)
410 case $OSName in
411     Linux)
412         __BuildOS=Linux
413         __HostOS=Linux
414         ;;
415
416     Darwin)
417         __BuildOS=OSX
418         __HostOS=OSX
419         ;;
420
421     FreeBSD)
422         __BuildOS=FreeBSD
423         __HostOS=FreeBSD
424         ;;
425
426     OpenBSD)
427         __BuildOS=OpenBSD
428         __HostOS=OpenBSD
429         ;;
430
431     NetBSD)
432         __BuildOS=NetBSD
433         __HostOS=NetBSD
434         ;;
435
436     SunOS)
437         __BuildOS=SunOS
438         __HostOS=SunOS
439         ;;
440
441     *)
442         echo "Unsupported OS $OSName detected, configuring as if for Linux"
443         __BuildOS=Linux
444         __HostOS=Linux
445         ;;
446 esac
447
448 __BuildType=Debug
449 __CodeCoverage=
450 __IncludeTests=Include_Tests
451
452 # Set the various build properties here so that CMake and MSBuild can pick them up
453 __ProjectDir="$__ProjectRoot"
454 __SourceDir="$__ProjectDir/src"
455 __PackagesDir="$__ProjectDir/packages"
456 __RootBinDir="$__ProjectDir/bin"
457 __UnprocessedBuildArgs=
458 __RunArgs=
459 __MSBCleanBuildArgs=
460 __UseNinja=0
461 __VerboseBuild=0
462 __ConfigureOnly=0
463 __SkipConfigure=0
464 __SkipRestore=""
465 __SkipNuget=0
466 __SkipCoreCLR=0
467 __SkipMSCorLib=0
468 __CrossBuild=0
469 __ClangMajorVersion=0
470 __ClangMinorVersion=0
471 __NuGetPath="$__PackagesDir/NuGet.exe"
472 __DistroRid=""
473 __cmakeargs=""
474 __SkipGenerateVersion=0
475
476 while :; do
477     if [ $# -le 0 ]; then
478         break
479     fi
480
481     lowerI="$(echo $1 | awk '{print tolower($0)}')"
482     case $lowerI in
483         -\?|-h|--help)
484             usage
485             exit 1
486             ;;
487
488         x86)
489             __BuildArch=x86
490             ;;
491
492         x64)
493             __BuildArch=x64
494             ;;
495
496         arm)
497             __BuildArch=arm
498             ;;
499
500         arm-softfp)
501             __BuildArch=arm-softfp
502             ;;
503
504         arm64)
505             __BuildArch=arm64
506             ;;
507
508         debug)
509             __BuildType=Debug
510             ;;
511
512         checked)
513             __BuildType=Checked
514             ;;
515
516         release)
517             __BuildType=Release
518             ;;
519
520         coverage)
521             __CodeCoverage=Coverage
522             ;;
523
524         cross)
525             __CrossBuild=1
526             ;;
527
528                 verbose)
529         __VerboseBuild=1
530         ;;
531
532         clang3.5)
533             __ClangMajorVersion=3
534             __ClangMinorVersion=5
535             ;;
536
537         clang3.6)
538             __ClangMajorVersion=3
539             __ClangMinorVersion=6
540             ;;
541
542         clang3.7)
543             __ClangMajorVersion=3
544             __ClangMinorVersion=7
545             ;;
546
547         clang3.8)
548             __ClangMajorVersion=3
549             __ClangMinorVersion=8
550             ;;
551
552         clang3.9)
553             __ClangMajorVersion=3
554             __ClangMinorVersion=9
555             ;;
556
557         ninja)
558             __UseNinja=1
559             ;;
560
561         configureonly)
562             __ConfigureOnly=1
563             __SkipMSCorLib=1
564             __SkipNuget=1
565             __IncludeTests=
566             ;;
567
568         skipconfigure)
569             __SkipConfigure=1
570             ;;
571
572         skipnative)
573             # Use "skipnative" to use the same option name as build.cmd.
574             __SkipCoreCLR=1
575             ;;
576
577         skipcoreclr)
578             # Accept "skipcoreclr" for backwards-compatibility.
579             __SkipCoreCLR=1
580             ;;
581
582         skipmscorlib)
583             __SkipMSCorLib=1
584             ;;
585
586         skipgenerateversion)
587             __SkipGenerateVersion=1
588             ;;
589
590         includetests)
591             ;;
592
593         skiptests)
594             __IncludeTests=
595             ;;
596
597         skipnuget)
598             __SkipNuget=1
599             ;;
600
601         cmakeargs)
602             if [ -n "$2" ]; then
603                 __cmakeargs="$2"
604                 shift
605             else
606                 echo "ERROR: 'cmakeargs' requires a non-empty option argument"
607                 exit 1
608             fi
609             ;;
610
611         bindir)
612             if [ -n "$2" ]; then
613                 __RootBinDir="$2"
614                 if [ ! -d $__RootBinDir ]; then
615                     mkdir $__RootBinDir
616                 fi
617                 __RootBinParent=$(dirname $__RootBinDir)
618                 __RootBinName=${__RootBinDir##*/}
619                 __RootBinDir="$(cd $__RootBinParent &>/dev/null && printf %s/%s $PWD $__RootBinName)"
620                 shift
621             else
622                 echo "ERROR: 'bindir' requires a non-empty option argument"
623                 exit 1
624             fi
625             ;;
626
627         *)
628             __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
629             ;;
630     esac
631
632     shift
633 done
634
635 __RunArgs="-BuildArch=$__BuildArch -BuildType=$__BuildType -BuildOS=$__BuildOS"
636
637 # Configure environment if we are doing a verbose build
638 if [ $__VerboseBuild == 1 ]; then
639     export VERBOSE=1
640         __RunArgs="$__RunArgs -verbose"
641 fi
642
643 # Set default clang version
644 if [[ $__ClangMajorVersion == 0 && $__ClangMinorVersion == 0 ]]; then
645     if [ $__CrossBuild == 1 ]; then
646         __ClangMajorVersion=3
647         __ClangMinorVersion=6
648     else
649         __ClangMajorVersion=3
650         __ClangMinorVersion=5
651     fi
652 fi
653
654 # Set dependent variables
655 __LogsDir="$__RootBinDir/Logs"
656
657 # init the distro name
658 initDistroRid
659
660 # Set the remaining variables based upon the determined build configuration
661 __BinDir="$__RootBinDir/Product/$__BuildOS.$__BuildArch.$__BuildType"
662 __PackagesBinDir="$__BinDir/.nuget"
663 __ToolsDir="$__RootBinDir/tools"
664 __TestWorkingDir="$__RootBinDir/tests/$__BuildOS.$__BuildArch.$__BuildType"
665 export __IntermediatesDir="$__RootBinDir/obj/$__BuildOS.$__BuildArch.$__BuildType"
666 __TestIntermediatesDir="$__RootBinDir/tests/obj/$__BuildOS.$__BuildArch.$__BuildType"
667 __isMSBuildOnNETCoreSupported=0
668
669 # Init if MSBuild for .NET Core is supported for this platform
670 isMSBuildOnNETCoreSupported
671
672 # CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to set.
673 # This is needed by CLI to function.
674 if [ -z "$HOME" ]; then
675     if [ ! -d "$__ProjectDir/temp_home" ]; then
676         mkdir temp_home
677     fi
678     export HOME=$__ProjectDir/temp_home
679     echo "HOME not defined; setting it to $HOME"
680 fi
681
682 # Specify path to be set for CMAKE_INSTALL_PREFIX.
683 # This is where all built CoreClr libraries will copied to.
684 export __CMakeBinDir="$__BinDir"
685
686 # Configure environment if we are doing a cross compile.
687 if [ $__CrossBuild == 1 ]; then
688     export CROSSCOMPILE=1
689     if ! [[ -n "$ROOTFS_DIR" ]]; then
690         export ROOTFS_DIR="$__ProjectRoot/cross/rootfs/$__BuildArch"
691     fi
692 fi
693
694 # Make the directories necessary for build if they don't exist
695
696 setup_dirs
697
698 # Check prereqs.
699
700 check_prereqs
701
702 # Build the coreclr (native) components.
703
704 build_coreclr
705
706 # Build System.Private.CoreLib.
707
708 build_CoreLib
709
710 # Generate nuget packages
711 if [ $__SkipNuget != 1 ]; then
712     generate_NugetPackages
713 fi
714
715
716 # Build complete
717
718 echo "Repo successfully built."
719 echo "Product binaries are available at $__BinDir"
720 exit 0