Author: dreimer
Date: Wed Apr 30 14:36:11 2008
New Revision: 33197
URL:
http://svn.reactos.org/svn/reactos?rev=33197&view=rev
Log:
Progress to get Build script work. But not ready yet. It does not interpret the commands
in the lines which should start the compiler.
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1
trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1
trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/Build.ps1 [iso-8859-1] Wed Apr 30 14:36:11
2008
@@ -13,118 +13,99 @@
# Check if config.template.rbuild is newer than config.rbuild, if it is then
# abort the build and inform the user.
#
-if exist .\config.rbuild (
- "%_ROSBE_BASEDIR%\Tools\chknewer.exe" .\config.template.rbuild
.\config.rbuild
- if !errorlevel! == 1 (
- echo.
- echo *** config.template.rbuild is newer than config.rbuild ***
- echo *** aborting build. Please check for changes and ***
- echo *** update your config.rbuild. ***
- echo.
- endlocal
- goto :EOC
- )
-)
+if (Test-Path ".\config.rbuild") {
+ "$_ROSBE_BASEDIR\Tools\chknewer.exe .\config.template.rbuild
.\config.rbuild"
+ if (errorlevel -eq 1) {
+ ""
+ "*** config.template.rbuild is newer than config.rbuild ***"
+ "*** aborting build. Please check for changes and ***"
+ "*** update your config.rbuild. ***"
+ ""
+ exit
+ }
+}
#
# Check if strip or ccache are being used and set the appropriate options.
#
-if defined _ROSBE_STRIP (
- if %_ROSBE_STRIP% == 1 (
- set ROS_LEAN_AND_MEAN=yes
- ) else (
- set ROS_LEAN_AND_MEAN=no
- )
-)
-if defined _ROSBE_USECCACHE (
- if %_ROSBE_USECCACHE% == 1 (
- set CCACHE_DIR=%APPDATA%\RosBE\.ccache
- set HOST_CC=ccache gcc
- set HOST_CPP=ccache g++
- set TARGET_CC=ccache gcc
- set TARGET_CPP=ccache g++
- ) else (
- set HOST_CC=gcc
- set HOST_CPP=g++
- set TARGET_CC=gcc
- set TARGET_CPP=g++
- )
-)
+if ($_ROSBE_STRIP -ne $null) {
+ if ($_ROSBE_STRIP -ne 1) {
+ $ENV:ROS_LEAN_AND_MEAN = "yes"
+ } else {
+ $ENV:ROS_LEAN_AND_MEAN = "no"
+ }
+}
+if ($_ROSBE_USECCACHE -ne $null) {
+ if ($_ROSBE_USECCACHE -eq 1) {
+ $ENV:CCACHE_DIR = "$APPDATA\RosBE\.ccache"
+ $ENV:HOST_CC = "ccache gcc"
+ $ENV:HOST_CPP = "ccache g++"
+ $ENV:TARGET_CC = "ccache gcc"
+ $ENV:TARGET_CPP = "ccache g++"
+ } else {
+ $ENV:HOST_CC = "gcc"
+ $ENV:HOST_CPP = "g++"
+ $ENV:TARGET_CC = "gcc"
+ $ENV:TARGET_CPP = "g++"
+ }
+}
#
# Check if the user has chosen to use a different object or output path
# and set it accordingly.
#
-if defined _ROSBE_OBJPATH (
- if not exist "%_ROSBE_OBJPATH%\." (
- echo ERROR: The path specified doesn't seem to exist.
- goto :EOC
- ) else (
- set ROS_INTERMEDIATE=%_ROSBE_OBJPATH%
- )
-)
-if defined _ROSBE_OUTPATH (
- if not exist "%_ROSBE_OUTPATH%\." (
- echo ERROR: The path specified doesn't seem to exist.
- goto :EOC
- ) else (
- set ROS_OUTPUT=%_ROSBE_OUTPATH%
- set ROS_TEMPORARY=%_ROSBE_OUTPATH%
- )
-)
+if ($_ROSBE_OBJPATH -ne $null) {
+ if ( Test-Path "$_ROSBE_OBJPATH\.") {
+ "ERROR: The path specified doesn't seem to exist."
+ exit
+ } else {
+ $ENV:ROS_INTERMEDIATE = "$_ROSBE_OBJPATH"
+ }
+}
+if ($_ROSBE_OUTPATH -ne $null) {
+ if (Test-Path "$_ROSBE_OUTPATH\.") {
+ "ERROR: The path specified doesn't seem to exist."
+ exit
+ } else {
+ $ENV:ROS_OUTPUT = "$_ROSBE_OUTPATH"
+ $ENV:ROS_TEMPORARY = "$_ROSBE_OUTPATH"
+ }
+}
#
# Get the current date and time for use in in our build log's file name.
#
-call "%_ROSBE_BASEDIR%\TimeDate.cmd"
+$DATENAME = get-date -f d
+$TIMENAME = get-date -f t
+
#
# Check if writing logs is enabled, if so check if our log directory
# exists, if it doesn't, create it.
#
-if %_ROSBE_WRITELOG% == 1 (
- if not exist "%_ROSBE_LOGDIR%\." (
- mkdir "%_ROSBE_LOGDIR%" 1> NUL 2> NUL
- )
-)
+if ($_ROSBE_WRITELOG -eq 1) {
+ if (Test-Path "$_ROSBE_LOGDIR\.") {
+ mkdir "$_ROSBE_LOGDIR" 1> NUL 2> NUL
+ }
+}
-#
-# Check if we are using -j or not.
-#
-if "%1" == "multi" (
- if not "%2" == "" (
- title 'makex %2' parallel build started: %TIMERAW%
- ) else (
- title 'makex' parallel build started: %TIMERAW%
- )
- call :BUILDMULTI %*
-) else (
- if not "%1" == "" (
- title 'make %1' build started: %TIMERAW%
- ) else (
- title 'make' build started: %TIMERAW%
- )
- call :BUILD %*
-)
-goto :EOC
+function BUILD {
+ if ($_ROSBE_SHOWTIME -eq 1) {
+ if ($_ROSBE_WRITELOG -eq 1) {
+ """$_ROSBE_BASEDIR\Tools\buildtime.exe""
""$_ROSBE_MINGWMAKE"" $args[0..5] 2>&1 |
""$_ROSBE_BASEDIR\Tools\tee.exe""
""$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt"""
+ } else {
+ """$_ROSBE_BASEDIR\Tools\buildtime.exe""
""$_ROSBE_MINGWMAKE"" $args[0..5]"
+ }
+ } else {
+ if ($_ROSBE_WRITELOG -eq 1) {
+ """$_ROSBE_MINGWMAKE"" $args[0..5] 2>&1 |
""$_ROSBE_BASEDIR\Tools\tee.exe""
""$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt"""
+ } else {
+ """$_ROSBE_MINGWMAKE"" $args[0..5]"
+ }
+ }
+}
-:BUILD
- if %_ROSBE_SHOWTIME% == 1 (
- if %_ROSBE_WRITELOG% == 1 (
- "%_ROSBE_BASEDIR%\Tools\buildtime.exe"
"%_ROSBE_MINGWMAKE%" %* 2>&1 | "%_ROSBE_BASEDIR%\Tools\tee.exe"
"%_ROSBE_LOGDIR%\BuildLog-%_ROSBE_GCCVERSION%-%DATENAME%-%TIMENAME%.txt"
- ) else (
- "%_ROSBE_BASEDIR%\Tools\buildtime.exe"
"%_ROSBE_MINGWMAKE%" %*
- )
- ) else (
- if %_ROSBE_WRITELOG% == 1 (
- "%_ROSBE_MINGWMAKE%" %* 2>&1 |
"%_ROSBE_BASEDIR%\Tools\tee.exe"
"%_ROSBE_LOGDIR%\BuildLog-%_ROSBE_GCCVERSION%-%DATENAME%-%TIMENAME%.txt"
- ) else (
- "%_ROSBE_MINGWMAKE%" %*
- )
- )
-goto :EOF
-
-:BUILDMULTI
+function BUILDMULTI {
#
# Get the number of CPUs in the system so we know how many jobs to execute.
# To modify the number used alter the options used with cpucount:
@@ -133,43 +114,65 @@
# -x2 - Number of CPUs, doubled.
# -a - Determine the cpu count based on the inherited process affinity mask.
#
- for /f "usebackq" %%i in (`"%_ROSBE_BASEDIR%\Tools\cpucount.exe"
-x1`) do set CPUCOUNT=%%i
+# for /f "usebackq" %%i in (`"%_ROSBE_BASEDIR%\Tools\cpucount.exe"
-x1`) do set CPUCOUNT=%%i
- if %_ROSBE_SHOWTIME% == 1 (
- if %_ROSBE_WRITELOG% == 1 (
- "%_ROSBE_BASEDIR%\Tools\buildtime.exe"
"%_ROSBE_MINGWMAKE%" -j %CPUCOUNT% %2 %3 %4 %5 %6 %7 %8 %9 2>&1 |
"%_ROSBE_BASEDIR%\Tools\tee.exe"
"%_ROSBE_LOGDIR%\BuildLog-%_ROSBE_GCCVERSION%-%DATENAME%-%TIMENAME%.txt"
- ) else (
- "%_ROSBE_BASEDIR%\Tools\buildtime.exe"
"%_ROSBE_MINGWMAKE%" -j %CPUCOUNT% %2 %3 %4 %5 %6 %7 %8 %9
- )
- ) else (
- if %_ROSBE_WRITELOG% == 1 (
- "%_ROSBE_MINGWMAKE%" -j %CPUCOUNT% %2 %3 %4 %5 %6 %7 %8 %9
2>&1 | "%_ROSBE_BASEDIR%\Tools\tee.exe"
"%_ROSBE_LOGDIR%\BuildLog-%_ROSBE_GCCVERSION%-%DATENAME%-%TIMENAME%.txt"
- ) else (
- "%_ROSBE_MINGWMAKE%" -j %CPUCOUNT% %2 %3 %4 %5 %6 %7 %8 %9
- )
- )
-goto :EOF
+ if ($_ROSBE_SHOWTIME -eq 1) {
+ if ($_ROSBE_WRITELOG -eq 1) {
+# "$_ROSBE_BASEDIR\Tools\buildtime.exe"
"$_ROSBE_MINGWMAKE" -j $CPUCOUNT %2 %3 %4 %5 %6 %7 %8 %9 2>&1 |
"$_ROSBE_BASEDIR\Tools\tee.exe"
"$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt"
+ } else {
+# "$_ROSBE_BASEDIR\Tools\buildtime.exe"
"$_ROSBE_MINGWMAKE" -j $CPUCOUNT %2 %3 %4 %5 %6 %7 %8 %9
+ }
+ } else {
+ if ($_ROSBE_WRITELOG -eq 1) {
+# "$_ROSBE_MINGWMAKE" -j $CPUCOUNT %2 %3 %4 %5 %6 %7 %8 %9
2>&1 | "$_ROSBE_BASEDIR\Tools\tee.exe"
"$_ROSBE_LOGDIR\BuildLog-$_ROSBE_GCCVERSION-$DATENAME-$TIMENAME.txt"
+ } else {
+# "$_ROSBE_MINGWMAKE" -j $CPUCOUNT %2 %3 %4 %5 %6 %7 %8 %9
+ }
+ }
+}
-:EOC
+#
+# Check if we are using -j or not.
+#
+if ($args.count -gt 1) {
+if ($args[0] -eq "multi") {
+ if ($args[1] -ne "") {
+ $host.ui.RawUI.WindowTitle = "makex $args[1] parallel build started:
$TIMERAW"
+ } else {
+ $host.ui.RawUI.WindowTitle = "makex parallel build started: $TIMERAW"
+ }
+BUILDMULTI
+}
+} else {
+if ($args.count -gt 0) {
+ if ($args[0] -ne "") {
+ $host.ui.RawUI.WindowTitle = "make $args[1] build started: $TIMERAW"
+ } else {
+ $host.ui.RawUI.WindowTitle = "make build started: $TIMERAW"
+ }
+BUILD
+}
+}
+
#
# Highlight the fact that building has ended.
#
-"%_ROSBE_BASEDIR%\Tools\flash.exe"
+"$_ROSBE_BASEDIR\Tools\flash.exe"
-if defined _ROSBE_VERSION (
- title ReactOS Build Environment %_ROSBE_VERSION%
-)
+if ($_ROSBE_VERSION -ne $null) {
+$host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
+}
#
# Unload all used Vars.
#
-set ROS_LEAN_AND_MEAN=
-set HOST_CC=
-set HOST_CPP=
-set TARGET_CC=
-set TARGET_CPP=
-set ROS_INTERMEDIATE=
-set ROS_OUTPUT=
-set ROS_TEMPORARY=
-set CPUCOUNT=
-set CCACHE_DIR=
+$ENV:ROS_LEAN_AND_MEAN = ""
+$ENV:HOST_CC = ""
+$ENV:HOST_CPP = ""
+$ENV:TARGET_CC = ""
+$ENV:TARGET_CPP = ""
+$ENV:ROS_INTERMEDIATE = ""
+$ENV:ROS_OUTPUT = ""
+$ENV:ROS_TEMPORARY = ""
+$ENV:CPUCOUNT = ""
+$ENV:CCACHE_DIR = ""
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/rosbe-gcc-env.ps1 [iso-8859-1] Wed Apr 30
14:36:11 2008
@@ -22,12 +22,12 @@
# Set up the GCC 4.x.x build environment.
#
$ENV:PATH = "$_ROSBE_MINGWPATH\bin;$_ROSBE_ORIGINALPATH"
-$_ROSBE_GCCVERSION = $null
-$_ROSBE_GCCTARGET = $null
+$global:_ROSBE_GCCVERSION = $null
+$global:_ROSBE_GCCTARGET = $null
#for /f "usebackq tokens=3" %%i in (`"gcc -v 2>&1 | find "gcc
version""`) do set _ROSBE_GCCVERSION=%%i
#for /f "usebackq tokens=2" %%i in (`"gcc -v 2>&1 | find
"Target""`) do set _ROSBE_GCCTARGET=%%i
$ENV:PATH =
"$_ROSBE_MINGWPATH\bin;$_ROSBE_MINGWPATH\libexec\gcc\$_ROSBE_GCCTARGET\$_ROSBE_GCCVERSION;$_ROSBE_ORIGINALPATH"
-$_ROSBE_MINGWMAKE = "$_ROSBE_MINGWPATH\bin\mingw32-make.exe"
+$global:_ROSBE_MINGWMAKE = "$_ROSBE_MINGWPATH\bin\mingw32-make.exe"
if ($_ROSBE_MODE = "MinGW") {
$ENV:C_INCLUDE_PATH =
"$_ROSBE_MINGWPATH\include;$_ROSBE_MINGWPATH\lib\gcc\$_ROSBE_GCCTARGET\$_ROSBE_GCCVERSION\include"
$ENV:CPLUS_INCLUDE_PATH =
"$_ROSBE_MINGWPATH\include;$_ROSBE_MINGWPATH\include\c++\$_ROSBE_GCCVERSION;$_ROSBE_MINGWPATH\include\c++\$_ROSBE_GCCVERSION\$_ROSBE_GCCTARGET;$_ROSBE_MINGWPATH\lib\gcc\$_ROSBE_GCCTARGET\$_ROSBE_GCCVERSION\include"
Modified: trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Ros…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] Wed Apr 30 14:36:11 2008
@@ -66,7 +66,7 @@
if not "%1" == "" (
cls
echo Unknown parameter specified. Exiting.
- goto :EOC
+ goto :EOF
)
cls
@@ -108,7 +108,7 @@
)
endlocal
-goto :EOC
+goto :EOF
::
:: Display the banner and set up the environment for the GCC 4.x.x build
@@ -146,5 +146,3 @@
if not exist "%_ROSBE_BASEDIR%\sSVN.cmd" ( doskey SVN= )
if not exist "%_ROSBE_BASEDIR%\options.cmd" ( doskey OPTIONS= )
goto :EOF
-
-:EOC