@echo off
echo Build ALL for Dynamic Link Library
if not exist rsrc.rc goto over1
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1

if exist MyCom2.dll del MyCom2.dll
if exist MyCom2.obj del MyCom2.obj

\masm32\bin\ml /c /Fl /Sn /coff MyCom2.asm /Sa
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

echo Resources were found

\masm32\bin\Link /DLL /SUBSYSTEM:WINDOWS /DEF:MyCom2.def /LIBPATH:c:\masm32\lib MyCom2.obj rsrc.obj 
if errorlevel 1 goto errlink
goto TheEnd

:nores
echo No resources found
\masm32\bin\Link /DLL /SUBSYSTEM:WINDOWS /DEF:MyCom2.def /LIBPATH:c:\masm32\lib MyCom2.obj 
if errorlevel 1 goto errlink
goto TheEnd

:errlink
echo _
echo >> Link error
goto alldone

:errasm
echo _
echo >> Assembly Error
goto alldone

:TheEnd
echo GOOD BUILD
dir MyCom2

:alldone
