@echo off

rem !!! change these to reflect your path(s) !!!
set binpath=\masm32\bin
set libpath=%binpath%\..\lib
set incpath=%binpath%\..\include

echo ****************************************************************************
echo * asmIRC build batch file last modified 1999.01.28 by zathan               *
echo ****************************************************************************
echo.
echo ð using bin path : %binpath%
echo ð using lib path : %libpath%
echo ð using inc path : %incpath%
echo.

echo ð building resource file
%binpath%\rc /v resource.rc
%binpath%\cvtres /MACHINE:IX86 resource.res
echo.
if errorlevel==0 goto compile
echo ú compiling the buggy resource file failed... :(
echo.
goto end

:compile
echo ð compiling:
%binpath%\ml /c /coff /I%incpath% *.asm
echo.
if errorlevel==0 goto link
echo ú compiling the buggy source failed... :(
echo.
goto end

:link
echo ð linking:
%binpath%\link /SUBSYSTEM:WINDOWS /OUT:asmIRC.exe /LIBPATH:%libpath% *.obj
if errorlevel==0 goto safeend
echo ú linking the buggy source failed... :(
echo.
goto end

:safeend
if not exist asmIRC.exe goto errorend
echo ð deleting intermediate files...
del *.obj
del resource.res
echo.
echo ð you can now run asmIRC.exe!
echo.
goto end

:errorend
echo.
echo ú something went wrong... :(
echo.
:end
