@rem if parameter 1 is -debug then the executable will contain debug information 

@cd "%~dp0"
@call toolchain\setpaths.bat
@call cleanup.bat

@set vbcc_asmfiles=source\startup.asm source\main.asm source\musicplayer.asm 
@set vbcc_cfiles=source\C\test.c

@if x%1 == x-debug goto debug
:release
@echo Assembling, Compiling, and Linking dh0\mydemo.exe
@vc -O2 -notmpfile -nostdlib -o dh0\mydemo.exe %vbcc_asmfiles% %vbcc_cfiles% 
@goto postbuild
:debug
@echo Assembling, Compiling, and Linking dh0\mydemo.exe - with debug info
@vc -O2 -g -notmpfile -nostdlib -o dh0\mydemo.exe %vbcc_asmfiles% %vbcc_cfiles% 

:postbuild
@if exist dh0\mydemo.exe goto success

:error
@echo Build failed
@exit /b 1
:success
@echo Build success
@exit /b 0
