|
| 1 | +:: Compile all resources and programs |
| 2 | +:: Must have many things set before using this file: |
| 3 | +:: OUT - the output directory |
| 4 | +:: TARGET - the compilation target (e.g. x86), given to vcvarsall.bat |
| 5 | +:: TARGETX - the compilation target (e.g. x86), used in VC tool command lines |
| 6 | +:: TARGET_FULL - the full name of the compilation target (e.g. i386) |
| 7 | +:: TOOLCHAIN - toolchain version (vs90 or vs100) |
| 8 | +:: VS90COMNTOOLS or VS100COMNTOOLS - location of the toolchain |
| 9 | +:: COMPILE_... - if set to 1, that option is compiled |
| 10 | +:: where ... is: RESOURCES, CORE, INSTALLER, GUI, or CMD |
| 11 | + |
| 12 | +@call Compile\settings.bat |
| 13 | + |
| 14 | +@set ORIG_PATH="%PATH%" |
| 15 | +@set INCLUDE="" |
| 16 | +@set LIB="" |
| 17 | +@set LIBPATH="" |
| 18 | + |
| 19 | +@if "%TOOLCHAIN%"=="vs90" ( |
| 20 | + @call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" %TARGET% |
| 21 | + @set CL_TC= |
| 22 | +) else ( |
| 23 | + @call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" %TARGET% |
| 24 | + @set CL_TC=/GL |
| 25 | +) |
| 26 | + |
| 27 | +@echo on |
| 28 | + |
| 29 | + |
| 30 | +@if "%DEBUGGING%"=="ON" ( |
| 31 | + @set OUT=%OUT%-debug |
| 32 | + @set DEBUG=-debug |
| 33 | + @set RC_DBG=/d _DEBUG |
| 34 | + @set CL_DBG=/Zi /MDd /D _DEBUG /Fd..\%OUT%-debug\ |
| 35 | + @set LNK_DBG=/DEBUG |
| 36 | + @set CSC_DBG=/debug /d:DEBUG |
| 37 | +) else ( |
| 38 | + @set DEBUG= |
| 39 | + @set RC_DBG=/d NDEBUG |
| 40 | + @set CL_DBG=/MD /D NDEBUG |
| 41 | + @set LNK_DBG=/OPT:REF /OPT:ICF |
| 42 | + @set CSC_DBG=/o+ |
| 43 | +) |
| 44 | +:: /DEFAULTLIB:msvcmrtd.lib |
| 45 | +:: /DEFAULTLIB:msvcmrt.lib |
| 46 | + |
| 47 | +@mkdir %OUT% >nul 2>&1 |
| 48 | + |
| 49 | +@set W7BU=%OUT%\Win7BootUpdater |
| 50 | + |
| 51 | +@set ORIG_PROMPT=%PROMPT% |
| 52 | +@set PROMPT=$G |
| 53 | + |
| 54 | +set RC=%RC_DBG% /d GUI /d %TARGETX% /d %TOOLCHAIN% |
| 55 | +set CL=/nologo %CL_DBG% %CL_TC% /W4 /wd4201 /wd4480 /O2 /GS /EHa /MP /D _UNICODE /D UNICODE /D INTEGRATED /Fo..\%OUT%\ |
| 56 | +set INCLUDE=%EXTRA_INCLUDES%;%INCLUDE% |
| 57 | +set LINK=/nologo %LNK_DBG% /LTCG /CLRIMAGETYPE:IJW /MANIFEST:NO /MACHINE:%TARGETX% |
| 58 | +set LIB=%EXTRA_LIBS%;%LIB% |
| 59 | +set CSC=/nologo %CSC_DBG% /w:4 /d:INTEGRATED /target:module |
| 60 | +::/platform:%TARGETX% |
| 61 | + |
| 62 | +@IF "%COMPILE_RESOURCES%" NEQ "1" GOTO :AFTER_RESOURCES |
| 63 | +@echo. |
| 64 | +@echo *************** Resources *********************** |
| 65 | +@call Compile\resources.bat |
| 66 | +@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 67 | + |
| 68 | +:AFTER_RESOURCES |
| 69 | +@IF "%COMPILE_CORE%" NEQ "1" GOTO :AFTER_CORE |
| 70 | +@echo. |
| 71 | +@echo *************** Core **************************** |
| 72 | +@call Compile\core.bat |
| 73 | +@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 74 | + |
| 75 | +:AFTER_CORE |
| 76 | +@IF "%COMPILE_INSTALLER%" NEQ "1" GOTO :AFTER_INSTALLER |
| 77 | +@echo. |
| 78 | +@echo *************** Installer *********************** |
| 79 | +@call Compile\installer.bat |
| 80 | +@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 81 | + |
| 82 | +:AFTER_INSTALLER |
| 83 | +@IF "%COMPILE_GUI%" NEQ "1" GOTO :AFTER_GUI |
| 84 | +@echo. |
| 85 | +@echo *************** GUI ***************************** |
| 86 | +@call Compile\gui.bat |
| 87 | +@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 88 | + |
| 89 | +:AFTER_GUI |
| 90 | +@IF "%COMPILE_CMD%" NEQ "1" GOTO :AFTER_CMD |
| 91 | +@echo. |
| 92 | +@echo *************** CMD ***************************** |
| 93 | +@call Compile\cmd.bat |
| 94 | +@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 95 | + |
| 96 | +:AFTER_CMD |
| 97 | +@echo. |
| 98 | +@echo Compiled Successfully! |
| 99 | + |
| 100 | +::@echo. |
| 101 | +::@echo *************** Cleanup ************************* |
| 102 | +::@call Compile\cleanup.bat |
| 103 | +::@IF %ERRORLEVEL% NEQ 0 GOTO :END |
| 104 | + |
| 105 | +:END |
| 106 | +@echo. |
| 107 | +@set PROMPT=%ORIG_PROMPT% |
| 108 | +@set PATH="%ORIG_PATH%" |
0 commit comments