build/buildutils/omake.bat
changeset 78 71ad690e91f5
parent 21 2a9601315dfc
child 80 d6dafc5d983f
--- a/build/buildutils/omake.bat	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/buildutils/omake.bat	Mon Oct 04 11:29:25 2010 +0300
@@ -14,12 +14,29 @@
 rem 
 rem  Description: Helper utility for building by developers
 rem 
+
 rem -------------------
 rem Determine java root
 setlocal
 set JAVA_SRC_ROOT=
+
+rem See if we are within jrt package (indepent of actual location)
 for %%a in (. .. ..\.. ..\..\.. ..\..\..\.. ..\..\..\..\.. ..\..\..\..\..\.. ..\..\..\..\..\..\..) do if "%JAVA_SRC_ROOT%" == "" if exist %%a\build\Makefile.comp call :setroot %%a
+if not "%JAVA_SRC_ROOT%" == "" goto resolved
 
+rem See if we are within jrtext package co-located with jrt (indepent of actual location)
+for %%a in (. .. ..\.. ..\..\.. ..\..\..\.. ..\..\..\..\.. ..\..\..\..\..\.. ..\..\..\..\..\..\..) do if "%JAVA_SRC_ROOT%" == "" if "%%~nxa" == "jrtext" if exist %%a\build\omj.pri if exist %%a\..\jrt\build\Makefile.comp call :setroot %%a\..\jrt
+if not "%JAVA_SRC_ROOT%" == "" goto resolved
+
+rem See if this is subdirectory within \ext\app\jrtext
+if "%JAVA_SRC_ROOT%" == "" for /F "delims=\ tokens=2-4" %%a in ("%CD%") do if "%%a\%%b\%%c" == "ext\app\jrtext" set JAVA_SRC_ROOT=\sf\app\jrt
+if not "%JAVA_SRC_ROOT%" == "" goto :resolved
+
+echo Could not determine JAVA_SRC_ROOT.
+goto :EOF
+
+
+:resolved
 echo JAVA_SRC_ROOT=%JAVA_SRC_ROOT%
 
 rem Make sbs to flush stdout immediately