@if exist patches goto start
@echo The current working directory must be \emx\gnu
@goto end
:start
if not "%1"=="" goto %1
:tar
gzip -cd<gas-1.38.1.tar.Z|tar xf -
if not exist gas-1.38\flonum-c.c goto hpfs
ren gas-1.38\flonum-m.c fl-mult.c
del gas-1.38\flonum*.c
gzip -cd<gas-1.38.1.tar.Z|tar xf - gas-1.38/flonum-copy.c
ren gas-1.38\flonum-c.c fl-copy.c
gzip -cd<gas-1.38.1.tar.Z|tar xf - gas-1.38/flonum-const.c
ren gas-1.38\flonum-c.c fl-const.c
goto cont1
:hpfs
ren gas-1.38\flonum-copy.c fl-copy.c
ren gas-1.38\flonum-const.c fl-const.c
ren gas-1.38\flonum-mult.c fl-mult.c
:cont1
copy patches\a386.ld gas-1.38
copy g:\emx\doc\copying gas-1.38
if "%2"=="tar" goto end
:del
cd gas-1.38
del a_out_gn.h
del a.out.gnu.h
del atof-vax.c
del i860*.*
del m-hpux.h
del m-sun3.h
del m68k*.*
del make-gas.com
del ns32k*.*
del readme-v*.*
del sparc*.*
del vax*.*
del vms*.*
cd ..
if "%2"=="del" goto end
:ren
cd gas-1.38
ren atof-generic.c atof-gen.c
ren atof-ieee.c atof-iee.c
ren bignum-copy.c bignum-c.c
ren changelog changelo
ren hex-value.c hex-valu.c
ren i386-opcode.h i386-opc.h
ren input-file.c input-fi.c
ren input-file.h input-fi.h
ren input-scrub.c input-sc.c
ren m-generic.h m-generi.h
ren objrecdef.h objrecde.h
ren output-file.c output-f.c
ren struc-symbol.h struc-sy.h
cd ..
if "%2"=="ren" goto end
if "%2"=="no-patch" goto end
:patch
cd gas-1.38
lwpatch <..\patches\gas-emx.pat
cd ..
:end
