mac-rom/Make/Build

318 lines
8.3 KiB
Plaintext
Raw Permalink Normal View History

#
# File: Build
#
# Contains: The main build script for building Universal ROMs.
#
# Copyright: <09> 1989-1993 by Apple Computer, Inc., all rights reserved.
#
# Change History (most recent first):
#
# <SM3> 9/21/93 kc Remove -symbols option. It is now turned on by default in the
# various makefiles.
# <SM2> 3/31/93 kc Update -Symbols option and move makeout file into the new text
# folder.
# <1> 2/21/93 kc first checked in
# <SM43> 2/11/93 CSS Rollin build script support for DBlite
# <SM42> 12/8/92 RC Added Build RISC feature (similar to the way Build LC930 works)
# <SM41> 12/2/92 kc Update AOpts and MOpts. Moved the line that sets the shell
# variable "Commands" into the makefiles, so that the output of
# make can be executed indipendently from the build script.
# <SM40> 11/23/92 kc Fix -p and add -ram option.
# <SM39> 11/23/92 kc Rewrite for new makefiles.
#
# Setup our aliases, variables, exports and defaults.
#
Set StartTime `Date -n`
Set Exit 0
UnSet Targets EchoCmds Quiet Progress BuildSet Overrides
Set Usage "<22>
/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\<5C>n<EFBFBD>
| usage: Build buildName<6D> [targets<74>] [options<6E>] |<7C>n<EFBFBD>
| |<7C>n<EFBFBD>
| buildNames: ROM 68k Universal ROM |<7C>n<EFBFBD>
| RISC RISC Universal ROM |<7C>n<EFBFBD>
| LC930 One meg rom for LC930 |<7C>n<EFBFBD>
| dbLite One meg rom for dbLite |<7C>n<EFBFBD>
| |<7C>n<EFBFBD>
| options: -ao <options> Assembler options |<7C>n<EFBFBD>
| -co <options> C compiler options |<7C>n<EFBFBD>
| -po <options> Pascal Compiler Options |<7C>n<EFBFBD>
| -lo <options> Linker Options |<7C>n<EFBFBD>
| -mo <options> Make Options |<7C>n<EFBFBD>
| -d <equates> Define (or override) equates |<7C>n<EFBFBD>
| -e Everything is forced to be rebuilt |<7C>n<EFBFBD>
| -echo Echo Build Commands |<7C>n<EFBFBD>
| -help Print this message |<7C>n<EFBFBD>
| -listing Generating assembly listings |<7C>n<EFBFBD>
| -p Display build progress information |<7C>n<EFBFBD>
| -q Do a quiet build (no progress info.) |<7C>n<EFBFBD>
| -ram Build an image for Romulator |<7C>n<EFBFBD>
| -src <dir> Use sources in specified directory |<7C>n<EFBFBD>
| -novectorize Inhibit vectorization |<7C>n<EFBFBD>
| -warnings <off | on> Turn warning off or on. |<7C>n<EFBFBD>
\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/"
#
# If we have no parameters, run commando (if we haven't allready).
#
If !{#}
If {DoCommando} || {BackgroundShell}
Build -help
Exit 0
End
Set DoCommando True
Export DoCommando
Build<6C>
Exit
End
#
# Don't use dialogs if we didn't use commando.
#
If !{DoCommando}
Alias Alert 'Echo > Dev:StdErr'
End
#
# Loop thru and parse our parameters.
#
Loop
If !{#} # Done?
If !"{BuildSet}"
Alert "You must specify at least one build name or target"
Exit 0
End
Break
End
If "{1}" =~ /"ROM"/ # Build universal ROM?
Set BuildSet "{BuildSet} {1}"
Shift; Continue
End
If "{1}" =~ /"RISC"/ # Build RISC?
Set BuildSet "{BuildSet} {1}"
Shift; Continue
End
If "{1}" =~ /"LC930"/ # Build LC930?
Set BuildSet "{BuildSet} {1}"
Shift; Continue
End
If "{1}" =~ /"dbLite"/ # Build LC930?
Set BuildSet "{BuildSet} {1}"
Shift; Continue
End
If "{1}" !~ /-<2D>/ # Target?
Set Targets "{Targets} {1}"
Shift; Continue
End
If "{1}" =~ /"-ao"/ # AOpts
If {#} < 2
Alert "You must specify <options> with the <20>-ao<61> option."
Exit 1
End
Set AOpts "{AOpts} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-co"/ # COpts
If {#} < 2
Alert "You must specify <options> with the <20>-co<63> option."
Exit 1
End
Set COpts "{COpts} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-po"/ # POpts
If {#} < 2
Alert "You must specify <options> with the <20>-po<70> option."
Exit 1
End
Set POpts "{POpts} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-lo"/ # LOpts
If {#} < 2
Alert "You must specify <options> with the <20>-lo<6C> option."
Exit 1
End
Set LOpts "{LOpts} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-mo"/ # MOpts
If {#} < 2
Alert "You must specify <options> with the <20>-mo<6D> option."
Exit 1
End
Set MOpts "{MOpts} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-d"/ # Defines
If {#} < 2
Alert "You must specify <equates> with the <20>-d<> option."
Exit 1
End
Set Overrides "{Overrides} {2}"
Shift 2; Continue
End
If "{1}" =~ /"-e"/ # Build everything
Set MOpts "{MOpts} {1}"
Shift; Continue
End
If "{1}" =~ /"-echo"/ # Echo commands
Set EchoCmds "True"
Shift; Continue
End
If "{1}" =~ /"-h"<22>/ # Help
Echo "{Usage}"
Exit 0;
End
If "{1}" =~ /"-listing"/ # Listing
Set AOpts "{AOpts} -l"
Shift; Continue
End
If "{1}" =~ /"-p"/ # Progress
Set Progress "True"
Shift; Continue
End
If "{1}" =~ /"-q"/ # Quiet
Set Quiet "True"
Shift; Continue
End
If "{1}" =~ /"-ram"/ # Romulator
Set Overrides "{Overrides} forRomulator=TRUE"
Shift; Continue
End
If "{1}" =~ /"-src"/ # Directory
If {#} < 2
Alert "You must specify <dir> with the <20>-src<72> option."
Exit 1
End
Set Sources "{2}"
Shift 2; Continue
End
If "{1}" =~ /"-novectorize"/ # Inhibit vectorization
Set VOpts "{VOpts} -nopatch"
Set Overrides "{Overrides} nonVectorizedRom=TRUE"
Shift; Continue
End
If "{1}" =~ /"-warnings"/ # Warnings
If {#} < 2
Alert "You must specify <level> with the <20>-warnings<67> option."
Exit 1
End
If "{2}" =~ /off/
Set AOpts "{AOpts} -w -wb"
Set COpts "{COpts} -warnings off"
Set LOpts "{LOpts} -w -d"
Set LibOpts "{LibOpts} -w -d"
Set VOpts "{VOpts} -w"
Else
Set COpts "{COpts} -warnings on"
End
Shift 2; Continue
Else # Unknown Option
Alert "Unknown Option <20>"{1}<7D>"."
Exit 1
End
End #Loop
#
# Make sure that we FeatureSet as the first target
#
If "{Targets}"
Set Targets "FeatureSet {Targets}"
End
#
# Set the make options
#
If {Progress}
Set MOpts "{MOpts} -h 'Echo Creating <20>"<22>{Targ<72>}<7D>"'"
End
Set MOpts "{MOpts} -d AOpts=<3D>"{AOpts}<7D>" <09>
-d COpts=<3D>"{COpts}<7D>" <09>
-d POpts=<3D>"{POpts}<7D>" <09>
-d LOpts=<3D>"{LOpts}<7D>" <09>
-d LibOpts=<3D>"{LibOpts}<7D>" <09>
-d VOpts=<3D>"{VOpts}<7D>" <09>
-d Sources=<3D>"{Sources}<7D>" <09>
-d Overrides=<3D>"{Overrides}<7D>""
#
# For each build
#
If !{Quiet}
Echo "Start Time: `Date -t -c {StartTime}`"
End
For Build in {BuildSet}
If "{Build}" =~ /ROM/ # locate the makefile
Set MakeFile "{Sources}Make:Universal.Make"
Set MakeOut "{Sources}BuildResults:Universal:Text:MakeOut"
Else If "{Build}" =~ /RISC/
Set MakeFile "{Sources}Make:RISC.Make"
Set MakeOut "{Sources}BuildResults:RISC:Text:MakeOut"
Else If "{Build}" =~ /LC930/
Set MakeFile "{Sources}Make:LC930.Make"
Set MakeOut "{Sources}BuildResults:LC930:Text:MakeOut"
Else If "{Build}" =~ /dbLite/
Set MakeFile "{Sources}Make:dbLite.Make"
Set MakeOut "{Sources}BuildResults:dbLite:Text:MakeOut"
Else
Alert "Error: Unknown build <20>{Build}<7D>"
Exit 1
End
Make -w {MOpts} {Targets} -f "{MakeFile}" > "{MakeOut}" || Exit
If {EchoCmds}
Set Echo 1
End
Execute "{MakeOut}"
Set Echo 0
End # For each build
#
# Calculate the elapsed time
#
If !{Quiet}
Set StopTime `Date -n`
Set TotalTime `Evaluate {StopTime}-{StartTime}`
Echo "Stop Time: `Date -t -c {StopTime}`"
Echo "Total Time: "`Date -t -c {TotalTime} | StreamEdit -e "/<2F>/ <20>
Replace /<2F>12/ <20>" 00<30>"; Replace /[AP]M/ <20>"<22>" "`
End
Exit 0
#
# End
#