@if exist patches goto start
@echo The current working directory must be \emx\gnu
@goto end
:start
if not "%1"=="" goto %1
:tar
md binutils
cd binutils
tar xf ..\binutils.tar
copy g:\emx\doc\copying
cd ..
if "%2"=="tar" goto end
:del
cd binutils
del hp-bin\*.c
del hp-bin\*.h
del hp-bin\m*
rd hp-bin
del hp-inclu\*.h
del hp-inclu\*.def
rd hp-inclu
del hp-include\*.h
del hp-include\*.def
rd hp-include
del altos-re
del altos-readme
del archlist
del a_out_en.h
del a.out.encap.h
del a_out_gn.h
del a.out.gnu.h
del changelo
del changelog
del gprof.c
del gprof.tex
del gprof.texinfo
del libconve
del libconvert
del ranlib.c
del ranlib.h
del readme-e
del readme-encap
del robotuss.c
del robotussin.c
del tags
del cplus-de.c
del cplus-dem.c
cd ..
if "%2"=="del" goto end
if "%2"=="no-patch" goto end
:patch
set tmp=
cd binutils
lwpatch <..\patches\bin-emx.pat
cd ..
echo You may want to delete the .org (or .orig) files
:end
