home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / binutl-f.zip / emx / bin.new / insbut.sh next >
Linux/UNIX/POSIX Shell Script  |  1999-03-19  |  2KB  |  83 lines

  1. #! /bin/sh
  2. #
  3. # This shell script will extract all useful files from
  4. # binutils-2.9.1 after compilation.
  5. #
  6.  
  7. function run()
  8. {
  9.   echo $*
  10.   $*
  11.   if [ $? != 0 ]; then
  12.     echo "$0: command failed, aborting"
  13.     exit 1
  14.   fi
  15. }
  16.  
  17. function copy()
  18. {
  19.   if echo $2 | grep -qs ".new$"; then
  20.     dst=$2/`basename $1`
  21.   else
  22.     dst=$2
  23.   fi
  24.   if [ -f $1 ]; then
  25.     if [ ! -f $dst -o $1 -nt $dst ]; then
  26.       run cp $1 $dst && \
  27.       echo $dst | grep -Eqs "(exe|dll)$" && run lxlite -b- `echo $dst | tr / \\\\\\\\`
  28.     else
  29.       echo "file $1 has already been installed"
  30.     fi
  31.   else
  32.     echo "$0: file $1 has not been built!"
  33.   fi
  34. }
  35.  
  36. if [ ! -f ltmain.sh ]; then
  37.   echo "This script should be run from base binutils directory!"
  38.   exit 1
  39. fi
  40.  
  41. [ ! -d /emx ] && run mkdir /emx
  42. [ ! -d /emx/bin.new ] && run mkdir /emx/bin.new
  43. [ ! -d /emx/lib.new ] && run mkdir /emx/lib.new
  44. [ ! -d /emx/dll.new ] && run mkdir /emx/dll.new
  45. [ ! -d /emx/include.new ] && run mkdir /emx/include.new
  46.  
  47. # Copy libraries first
  48. copy libiberty/libiberty.a /emx/lib.new/iberty.a
  49. copy libiberty/iberty_s.a /emx/lib.new
  50. copy bfd/.libs/bfd.a /emx/lib.new
  51. copy bfd/.libs/bfd_s.a /emx/lib.new
  52. copy opcodes/.libs/opcodes.a /emx/lib.new
  53. copy opcodes/.libs/opcodes_s.a /emx/lib.new
  54.  
  55. # Now copy the DLLs
  56. copy libiberty/iberty.dll /emx/dll.new
  57. copy bfd/.libs/bfd.dll /emx/dll.new
  58. copy opcodes/.libs/opcodes.dll /emx/dll.new
  59.  
  60. # And now copy executables
  61. copy binutils/.libs/ar.exe /emx/bin.new
  62. copy binutils/.libs/objdump.exe /emx/bin.new
  63. copy binutils/.libs/objcopy.exe /emx/bin.new
  64. copy binutils/.libs/ranlib.exe /emx/bin.new
  65. copy binutils/.libs/size.exe /emx/bin.new
  66. copy binutils/.libs/strings.exe /emx/bin.new
  67. copy binutils/.libs/addr2line.exe /emx/bin.new
  68. copy binutils/.libs/nm-new.exe /emx/bin.new/nm.exe
  69. copy binutils/.libs/strip-new.exe /emx/bin.new/strip.exe
  70. copy binutils/c++filt.exe /emx/bin.new
  71. copy gas/.libs/as-new.exe /emx/bin.new/as.exe
  72. copy gas/gasp-new.exe /emx/bin.new/gasp.exe
  73. copy gprof/.libs/gprof.exe /emx/bin.new
  74.  
  75. # Finally, copy include files
  76. copy include/demangle.h /emx/include.new
  77. copy include/dis-asm.h /emx/include.new
  78. copy include/getopt.h /emx/include.new
  79. copy include/fnmatch.h /emx/include.new
  80. copy include/libiberty.h /emx/include.new
  81. copy include/objalloc.h /emx/include.new
  82. copy include/obstack.h /emx/include.new
  83.