@echo off

set name=AutoWebSes
set output=..\bin\%name%.elf

set armdir=f:\ads
set sdkdir=..\..\sdk
set lib_o=..\..\Lib.o
set options=-DDEBUG -DDEBUG_MEMORY

if exist %output% del %output%



set src_input=%name%.c

%armdir%\tcc -I"%sdkdir%" -c -bigend -O2 -apcs /interwork %options% %src_input%

set tmp_o=%name%.o
set ext_o=..\dbg\dbg.o ..\libs\libc.o
echo =======================================

rem %armdir%\armlink -reloc -first Lib.o(Lib) -o %output% %tmp_o% %ext_o% %lib_o%
%armdir%\armlink -reloc -first Lib.o(Lib) -o %output% %tmp_o% %lib_o%




del %tmp_o%

if exist %output% (
	echo ACK: File `%output%` created
) else (
	echo ERR: File `%output%` not created
)

pause