@echo off

if "%1" == "obj" goto obj
if not "%1" == ""obj"" goto not_obj
:obj

if not "%GAMBCOMP_VERBOSE%" == "yes" goto not_obj_verbose
echo.type nul ^> "%BUILD_OBJ_OUTPUT_FILENAME%"
echo.for %%f in (%BUILD_OBJ_INPUT_FILENAMES%) do type %%f ^>^> "%BUILD_OBJ_OUTPUT_FILENAME%"
:not_obj_verbose

type nul > "%BUILD_OBJ_OUTPUT_FILENAME%"
for %%f in (%BUILD_OBJ_INPUT_FILENAMES%) do type %%f >> "%BUILD_OBJ_OUTPUT_FILENAME%"

goto end
:not_obj

if "%1" == "dyn" goto dyn
if not "%1" == ""dyn"" goto not_dyn
:dyn

if not "%GAMBCOMP_VERBOSE%" == "yes" goto not_dyn_verbose
echo.type nul ^> "%BUILD_DYN_OUTPUT_FILENAME%"
echo.for %%f in (%BUILD_DYN_INPUT_FILENAMES%) do type %%f ^>^> "%BUILD_DYN_OUTPUT_FILENAME%"
:not_dyn_verbose

type nul > "%BUILD_DYN_OUTPUT_FILENAME%"
for %%f in (%BUILD_DYN_INPUT_FILENAMES%) do type %%f >> "%BUILD_DYN_OUTPUT_FILENAME%"

goto end
:not_dyn

if "%1" == "lib" goto lib
if not "%1" == ""lib"" goto not_lib
:lib

if not "%GAMBCOMP_VERBOSE%" == "yes" goto not_lib_verbose
echo.echo BUILD_LIB not yet implemented
:not_lib_verbose

echo BUILD_LIB not yet implemented

goto end
:not_lib

if "%1" == "exe" goto exe
if not "%1" == ""exe"" goto not_exe
:exe

if not "%GAMBCOMP_VERBOSE%" == "yes" goto not_exe_verbose
; TODO
echo.echo.0^^^<0# : ^^^^^>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.echo.'''^>^>"%BUILD_EXE_OUTPUT_FILENAME%"
;echo.echo.@java -jar %%%%~f0 %%%%*^>^>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.echo.@exit /b %%%%ERRORLEVEL%%%%^>^>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.echo.'''^>^>"%BUILD_EXE_OUTPUT_FILENAME%"
:not_exe_verbose

; TODO
echo.0^<0# : ^^>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.'''>>"%BUILD_EXE_OUTPUT_FILENAME%"
;echo.@java -jar %%~f0 %%*>>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.@exit /b %%ERRORLEVEL%%>>"%BUILD_EXE_OUTPUT_FILENAME%"
echo.'''>>"%BUILD_EXE_OUTPUT_FILENAME%"

goto end
:not_exe

echo.gambcomp-python.bat unknown operation "%1"
exit /b 1

:end
exit /b 0
