@ECHO OFF SETLOCAL REM # REM # File produced by the obuild tool version 1.0 REM # for the package snovis with version v1r1. REM # REM #//////////////////////////////////////////////// REM # Usage : REM # DOS> CD some_path\pack\version\obuild REM # DOS> DOS\build_snovis REM # REM #//////////////////////////////////////////////// REM #//////////////////////////////////////////////// REM #/// Get path of this file : REM #//////////////////////////////////////////////// SET obuild_snovis_path=%~dp0 REM # Remove ending \obuild\DOS\ SET obuild_snovis_path=%obuild_snovis_path:~0,-12% REM #//////////////////////////////////////////////// REM #/// Treat arguments : REM #//////////////////////////////////////////////// SET obuild_verbose=no SET obuild_debug=no SET obuild_optimize=yes SET obuild_set_x=no :next_arg IF "%1%" == "" GOTO end_args IF NOT "%1%" == "-v" GOTO end_if_v SET obuild_verbose=yes SHIFT GOTO next_arg :end_if_v IF NOT "%1%" == "-g" GOTO end_if_g SET obuild_debug=yes SHIFT GOTO next_arg :end_if_g IF NOT "%1%" == "-x" GOTO end_if_x SET obuild_set_x=yes SHIFT GOTO next_arg :end_if_x :end_args REM #//////////////////////////////////////////////// REM #/// End arguments. REM #//////////////////////////////////////////////// IF %obuild_set_x% == yes ECHO ON IF %obuild_debug% == yes SET obuild_optimize=no IF "%OBUILD_PLATFORM%" == "" ( IF "%OS%" == "" ECHO Environment variable OS not found. & GOTO obuild_return SET obuild_platform=%OS% ) ELSE ( SET obuild_platform=%OBUILD_PLATFORM% ) IF "%obuild_platform%" == "" ( ECHO obuild_platform variable not defined. GOTO obuild_return ) IF "%OBUILD_DIR_BIN%" == "" ( SET obuild_dir_bin=bin_obuild ) ELSE ( SET obuild_dir_bin=%OBUILD_DIR_BIN% ) IF "%obuild_dir_bin%" == "" ( ECHO obuild_dir_bin variable not defined. GOTO obuild_return ) IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" ( cl.exe /nologo /DWIN32 /MD /O2 /W3 /GX /GR /Fe"%obuild_snovis_path%\%obuild_dir_bin%\obuild_platform.exe" "%obuild_snovis_path%\obuild\cpp\obuild_platform.cpp" 1> NUL IF EXIST obuild_platform.obj DEL obuild_platform.obj ) FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= IF NOT %obuild_platform_result% == yes GOTO end_if_platform_0 SET obuild_cxx_command=cl.exe :end_if_platform_0 SET obuild_platform_result= IF "%obuild_cxx_command%" == "" ECHO Variable obuild_cxx_command not defined. && GOTO obuild_return FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= IF NOT %obuild_platform_result% == yes GOTO end_if_platform_1 SET obuild_cxx_optimize=/O2 :end_if_platform_1 SET obuild_platform_result= FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= IF NOT %obuild_platform_result% == yes GOTO end_if_platform_2 SET obuild_cxx_debug=/ZI /Od :end_if_platform_2 SET obuild_platform_result= FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= IF NOT %obuild_platform_result% == yes GOTO end_if_platform_3 SET obuild_cxx_options=/nologo /DWIN32 /MD /GX /GR /W3 :end_if_platform_3 SET obuild_platform_result= IF NOT %obuild_debug% == yes GOTO else_if_db_build_dll_snovis_sh_4 SET obuild_cxx_debug_local=%obuild_cxx_debug% GOTO end_if_db_build_dll_snovis_sh_4 :else_if_db_build_dll_snovis_sh_4 SET obuild_cxx_debug_local= :end_if_db_build_dll_snovis_sh_4 IF NOT %obuild_optimize% == yes GOTO else_if_opt_build_dll_snovis_sh_5 SET obuild_cxx_optimize_local=%obuild_cxx_optimize% GOTO end_if_opt_build_dll_snovis_sh_5 :else_if_opt_build_dll_snovis_sh_5 SET obuild_cxx_optimize_local= :end_if_opt_build_dll_snovis_sh_5 SET obuild_cxx_includes=/I"%obuild_snovis_path%" SET obuild_cxx_includes=%obuild_cxx_includes% /I"%obuild_snovis_path%\source" IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis" RMDIR /S /Q "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis" IF NOT EXIST "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis" MKDIR "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis" @IF %obuild_verbose% == yes @ECHO ON cd "%obuild_snovis_path%\%obuild_dir_bin%" %obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Callbacks.obj /Tp"..\source\Callbacks.cxx" 1> cl_exe_error @IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return @IF NOT ERRORLEVEL 1 @DEL cl_exe_error cd "%obuild_snovis_path%\obuild" cd "%obuild_snovis_path%\%obuild_dir_bin%" %obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\InventorCallbacks.obj /Tp"..\source\InventorCallbacks.cxx" 1> cl_exe_error @IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return @IF NOT ERRORLEVEL 1 @DEL cl_exe_error cd "%obuild_snovis_path%\obuild" cd "%obuild_snovis_path%\%obuild_dir_bin%" %obuild_cxx_command% /c %obuild_cxx_debug_local% %obuild_cxx_optimize_local% %obuild_cxx_options% %obuild_cxx_macros% %obuild_cxx_includes% /Fo.\dll_snovis\Layouts.obj /Tp"..\source\Layouts.cxx" 1> cl_exe_error @IF ERRORLEVEL 1 @TYPE cl_exe_error && @GOTO obuild_return @IF NOT ERRORLEVEL 1 @DEL cl_exe_error cd "%obuild_snovis_path%\obuild" @IF %obuild_verbose% == yes @ECHO OFF SET obuild_linked_libraries=-L${Geant4_home}/lib -lG4physicslists FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF NOT EXIST .\obuild_platform.exe ECHO Program obuild_platform.exe not found. && GOTO obuild_return FOR /F "usebackq" %%j IN (`.\obuild_platform.exe %obuild_platform% Windows_NT`) DO SET obuild_platform_result=%%j cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= IF NOT %obuild_platform_result% == yes GOTO end_if_platform_12 SET obuild_linked_libraries=%obuild_linked_libraries% glu32.lib opengl32.lib gdi32.lib user32.lib :end_if_platform_12 SET obuild_platform_result= FOR /F "usebackq delims=;" %%d IN (`cd`) DO SET obuild_pwd_snovis_0=%%d cd "%obuild_snovis_path%\%obuild_dir_bin%" IF EXIST .\dll_snovis\tmp_objs DEL .\dll_snovis\tmp_objs FOR %%f IN (.\dll_snovis\*.obj) DO ECHO %%f >> .\dll_snovis\tmp_objs REM # Create the archive library snovis : @IF %obuild_verbose% == yes @ECHO ON lib.exe /nologo /machine:ix86 /out:.\dll_snovis\snovis.arc @.\dll_snovis\tmp_objs @IF ERRORLEVEL 1 @GOTO obuild_return @IF %obuild_verbose% == yes @ECHO OFF REM # Build the obuild_windef.exe utility program : cl.exe /nologo /DWIN32 /MD /O2 /W3 /Feobuild_windef.exe "%obuild_snovis_path%\obuild\cpp\obuild_windef.c" 1> NUL IF EXIST obuild_windef.obj DEL obuild_windef.obj REM # Building the .def file : @IF %obuild_verbose% == yes @ECHO ON dumpbin.exe /symbols /out:.\dll_snovis\tmp .\dll_snovis\snovis.arc 1> dumpbin_exe_error .\dll_snovis\snovis.arc @IF ERRORLEVEL 1 @TYPE dumpbin_exe_error && @GOTO obuild_return @IF NOT ERRORLEVEL 1 @DEL dumpbin_exe_error @IF %obuild_verbose% == yes @ECHO OFF .\obuild_windef.exe snovis < .\dll_snovis\tmp > .\dll_snovis\snovis.def REM # Building the linking library : REM # It produces a .exp file. @IF %obuild_verbose% == yes @ECHO ON lib.exe /nologo /machine:ix86 /out:.\dll_snovis\snovis.lib /def:.\dll_snovis\snovis.def 1> lib_exe_error @IF ERRORLEVEL 1 @TYPE lib_exe_error && @GOTO obuild_return @IF NOT ERRORLEVEL 1 @DEL lib_exe_error @IF %obuild_verbose% == yes @ECHO OFF REM # Building the DLL : IF EXIST .\snovis.dll DEL .\snovis.dll @IF %obuild_verbose% == yes @ECHO ON link.exe /nologo /dll /out:.\snovis.dll .\dll_snovis\snovis.exp .\dll_snovis\snovis.arc %obuild_linked_libraries% @IF %obuild_verbose% == yes @ECHO OFF cd "%obuild_pwd_snovis_0%" SET obuild_pwd_snovis_0= REM # Some cleanup : IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis\tmp_objs" DEL "%obuild_snovis_path%\%obuild_dir_bin%\dll_snovis\tmp_objs" IF EXIST "%obuild_snovis_path%\%obuild_dir_bin%\snovis.exp" DEL "%obuild_snovis_path%\%obuild_dir_bin%\snovis.exp" :obuild_return ENDLOCAL @ECHO ON