@echo off

set SRC=financial_service
set SRCEXE=financial_service_test

REM Tcc Win32

set DEST=Tcc_Win32
set TCC=..\..\..\..\Tcc\tcc.exe

echo * Building Win32 DLL ...
%TCC% -shared -DT2C_DLL %SRC%_dll.c -o %DEST%_DLL\%SRC%.dll
%TCC% -DT2C_DLL %SRCEXE%.c -o %DEST%_DLL\%SRCEXE%.exe -L %DEST%_DLL -l%SRC%

echo * Building Win32 static library ...
%TCC% -r %SRC%.c -o %DEST%_static\lib%SRC%.a
%TCC% %SRCEXE%.c -o %DEST%_static\%SRCEXE%.exe -L %DEST%_static -l%SRC%

REM Tcc Win64

set DEST=Tcc_Win64
set TCC=..\..\..\..\Tcc64\tcc.exe

echo * Building Win64 DLL ...
%TCC% -shared -DT2C_DLL %SRC%_dll.c -o %DEST%_DLL\%SRC%.dll
%TCC% -DT2C_DLL %SRCEXE%.c -o %DEST%_DLL\%SRCEXE%.exe -L %DEST%_DLL -l%SRC%

echo * Building Win64 static library ...
%TCC% -r %SRC%.c -o %DEST%_static\lib%SRC%.a
%TCC% %SRCEXE%.c -o %DEST%_static\%SRCEXE%.exe -L %DEST%_static -l%SRC%

echo * Done

REM Free the resources

set DEST=
set SRC=
set SRCEXE=
set TCC=