1994-01-15 21:46:29 +01:00
|
|
|
# Top-level script fragment to build everything for MPW.
|
|
|
|
|
|
|
|
Set savedir "`Directory`"
|
|
|
|
|
|
|
|
#Set Echo 1
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
Set ThisScript "{0}"
|
1994-01-15 21:46:29 +01:00
|
|
|
|
|
|
|
Set objdir ":"
|
|
|
|
|
|
|
|
Set verify 0
|
|
|
|
|
|
|
|
Set BuildTarget "none"
|
|
|
|
|
|
|
|
# Parse arguments.
|
|
|
|
|
|
|
|
Loop
|
|
|
|
Break If {#} == 0
|
|
|
|
If "{BuildTarget}" =~ /none/
|
|
|
|
Set BuildTarget "{1}"
|
|
|
|
Else
|
|
|
|
Echo Only one build target allowed, ignoring "{1}"
|
|
|
|
End If
|
|
|
|
Shift 1
|
|
|
|
End Loop
|
|
|
|
|
1998-11-11 06:47:47 +01:00
|
|
|
If "{BuildTarget}" =~ /none/
|
|
|
|
Set BuildTarget "all"
|
|
|
|
End If
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
If {verify} == 1
|
|
|
|
Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ...
|
|
|
|
End If
|
|
|
|
|
1998-11-11 06:47:47 +01:00
|
|
|
Set ranmake 0
|
|
|
|
|
1994-02-28 01:15:29 +01:00
|
|
|
If "`Exists Makefile`" != ""
|
|
|
|
Echo "Set Echo 1" >{BuildTarget}.makeout
|
|
|
|
Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout
|
|
|
|
{BuildTarget}.makeout
|
|
|
|
Delete {BuildTarget}.makeout
|
1998-11-11 06:47:47 +01:00
|
|
|
Set ranmake 1
|
|
|
|
End If
|
|
|
|
|
|
|
|
If "`Exists Makefile.PPC`" != ""
|
|
|
|
Echo "Set Echo 1" >{BuildTarget}.makeout.ppc
|
|
|
|
Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc
|
|
|
|
{BuildTarget}.makeout.ppc
|
|
|
|
Delete {BuildTarget}.makeout.ppc
|
|
|
|
Set ranmake 1
|
|
|
|
End If
|
|
|
|
|
|
|
|
If {ranmake} == 1
|
|
|
|
Exit
|
|
|
|
End If
|
|
|
|
|
|
|
|
# Dispatch on various pseudo-targets.
|
|
|
|
|
|
|
|
If "{BuildTarget}" =~ /all/
|
|
|
|
Echo Started `Date`
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" all-gcc
|
|
|
|
"{ThisScript}" all-gdb
|
1998-11-11 06:47:47 +01:00
|
|
|
Echo Finished `Date`
|
|
|
|
Else If "{BuildTarget}" =~ /all-libiberty/
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-libiberty
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-bfd/
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-bfd
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-opcodes/
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-opcodes
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-byacc/
|
|
|
|
"{ThisScript}" do-byacc
|
|
|
|
Else If "{BuildTarget}" =~ /all-flex/
|
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" do-flex
|
|
|
|
Else If "{BuildTarget}" =~ /all-binutils/
|
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" all-bfd
|
|
|
|
"{ThisScript}" all-opcodes
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-binutils
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-gas/
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" all-bfd
|
|
|
|
"{ThisScript}" all-opcodes
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-gas
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-gcc/
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" all-libiberty
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" all-gas
|
|
|
|
"{ThisScript}" all-binutils
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" all-ld
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-gcc
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-gdb/
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" all-bfd
|
|
|
|
"{ThisScript}" all-opcodes
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-gdb
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-grez/
|
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" all-bfd
|
|
|
|
"{ThisScript}" do-grez
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /all-ld/
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" all-libiberty
|
|
|
|
"{ThisScript}" all-bfd
|
|
|
|
"{ThisScript}" all-opcodes
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" do-ld
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-byacc/
|
|
|
|
SetDirectory :byacc:
|
|
|
|
::mpw-build all
|
|
|
|
Else If "{BuildTarget}" =~ /do-flex/
|
|
|
|
SetDirectory :flex:
|
|
|
|
::mpw-build _bootstrap
|
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-bfd/
|
|
|
|
SetDirectory :bfd:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-libiberty/
|
|
|
|
SetDirectory :libiberty:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-opcodes/
|
|
|
|
SetDirectory :opcodes:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-binutils/
|
|
|
|
SetDirectory :binutils:
|
1998-11-11 06:47:47 +01:00
|
|
|
::mpw-build stamps
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-gas/
|
|
|
|
SetDirectory :gas:
|
1998-11-11 06:47:47 +01:00
|
|
|
::mpw-build stamps
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-gcc/
|
|
|
|
SetDirectory :gcc:
|
1998-11-11 06:47:47 +01:00
|
|
|
:mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-gdb/
|
|
|
|
SetDirectory :gdb:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-grez/
|
|
|
|
SetDirectory :grez:
|
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-ld/
|
|
|
|
SetDirectory :ld:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build all
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /do-newlib/
|
|
|
|
SetDirectory :newlib:
|
|
|
|
::mpw-build all
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install/
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" install-only-top
|
1994-02-28 01:15:29 +01:00
|
|
|
"{ThisScript}" install-binutils
|
|
|
|
"{ThisScript}" install-gas
|
|
|
|
"{ThisScript}" install-gcc
|
|
|
|
"{ThisScript}" install-ld
|
1998-11-11 06:47:47 +01:00
|
|
|
"{ThisScript}" install-gdb
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-binutils/
|
|
|
|
SetDirectory :binutils:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build install
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-gas/
|
|
|
|
SetDirectory :gas:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build install
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-gcc/
|
|
|
|
SetDirectory :gcc:
|
1998-11-11 06:47:47 +01:00
|
|
|
:mpw-build install
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-gdb/
|
|
|
|
SetDirectory :gdb:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build install
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-grez/
|
|
|
|
SetDirectory :grez:
|
|
|
|
::mpw-build install
|
1994-01-15 21:46:29 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-ld/
|
|
|
|
SetDirectory :ld:
|
1994-02-28 01:15:29 +01:00
|
|
|
::mpw-build install
|
1998-11-11 06:47:47 +01:00
|
|
|
Else If "{BuildTarget}" =~ /install-only/
|
|
|
|
"{ThisScript}" install-only-top
|
|
|
|
"{ThisScript}" install-only-binutils
|
|
|
|
"{ThisScript}" install-only-gas
|
|
|
|
"{ThisScript}" install-only-gcc
|
|
|
|
"{ThisScript}" install-only-gdb
|
|
|
|
"{ThisScript}" install-only-ld
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-binutils/
|
|
|
|
SetDirectory :binutils:
|
|
|
|
::mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-gas/
|
|
|
|
SetDirectory :gas:
|
|
|
|
::mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-gcc/
|
|
|
|
SetDirectory :gcc:
|
|
|
|
:mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-gdb/
|
|
|
|
SetDirectory :gdb:
|
|
|
|
::mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-grez/
|
|
|
|
SetDirectory :grez:
|
|
|
|
::mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-ld/
|
|
|
|
SetDirectory :ld:
|
|
|
|
::mpw-build install-only
|
|
|
|
Else If "{BuildTarget}" =~ /install-only-top/
|
|
|
|
NewFolderRecursive "{prefix}"
|
|
|
|
If "{prefix}" != "`Directory`"
|
|
|
|
Duplicate -y 'Read Me for MPW' "{prefix}"'Read Me for MPW'
|
|
|
|
Duplicate -y Install "{prefix}"Install
|
|
|
|
End If
|
1994-01-15 21:46:29 +01:00
|
|
|
Else
|
1998-11-11 06:47:47 +01:00
|
|
|
Echo {BuildTarget} not understood, ignoring
|
1994-01-15 21:46:29 +01:00
|
|
|
End If
|
|
|
|
|
|
|
|
SetDirectory "{savedir}"
|