@echo off
setlocal
set base=e:\usr\src\lclint-3.0.0.14
if "%1"=="" goto icc
if "%1"=="--icc" goto icc
if "%1"=="-i" goto icc
if "%1"=="--emx" goto emx
if "%1"=="-e" goto emx
if "%1"=="--gcc" goto gcc
if "%1"=="-g" goto gcc
if "%1"=="--oldconf" goto oldconf
if "%1"=="-o" goto oldconf
if "%1"=="--test" goto test
if "%1"=="-t" goto test
"echo.exe" "usage: makeos2 [--emx|-e|--gcc|-g|--icc|-i|--oldconf|-o|--test|-t]"
goto end

:emx
set COMPILER=gcc-emx
goto initial

:gcc
set COMPILER=gcc-os2
goto initial

:icc
set COMPILER=icc-os2
goto initial

:initial
sh -c "export TODAY=`date.exe`; export LCL_DATE=`date.exe | cut -d ' ' -f 2,3,6`; make -e -f Makefile.os2"
goto end

:oldconf
make -f Makefile.os2 --directory=../src --warn-undefined-variables
if errorlevel 0 mv ..\src\lclint.exe ..\bin
goto end

:test
set LARCH_PATH=%base%\lib
set LCLIMPORTDIR=%base%\imports
cd ..\test
echo it's %LARCH_PATH% and %LCLIMPORTDIR%
make %2 -e -f Makefile-test.os2
cd ..\os2

:end
endlocal
