# Erik Jacobsen 01/23/95 (jacobsen@cs.wisc.edu)
# Script to build all the binary stuff for djgpp
# run this from the root of the djgpp distribution 

#################################################
#build gcc
cd src/gcc-260
gcc -g -O2 -c next_putenv.c >> ../../gcc-260.make-results
gmake > ../../gcc-260.make-results
# copy the results to where we can use them
gmake cpp >> ../../gcc-260.make-results
gcc -g -O2 -c next_putenv.c >> ../../gcc-260.make-results
gmake cc1plus >> ../../gcc-260.make-results
cp xgcc ../../bin/gcc
cp cpp ../../bin/cpp
cp cc1plus ../../bin/cc1plus
cp cc1 ../../bin/cc1
cd ../..

#################################################
#build the binary utilities (the linker!)
cd src/binut-2.4
cd libiberty
gmake >> ../../../binutil.make-results
cd ../bfd
gmake >> ../../../binutil.make-results
cd ../opcodes
gmake >> ../../binutil.make-results
cd ../gprof
gmake >> ../../../binutil.make-results
cd ../binutils
gmake >> ../../../binutil.make-results
cd ../ld
gmake >> ../../../binutil.make-results
# copy the results to where we can use them
cd ..
cp ld/ld.new ../../bin/ld
cp binutils/ar ../../bin/ar
cp binutils/nm.new ../../bin/nm
cp binutils/objcopy ../../bin/objcopy
cp binutils/objdump ../../bin/objdump
cp binutils/ranlib ../../bin/ranlib
cp binutils/size ../../bin/size
cp binutils/strip.new ../../bin/strip
cp binutils/strings ../../bin/strings
cd ../..


#################################################
#build the assembler
cd src/gas-2.3
cd libiberty
gmake >> ../../../gas.make-results
cd ../bfd
gmake >> ../../../gas.make-results
cd ../opcodes
gmake >> ../../../gas.make-results
cd ../gas
cp Makefile.save Makefile
gmake "CC=gcc"  >> ../../../gas.make-results
cp as.new ../../../bin/as
cd ../../..

#################################################
#build coff2exe
cd src/coff2exe
gmake >> ../../coff2exe.make-results
cp coff2exe ../../bin 
cd ../..

#################################################
#copy the rest of bin
cp dosbin/go32.exe bin

#strip everything
cd bin
strip *
cd ..

