@echo off
if "%1"=="" goto usage
:jump
echo %1
goto %1

:usage
echo Usage: makebin PROGRAMS
echo PROGRAMS:
echo   gcc cpp cc1 as gasp gdb ld ar strip size nm objdump cc1plus cc1obj
echo   info makeinfo texindex emxfpemu
echo Shortcuts:
echo   all (all of the above)
echo   all-as (as gasp)
echo   all-gcc (gcc cpp cc1 cc1plus cc1obj)
echo   all-binutils (ld ar strip size nm objdump)
echo   all-texinfo (info makeinfo texindex)
goto end

:all
call makebin gcc cpp cc1 cc1plus cc1obj as gasp gdb ld ar strip size nm objdump info makeinfo texindex emxfpemu
goto next

:all-as
call makebin as gasp
goto next

:all-gcc
call makebin gcc cpp cc1 cc1plus cc1obj
goto next

:all-binutils
call makebin ld ar strip size nm objdump
goto next

:all-texinfo
call makebin info makeinfo texindex
goto next

:gcc
call makebin1 \emx\gnu\gcc-2.7\xgcc gcc
goto next

:cpp
call makebin1 \emx\gnu\gcc-2.7\cccp cpp
goto next

:cc1
call makebin1 \emx\gnu\gcc-2.7\cc1 cc1
goto next

:cc1plus
call makebin1 \emx\gnu\gcc-2.7\cc1plus cc1plus
goto next

:cc1obj
call makebin1 \emx\gnu\gcc-2.7\cc1obj cc1obj
goto next

:as
call makebin1 \emx\gnu\gas-2.3\gas\as.new as
goto next

:gasp
call makebin1 \emx\gnu\gas-2.3\gas\gasp.new gasp
goto next

:gdb
call makebin1 \emx\gnu\gdb-4.13\gdb\gdb gdb -p
goto next

:ld
call makebin1 \emx\gnu\binutils\ld ld
goto next

:strip
call makebin1 \emx\gnu\binutils\strip strip
goto next

:ar
call makebin1 \emx\gnu\binutils\ar ar
goto next

:nm
call makebin1 \emx\gnu\binutils\nm nm
goto next

:size
call makebin1 \emx\gnu\binutils\size size
goto next

:objdump
call makebin1 \emx\gnu\binutils\objdump objdump
goto next

:info
copy \emx\gnu\info\info.exe \emx\new
emxbind -sq \emx\new\info.exe
goto next

:makeinfo
copy \emx\gnu\makeinfo\makeinfo.exe \emx\new
emxbind -sq \emx\new\makeinfo.exe
goto next

:texindex
copy \emx\gnu\texindex\texindex.exe \emx\new
emxbind -sq \emx\new\texindex.exe
goto next

:emxfpemu
copy \emx\gnu\fpu-emu\emxfpemu \emx\new
strip \emx\new\emxfpemu
goto next

:next
shift
if not "%1" == "" goto jump
:end
