Author: gedmurphy
Date: Tue Dec 1 19:39:49 2009
New Revision: 44342
URL:
http://svn.reactos.org/svn/reactos?rev=44342&view=rev
Log:
Add a root level batch file which allows building reactos without invoking RosBE.
It won't currently work without RosBE as it relies in the gcc toolset installed along
with RosBE to go about its business.
It currently checks for RosBE existence with a rather hackish ^H^H^H^H ... elaborate
string parser using the 'reg' command line util output. I'd be happy for
anyone to improve on this.
Added:
trunk/reactos/rosbuild.bat (with props)
Added: trunk/reactos/rosbuild.bat
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/rosbuild.bat?rev=44342&…
==============================================================================
--- trunk/reactos/rosbuild.bat (added)
+++ trunk/reactos/rosbuild.bat [iso-8859-1] Tue Dec 1 19:39:49 2009
@@ -1,0 +1,108 @@
+::
+:: Call from Makefile command line within Visual Studio with the following parameters:
+::
+:: %1 - $(build)
+:: %2 - $(target)
+::
+:: Examples:
+::
+:: Call build.bat build ntoskrnl
+:: Call build.bat clean win32k
+::
+
+@echo off
+
+if "%1"=="" goto :err_params
+if "%2"=="" goto :err_params
+
+
+:: Get the RosBE path... ::
+
+:: Set the command we'll use to check if RosBE exists
+set _IS_ROSBE_INSTALLED_COMMAND="reg query
"HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\ReactOS Build Environment
for Windows" /v UninstallString"
+
+:: Check the key actually exists !!!!FIXME: Why is this returning 'The system cannot
find the path specified.'!!!!
+%_IS_ROSBE_INSTALLED_COMMAND%
+IF NOT errorlevel 0 goto :err_no_rosbe
+
+:: This is a bit hackish. What we do is look for REG_SZ which is the second token on the
second line and dump it into i
+:: We then assign all remaining text to the next variable in the sequence, which is j.
This leaves us with the path
+for /F "tokens=2,* skip=1 delims=\ " %%i in
('%_IS_ROSBE_INSTALLED_COMMAND%') do (
+ set _ROSBE_UNINSTALL_PATH_=%%j
+)
+
+
+:: Now strip the file name from the end of the path and we should have our RosBE install
directory
+set _ROSBE_PATH_DIR=
+set _ROSBE_PATH_=
+for %%i in ("%_ROSBE_UNINSTALL_PATH_%") do set _ROSBE_PATH_DIR=%%~di
+for %%i in ("%_ROSBE_UNINSTALL_PATH_%") do set "_ROSBE_PATH_=%%~pi"
+set "_ROSBE_FULL_PATH_=%_ROSBE_PATH_DIR%%_ROSBE_PATH_%"
+::echo RosBE insall path = %_ROSBE_FULL_PATH_%
+
+:: Set the path which contains our build tools
+set _ROSBE_BIN_PATH=%_ROSBE_FULL_PATH_%\i386\bin
+
+:: Set the make.exe path
+set _MAKE_COMMAND=%_ROSBE_BIN_PATH%\mingw32-make.exe
+
+:: This file is located in the source root
+set _ROS_SOURCE_ROOT=%~dp0
+
+:: Add the path to the search path
+path=%path%;%_ROSBE_BIN_PATH%
+
+:: Change the current dir to the source root
+cd %_ROS_SOURCE_ROOT%
+
+
+
+:: Run the requested build task
+if "%1" == "build" (
+ goto :build
+)
+if "%1" == "rebuild" (
+ goto clean
+)
+if "%1" == "clean" (
+ goto :clean
+)
+goto :err_params
+
+:clean
+echo.
+echo Cleaning...
+echo.
+call "%_MAKE_COMMAND%" -j 1 %2%_clean
+
+if "%1" == "rebuild" (
+ goto :build
+)
+
+goto :exit
+
+:build
+echo.
+echo Building...
+echo.
+call "%_MAKE_COMMAND%" -j 1 %2%
+
+goto :exit
+
+
+:err_no_rosbe
+echo.
+echo You need to have RosBE installed to use this configuration
+echo.
+exit 1
+
+:err_params
+echo.
+echo Invalid parameters required, Check your command line.
+echo.
+exit 2
+
+:exit
+echo.
+echo done
+echo.
Propchange: trunk/reactos/rosbuild.bat
------------------------------------------------------------------------------
svn:eol-style = native