home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / mpw-build.in < prev    next >
Text File  |  1996-09-28  |  5KB  |  197 lines

  1. # Top-level script fragment to build everything for MPW.
  2.  
  3. Set savedir "`Directory`"
  4.  
  5. #Set Echo 1
  6.  
  7. Set ThisScript "{0}"
  8.  
  9. Set objdir ":"
  10.  
  11. Set verify 0
  12.  
  13. Set BuildTarget "none"
  14.  
  15. # Parse arguments.
  16.  
  17. Loop
  18.     Break If {#} == 0
  19.         If "{BuildTarget}" =~ /none/
  20.             Set BuildTarget "{1}"
  21.         Else
  22.             Echo Only one build target allowed, ignoring "{1}"
  23.         End If
  24.     Shift 1
  25. End Loop
  26.  
  27. If "{BuildTarget}" =~ /none/
  28.     Set BuildTarget "all"
  29. End If
  30.  
  31. If {verify} == 1
  32.     Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ... 
  33. End If
  34.  
  35. Set ranmake 0
  36.  
  37. If "`Exists Makefile`" != ""
  38.     Echo "Set Echo 1" >{BuildTarget}.makeout
  39.     Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout
  40.     {BuildTarget}.makeout
  41.     Delete {BuildTarget}.makeout
  42.     Set ranmake 1
  43. End If
  44.  
  45. If "`Exists Makefile.PPC`" != ""
  46.     Echo "Set Echo 1" >{BuildTarget}.makeout.ppc
  47.     Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc
  48.     {BuildTarget}.makeout.ppc
  49.     Delete {BuildTarget}.makeout.ppc
  50.     Set ranmake 1
  51. End If
  52.  
  53. If {ranmake} == 1
  54.     Exit
  55. End If
  56.  
  57. # Dispatch on various pseudo-targets.
  58.  
  59. If "{BuildTarget}" =~ /all/
  60.     Echo Started `Date`
  61.     "{ThisScript}" all-gcc
  62.     "{ThisScript}" all-ld
  63.     "{ThisScript}" all-gdb
  64.     Echo Finished `Date`
  65. Else If "{BuildTarget}" =~ /all-libiberty/
  66.     "{ThisScript}" do-libiberty
  67. Else If "{BuildTarget}" =~ /all-bfd/
  68.     "{ThisScript}" do-bfd
  69. Else If "{BuildTarget}" =~ /all-opcodes/
  70.     "{ThisScript}" do-opcodes
  71. Else If "{BuildTarget}" =~ /all-byacc/
  72.     "{ThisScript}" do-byacc
  73. Else If "{BuildTarget}" =~ /all-flex/
  74.     "{ThisScript}" all-libiberty
  75.     "{ThisScript}" do-flex
  76. Else If "{BuildTarget}" =~ /all-binutils/
  77.     "{ThisScript}" all-libiberty
  78.     "{ThisScript}" all-bfd
  79.     "{ThisScript}" all-opcodes
  80.     "{ThisScript}" do-binutils
  81. Else If "{BuildTarget}" =~ /all-gas/
  82.     "{ThisScript}" all-libiberty
  83.     "{ThisScript}" all-bfd
  84.     "{ThisScript}" all-opcodes
  85.     "{ThisScript}" do-gas
  86. Else If "{BuildTarget}" =~ /all-gcc/
  87.     "{ThisScript}" all-libiberty
  88.     "{ThisScript}" all-gas
  89.     "{ThisScript}" all-binutils
  90.     "{ThisScript}" do-gcc
  91. Else If "{BuildTarget}" =~ /all-gdb/
  92.     "{ThisScript}" all-libiberty
  93.     "{ThisScript}" all-bfd
  94.     "{ThisScript}" all-opcodes
  95.     "{ThisScript}" do-gdb
  96. Else If "{BuildTarget}" =~ /all-grez/
  97.     "{ThisScript}" all-libiberty
  98.     "{ThisScript}" all-bfd
  99.     "{ThisScript}" do-grez
  100. Else If "{BuildTarget}" =~ /all-ld/
  101.     "{ThisScript}" all-libiberty
  102.     "{ThisScript}" all-bfd
  103.     "{ThisScript}" all-opcodes
  104.     "{ThisScript}" do-ld
  105. Else If "{BuildTarget}" =~ /do-byacc/
  106.     SetDirectory :byacc:
  107.     ::mpw-build all
  108. Else If "{BuildTarget}" =~ /do-flex/
  109.     SetDirectory :flex:
  110.     ::mpw-build _bootstrap
  111.     ::mpw-build all
  112. Else If "{BuildTarget}" =~ /do-bfd/
  113.     SetDirectory :bfd:
  114.     ::mpw-build all
  115. Else If "{BuildTarget}" =~ /do-libiberty/
  116.     SetDirectory :libiberty:
  117.     ::mpw-build all
  118. Else If "{BuildTarget}" =~ /do-opcodes/
  119.     SetDirectory :opcodes:
  120.     ::mpw-build all
  121. Else If "{BuildTarget}" =~ /do-binutils/
  122.     SetDirectory :binutils:
  123.     ::mpw-build stamps
  124.     ::mpw-build all
  125. Else If "{BuildTarget}" =~ /do-gas/
  126.     SetDirectory :gas:
  127.     ::mpw-build stamps
  128.     ::mpw-build all
  129. Else If "{BuildTarget}" =~ /do-gcc/
  130.     SetDirectory :gcc:
  131.     :mpw-build all
  132. Else If "{BuildTarget}" =~ /do-gdb/
  133.     SetDirectory :gdb:
  134.     ::mpw-build all
  135. Else If "{BuildTarget}" =~ /do-grez/
  136.     SetDirectory :grez:
  137.     ::mpw-build all
  138. Else If "{BuildTarget}" =~ /do-ld/
  139.     SetDirectory :ld:
  140.     ::mpw-build all
  141. Else If "{BuildTarget}" =~ /do-newlib/
  142.     SetDirectory :newlib:
  143.     ::mpw-build all
  144. Else If "{BuildTarget}" =~ /install/
  145.     "{ThisScript}" install-binutils
  146.     "{ThisScript}" install-gas
  147.     "{ThisScript}" install-gcc
  148.     "{ThisScript}" install-ld
  149.     "{ThisScript}" install-gdb
  150. Else If "{BuildTarget}" =~ /install-binutils/
  151.     SetDirectory :binutils:
  152.     ::mpw-build install
  153. Else If "{BuildTarget}" =~ /install-gas/
  154.     SetDirectory :gas:
  155.     ::mpw-build install
  156. Else If "{BuildTarget}" =~ /install-gcc/
  157.     SetDirectory :gcc:
  158.     :mpw-build install
  159. Else If "{BuildTarget}" =~ /install-gdb/
  160.     SetDirectory :gdb:
  161.     ::mpw-build install
  162. Else If "{BuildTarget}" =~ /install-grez/
  163.     SetDirectory :grez:
  164.     ::mpw-build install
  165. Else If "{BuildTarget}" =~ /install-ld/
  166.     SetDirectory :ld:
  167.     ::mpw-build install
  168. Else If "{BuildTarget}" =~ /install-only/
  169.     "{ThisScript}" install-only-binutils
  170.     "{ThisScript}" install-only-gas
  171.     "{ThisScript}" install-only-gcc
  172.     "{ThisScript}" install-only-gdb
  173.     "{ThisScript}" install-only-ld
  174. Else If "{BuildTarget}" =~ /install-only-binutils/
  175.     SetDirectory :binutils:
  176.     ::mpw-build install-only
  177. Else If "{BuildTarget}" =~ /install-only-gas/
  178.     SetDirectory :gas:
  179.     ::mpw-build install-only
  180. Else If "{BuildTarget}" =~ /install-only-gcc/
  181.     SetDirectory :gcc:
  182.     :mpw-build install-only
  183. Else If "{BuildTarget}" =~ /install-only-gdb/
  184.     SetDirectory :gdb:
  185.     ::mpw-build install-only
  186. Else If "{BuildTarget}" =~ /install-only-grez/
  187.     SetDirectory :grez:
  188.     ::mpw-build install-only
  189. Else If "{BuildTarget}" =~ /install-only-ld/
  190.     SetDirectory :ld:
  191.     ::mpw-build install-only
  192. Else
  193.     Echo {BuildTarget} not understood, ignoring
  194. End If
  195.  
  196. SetDirectory "{savedir}"
  197.