home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gdb-4.16-base.tgz / gdb-4.16-base.tar / fsf / gdb / mpw-build.in < prev    next >
Text File  |  1996-01-25  |  5KB  |  208 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}" all-byacc
  76.     "{ThisScript}" do-flex
  77. Else If "{BuildTarget}" =~ /all-binutils/
  78.     "{ThisScript}" all-libiberty
  79.     "{ThisScript}" all-bfd
  80.     "{ThisScript}" all-opcodes
  81.     "{ThisScript}" all-byacc
  82.     "{ThisScript}" all-flex
  83.     "{ThisScript}" do-binutils
  84. Else If "{BuildTarget}" =~ /all-gas/
  85.     "{ThisScript}" all-libiberty
  86.     "{ThisScript}" all-bfd
  87.     "{ThisScript}" all-opcodes
  88.     "{ThisScript}" do-gas
  89. Else If "{BuildTarget}" =~ /all-gcc/
  90.     "{ThisScript}" all-libiberty
  91.     "{ThisScript}" all-byacc
  92.     "{ThisScript}" all-gas
  93.     "{ThisScript}" all-binutils
  94.     "{ThisScript}" do-gcc
  95. Else If "{BuildTarget}" =~ /all-gdb/
  96.     "{ThisScript}" all-libiberty
  97.     "{ThisScript}" all-bfd
  98.     "{ThisScript}" all-opcodes
  99.     "{ThisScript}" all-byacc
  100.     "{ThisScript}" do-gdb
  101. Else If "{BuildTarget}" =~ /all-grez/
  102.     "{ThisScript}" all-libiberty
  103.     "{ThisScript}" all-bfd
  104.     "{ThisScript}" all-byacc
  105.     "{ThisScript}" do-grez
  106. Else If "{BuildTarget}" =~ /all-ld/
  107.     "{ThisScript}" all-libiberty
  108.     "{ThisScript}" all-bfd
  109.     "{ThisScript}" all-opcodes
  110.     "{ThisScript}" all-byacc
  111.     "{ThisScript}" all-flex
  112.     "{ThisScript}" do-ld
  113. Else If "{BuildTarget}" =~ /do-byacc/
  114.     SetDirectory :byacc:
  115.     ::mpw-build all
  116. Else If "{BuildTarget}" =~ /do-flex/
  117.     SetDirectory :flex:
  118.     ::mpw-build _bootstrap
  119.     ::mpw-build all
  120. Else If "{BuildTarget}" =~ /do-bfd/
  121.     SetDirectory :bfd:
  122.     ::mpw-build all
  123. Else If "{BuildTarget}" =~ /do-libiberty/
  124.     SetDirectory :libiberty:
  125.     ::mpw-build all
  126. Else If "{BuildTarget}" =~ /do-opcodes/
  127.     SetDirectory :opcodes:
  128.     ::mpw-build all
  129. Else If "{BuildTarget}" =~ /do-binutils/
  130.     SetDirectory :binutils:
  131.     ::mpw-build stamps
  132.     ::mpw-build all
  133. Else If "{BuildTarget}" =~ /do-gas/
  134.     SetDirectory :gas:
  135.     ::mpw-build stamps
  136.     ::mpw-build all
  137. Else If "{BuildTarget}" =~ /do-gcc/
  138.     SetDirectory :gcc:
  139.     # Need separate step to build all the insn-... etc files.
  140.     ::mpw-build stamps-h
  141.     ::mpw-build stamps-c
  142.     ::mpw-build all
  143. Else If "{BuildTarget}" =~ /do-gdb/
  144.     SetDirectory :gdb:
  145.     ::mpw-build all
  146. Else If "{BuildTarget}" =~ /do-grez/
  147.     SetDirectory :grez:
  148.     ::mpw-build all
  149. Else If "{BuildTarget}" =~ /do-ld/
  150.     SetDirectory :ld:
  151.     ::mpw-build all
  152. Else If "{BuildTarget}" =~ /do-newlib/
  153.     SetDirectory :newlib:
  154.     ::mpw-build all
  155. Else If "{BuildTarget}" =~ /install/
  156.     "{ThisScript}" install-binutils
  157.     "{ThisScript}" install-gas
  158.     "{ThisScript}" install-gcc
  159.     "{ThisScript}" install-ld
  160.     "{ThisScript}" install-gdb
  161. Else If "{BuildTarget}" =~ /install-binutils/
  162.     SetDirectory :binutils:
  163.     ::mpw-build install
  164. Else If "{BuildTarget}" =~ /install-gas/
  165.     SetDirectory :gas:
  166.     ::mpw-build install
  167. Else If "{BuildTarget}" =~ /install-gcc/
  168.     SetDirectory :gcc:
  169.     ::mpw-build install
  170. Else If "{BuildTarget}" =~ /install-gdb/
  171.     SetDirectory :gdb:
  172.     ::mpw-build install
  173. Else If "{BuildTarget}" =~ /install-grez/
  174.     SetDirectory :grez:
  175.     ::mpw-build install
  176. Else If "{BuildTarget}" =~ /install-ld/
  177.     SetDirectory :ld:
  178.     ::mpw-build install
  179. Else If "{BuildTarget}" =~ /install-only/
  180.     "{ThisScript}" install-only-binutils
  181.     "{ThisScript}" install-only-gas
  182.     "{ThisScript}" install-only-gcc
  183.     "{ThisScript}" install-only-gdb
  184.     "{ThisScript}" install-only-ld
  185. Else If "{BuildTarget}" =~ /install-only-binutils/
  186.     SetDirectory :binutils:
  187.     ::mpw-build install-only
  188. Else If "{BuildTarget}" =~ /install-only-gas/
  189.     SetDirectory :gas:
  190.     ::mpw-build install-only
  191. Else If "{BuildTarget}" =~ /install-only-gcc/
  192.     SetDirectory :gcc:
  193.     ::mpw-build install-only
  194. Else If "{BuildTarget}" =~ /install-only-gdb/
  195.     SetDirectory :gdb:
  196.     ::mpw-build install-only
  197. Else If "{BuildTarget}" =~ /install-only-grez/
  198.     SetDirectory :grez:
  199.     ::mpw-build install-only
  200. Else If "{BuildTarget}" =~ /install-only-ld/
  201.     SetDirectory :ld:
  202.     ::mpw-build install-only
  203. Else
  204.     Echo {BuildTarget} not understood, ignoring
  205. End If
  206.  
  207. SetDirectory "{savedir}"
  208.