@echo off rem ============================================================================ rem crlfmk.bat rem Compile (build) the 'crlf.exe' executable, for Win32. rem rem Usage: crlfmk R L [Patch] rem rem ---------------------------------------------------------------------------- rem @(#)drt/src/cmd/crlfmk.bat $Date: 2011/04/26 03:05:06 $ rem ============================================================================ rem -------------------------------------- rem Check the version number if not /%2/ == // goto endif0 echo crlfmk.bat: Compile (build) the 'crlf.exe' executable, for Win32. echo. echo usage: %0 R L [Patch] set ERRORLEVEL=255 goto end :endif0 set R=%1 shift set L=%1 shift set VERS=%R%.%L% if not /%VERS%/ == /./ goto endif1 echo Env var 'VERS' is not set, expected 'R.L'. set ERRORLEVEL=1 goto end :endif1 set P= set PATCH= if /%1/ == // goto endif2 set P=%1 set PATCH= %1 shift :endif2 echo Version: %R%.%L%%PATCH% rem -------------------------------------- rem Make and compile the resource (RC) file set FMT="+%%Y-%%m-%%d" for /f %%i in ('vdate %FMT%') do set BUILT=%%i echo BUILT=[%x%] set RCOPTS=/d "R=%R%" /d "L=%L%" /d "VS=\"%VERS%\"" set RCOPTS=%RCOPTS% /d "P=\"%P%\"" set RCOPTS=%RCOPTS% /d "DATE=\"%BUILT%\"" set CMD=rc %RCOPTS% crlf.rc echo %CMD% %CMD% echo. rem -------------------------------------- rem Compile and link the source (C++) file into an executable set CCINC=..\lib set CCLIB=..\lib set CCOPTS=-I %CCINC% set CCOPTS=%CCOPTS% "-DVERS=\"%R%.%L%%PATCH%\"" set SRCS=crlf.cpp set SRCS=%SRCS% %CCLIB%\textstream.cpp set SRCS=%SRCS% %CCLIB%\intextstream.cpp set SRCS=%SRCS% %CCLIB%\outtextstream.cpp set SRCS=%SRCS% crlf.res set CMD=cl %CCOPTS% %SRCS% echo %CMD% %CMD% echo. :end