@echo off
echo COMPILING LIB4kSA SOURCE FILES
FOR %%c in (./*.s) DO sdasz80 -o %%c.rel %%c
copy crtcv.s.rel ..\crtcv.rel
del crtcv.s.rel
FOR %%c in (./*.c) DO sdcc -mz80 -c --std-c99 %%c
del *.asm

del *.lst

del *.sym
echo CREATING LIB4KSA LIBRARY
FOR %%c in (./*.rel) DO sdcclib cvlib.lib %%c
echo COPYING GENERATED LIBRARY AND HEADERS FILES
copy cvlib.lib ..
copy coleco.h ..
echo CLEANING UP LIB4K FOLDER
del *.rel
del cvlib.lib
pause