home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / libg++-2.7.1-base.tgz / libg++-2.7.1-src.tar / fsf / libg++ / mpw-build.in < prev    next >
Text File  |  1995-09-26  |  5KB  |  192 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-ld/
  102.     "{ThisScript}" all-libiberty
  103.     "{ThisScript}" all-bfd
  104.     "{ThisScript}" all-opcodes
  105.     "{ThisScript}" all-byacc
  106.     "{ThisScript}" all-flex
  107.     "{ThisScript}" do-ld
  108. Else If "{BuildTarget}" =~ /do-byacc/
  109.     SetDirectory :byacc:
  110.     ::mpw-build all
  111. Else If "{BuildTarget}" =~ /do-flex/
  112.     SetDirectory :flex:
  113.     ::mpw-build all
  114. Else If "{BuildTarget}" =~ /do-bfd/
  115.     SetDirectory :bfd:
  116.     ::mpw-build all
  117. Else If "{BuildTarget}" =~ /do-libiberty/
  118.     SetDirectory :libiberty:
  119.     ::mpw-build all
  120. Else If "{BuildTarget}" =~ /do-opcodes/
  121.     SetDirectory :opcodes:
  122.     ::mpw-build all
  123. Else If "{BuildTarget}" =~ /do-binutils/
  124.     SetDirectory :binutils:
  125.     ::mpw-build all
  126. Else If "{BuildTarget}" =~ /do-gas/
  127.     SetDirectory :gas:
  128.     ::mpw-build stamps
  129.     ::mpw-build all
  130. Else If "{BuildTarget}" =~ /do-gcc/
  131.     SetDirectory :gcc:
  132.     # Need separate step to build all the insn-... etc files.
  133.     ::mpw-build stamps-h
  134.     ::mpw-build stamps-c
  135.     ::mpw-build all
  136. Else If "{BuildTarget}" =~ /do-gdb/
  137.     SetDirectory :gdb:
  138.     ::mpw-build all
  139. Else If "{BuildTarget}" =~ /do-ld/
  140.     SetDirectory :ld:
  141.     ::mpw-build all
  142. Else If "{BuildTarget}" =~ /do-newlib/
  143.     SetDirectory :newlib:
  144.     ::mpw-build all
  145. Else If "{BuildTarget}" =~ /install/
  146.     "{ThisScript}" install-binutils
  147.     "{ThisScript}" install-gas
  148.     "{ThisScript}" install-gcc
  149.     "{ThisScript}" install-ld
  150.     "{ThisScript}" install-gdb
  151. Else If "{BuildTarget}" =~ /install-binutils/
  152.     SetDirectory :binutils:
  153.     ::mpw-build install
  154. Else If "{BuildTarget}" =~ /install-gas/
  155.     SetDirectory :gas:
  156.     ::mpw-build install
  157. Else If "{BuildTarget}" =~ /install-gcc/
  158.     SetDirectory :gcc:
  159.     ::mpw-build install
  160. Else If "{BuildTarget}" =~ /install-gdb/
  161.     SetDirectory :gdb:
  162.     ::mpw-build install
  163. Else If "{BuildTarget}" =~ /install-ld/
  164.     SetDirectory :ld:
  165.     ::mpw-build install
  166. Else If "{BuildTarget}" =~ /install-only/
  167.     "{ThisScript}" install-only-binutils
  168.     "{ThisScript}" install-only-gas
  169.     "{ThisScript}" install-only-gcc
  170.     "{ThisScript}" install-only-gdb
  171.     "{ThisScript}" install-only-ld
  172. Else If "{BuildTarget}" =~ /install-only-binutils/
  173.     SetDirectory :binutils:
  174.     ::mpw-build install-only
  175. Else If "{BuildTarget}" =~ /install-only-gas/
  176.     SetDirectory :gas:
  177.     ::mpw-build install-only
  178. Else If "{BuildTarget}" =~ /install-only-gcc/
  179.     SetDirectory :gcc:
  180.     ::mpw-build install-only
  181. Else If "{BuildTarget}" =~ /install-only-gdb/
  182.     SetDirectory :gdb:
  183.     ::mpw-build install-only
  184. Else If "{BuildTarget}" =~ /install-only-ld/
  185.     SetDirectory :ld:
  186.     ::mpw-build install-only
  187. Else
  188.     Echo {BuildTarget} not understood, ignoring
  189. End If
  190.  
  191. SetDirectory "{savedir}"
  192.