@echo off set DMCPATH=c:\l\dmc\bin set DMDPATH=%CD%\..\windows\bin set OLDPATH=%PATH% set PATH=%DMDPATH%;%DMCPATH%;%PATH% if not exist %DMCPATH%\dmc.exe goto dmc_missing if not exist %DMDPATH%\dmd.exe goto dmd_missing if "%1" == "clean" goto clean set patch= set cnt= for %%f in (*.patch) do ( set patch=%%f call :count_patches ) goto cont :count_patches set cnt=%cnt%@ goto xxit :cont if "%cnt%" == "" goto nopatch if not "%cnt%" == "@" goto multiple_patches %DMDPATH%\dmd patchd.d if errorlevel 1 goto error if not exist patchd.exe goto error patchd -patch=%patch% -strip=1 if errorlevel 1 goto error ren %patch% %patch%.applied if errorlevel 1 goto error :nopatch cd dmd make -f win32.mak DMC=%DMCPATH%\dmc.exe dmd if errorlevel 1 goto error_cd copy dmd.exe %DMDPATH% cd .. cd druntime make -f win32.mak if errorlevel 1 goto error_cd make -f win32.mak import if errorlevel 1 goto error_cd make -f win32.mak doc if errorlevel 1 goto error_cd cd .. cd phobos del phobos.lib make -f win32.mak phobos.lib "DFLAGS=-g -debug -w -d" if errorlevel 1 goto error_cd move phobos.lib %DMDPATH%\..\lib\phobos_d.lib make -f win32.mak phobos.lib if errorlevel 1 goto error_cd copy phobos.lib %DMDPATH%\..\lib cd .. goto success :clean cd phobos make -f win32.mak clean if errorlevel 1 goto error_cd cd .. cd druntime make -f win32.mak clean if errorlevel 1 goto error_cd cd .. cd dmd make -f win32.mak DMC=%DMCPATH%\dmc.exe clean if errorlevel 1 goto error_cd cd .. goto success :error_cd cd .. :error echo #### ERROR #### goto xit :dmc_missing echo #### %DMCPATH%\dmc.exe does not exist, please set DMCPATH at the top of this batch #### goto xit :dmd_missing echo #### %DMDPATH%\dmd.exe does not exist, please set DMDPATH at the top of this batch #### goto xit :multiple_patches echo #### multiple patches found, one or zero patch files allowed only #### goto xit :success echo #### SUCCESS #### :xit set PATH=%OLDPATH% :xxit