1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | @echo off
if "%1"=="" goto usage
rem This will put the SDK headers & libs first in the search path.
if "%MSTOOLS%"=="" goto no_mstools
if "%BASEDIR%"=="" goto setbasedir
if NOT "%BASEDIR%"=="%1" goto setbasedir
if "%DDKBUILDENV%"=="" goto setenv
if NOT "%DDKBUILDENV%"=="%2" goto envtest
goto done
:setbasedir
rem set BASEDIR to ddk directory and set path to point to ddk binaries
set BASEDIR=%1
set path=%path%;%BASEDIR%\bin
:setenv
set NTMAKEENV=%BASEDIR%\inc
set BUILD_MAKE_PROGRAM=nmake.exe
set BUILD_DEFAULT=-ei -nmake -i
if "%tmp%"=="" set tmp=
if "%PROCESSOR_ARCHITECTURE%"=="" goto cpuerror
if "%PROCESSOR_ARCHITECTURE%"=="ALPHA" goto alpha
if "%PROCESSOR_ARCHITECTURE%"=="MIPS" goto mips
if "%PROCESSOR_ARCHITECTURE%"=="x86" goto i386
if "%PROCESSOR_ARCHITECTURE%"=="PPC" goto ppc
goto cpuerror
:alpha
if "%Cpu%" == "" set Cpu=ALPHA
set BUILD_DEFAULT_TARGETS=-alpha
set ALPHA=1
set JENSEN=1
set NTALPHADEFAULT=1
goto envtest
:ppc
if "%Cpu%" == "" set Cpu=PPC
set BUILD_DEFAULT_TARGETS=-ppc
set PPC=1
set _PPC_=1
set NTPPCDEFAULT=1
goto envtest
:mips
if "%Cpu%" == "" set Cpu=MIPS
set BUILD_DEFAULT_TARGETS=-mips
set MIPS_R4000=1
set _JAZZIDW=1
set NTMIPSDEFAULT=1
goto envtest
:i386
if "%Cpu%" == "" set Cpu=i386
set BUILD_DEFAULT_TARGETS=-386
:envtest
if "%2"=="" goto free
if "%2"=="free" goto free
if "%2"=="FREE" goto free
if "%2"=="checked" goto checked
if "%2"=="CHECKED" goto checked
goto usage
:free
rem set up an NT free build environment
set DDKBUILDENV=free
set C_DEFINES=-D_IDWBUILD
set NTDBGFILES=1
set NTDEBUG=
set NTDEBUGTYPE=
set MSC_OPTIMIZATION=
set LANGUAGE=USA
goto done
:checked
rem set up an NT checked build environment
set DDKBUILDENV=checked
set C_DEFINES=-D_IDWBUILD -DRDRDBG -DSRVDBG
set NTDBGFILES=
set NTDEBUG=ntsd
set NTDEBUGTYPE=both
set MSC_OPTIMIZATION=/Od /Oi
set LANGUAGE=USA
:done
set _OBJ_DIR=obj
set NEW_CRTS=1
IF "%_NTROOT%"=="" set _NTROOT=%BASEDIR%
doskey /macrofile=%BASEDIR%\bin\generic.mac
if "%DDKDRIVE%"=="" goto noddkdrive
doskey /macrofile=%BASEDIR%\bin\ddktree.mac
cd %BASEDIR%
%DDKDRIVE%
goto end
:noddkdrive
pushd %BASEDIR%
goto end
:cpuerror
echo.
echo Error: PROCESSOR_ARCHITECTURE environment variable not recognized.
echo.
echo.
goto end
:no_mstools
@echo Error: MSTOOLS environment variable not recognized.
@echo The Win32 SDK must be installed.
goto end
:usage
echo.
echo usage: setenv ^<directory^> [free^|^checked]
echo.
echo Example: setenv d:\ddk checked set checked environment
echo Example: setenv d:\ddk defaults to free environment
echo.
echo.
:end
call %MSTOOLS%\setenv /2000 /retail %MSTOOLS%
|