Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/08/06 22:21
Read: times


 
#118045 - c.bat
Responding to: ???'s previous message
Which appears to contain (just to save folks hassle of downloading, renaming and viewing):
@echo off
if a%1 == an goto new
if a%1 == ae goto cleanup
if a%2 == a goto start
if a%1 == ac goto compile
if a%1 == aa goto assemble
if a%1 == al goto link
if not a%2 == an goto start

:new
if exist *.out del *.out

:start
set platz=
set name=%1
if a%1 == a set name=main
if a%1 == an set name=main

if a%c51% == a goto error1

set err=0
set op=%path%
set path=%c51%\bin;%path%
set c51inc=%c51%\inc
set c51lib=%c51%\lib

if not exist %c51lib%\*.lib goto error2
if not exist %c51%\bin\c51.exe goto error3
if not exist *.c51 goto error4

if exist %name%.out goto amake

if exist *.obj del *.obj
for %%f in ( *.c51 ) do call %0 c %%f
if a%err% == a1 goto pause
echo.
if not exist startup.a51 copy %c51lib%\startup.a51 .
if not exist startup.a51 goto error5

for %%f in ( *.a51 ) do call %0 a %%f
if a%err% == a1 goto pause

if exist l51tmp.tmp del l51tmp.tmp
for %%f in ( *.obj ) do call %0 l %%f
echo startup.obj to %name%.out PL(30000) & >> l51tmp.tmp
if exist link.opt type link.opt >> l51tmp.tmp
echo.
l51.exe @l51tmp.tmp
goto hex

:amake
call amake %name%.out

:hex
oh51.exe %name%.out

call %0 e
if exist program.bat program.bat %name%.hex
if exist download.bat download.bat %name%.hex
goto end

:compile
if a%err% == a1 goto end
echo.
echo Compile: %2
c51.exe %2 REGFILE (%name%.reg) INTVECTOR(0x0000)
if errorlevel 1 goto error6
goto end

:assemble
if a%err% == a1 goto end
echo.
echo Assemble: %2
a51.exe %2
if errorlevel 1 goto error6
goto end

:link
if a%2 == aSTARTUP.OBJ goto end
echo %2, & >> l51tmp.tmp
goto end


:error1
echo.
echo Error, Environment Variable C51 not defined !
goto pause

:error2
echo.
echo Error, Environment Space exceeded !
goto pause

:error3
echo.
echo Error, Environment Variable C51 invalid !
goto pause

:error4
echo.
echo Error, No Source File *.C51 found !
goto pause

:error5
echo.
echo Error, File STARTUP.A51 missing !
goto pause

:error6
echo.
echo Error in Soucre File %2 !
set err=1
goto end

:pause
echo.
pause

:cleanup
if a%op% == a goto end
set path=%op%
set name=
set op=
set c51inc=
set c51lib=
set err=

:end



List of 5 messages in thread
TopicAuthorDate
Keil C Project without windows based IDE            01/01/70 00:00      
   I e-mailed you a .bat            01/01/70 00:00      
   my c.bat            01/01/70 00:00      
      c.bat            01/01/70 00:00      
   Not MS-DOS            01/01/70 00:00      

Back to Subject List