@echo off
REM gcc compiler script for EyeSim simulator
REM Thomas Braunl, 2004

set Copt=-DWINDOWS -shared -fno-common -Wall -I%sim%\include
set Lopt=-L%sim%\lib -leyewin

REM determine whether link necessary (no linking for -c, -S, -E, -M)
set link=1
for %%a in (%*) do if %%a==-c set link=0
for %%a in (%*) do if %%a==-S set link=0
for %%a in (%*) do if %%a==-E set link=0
for %%a in (%*) do if %%a==-M set link=0

if %link% EQU 1 goto compilewithlink

:compile
g++ %Copt% %* 
goto end

:compilewithlink
g++ %Copt% %* %Lopt%

:end
@echo on
