home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / online / source / c / compilers / GCC-2.3.3r12.sit.hqx / GCC-2.3.3r12 / BuildGCC next >
Text File  |  1993-06-03  |  2KB  |  97 lines

  1. # Do from one to four stages of GCC compilation/self-compilation,
  2. # for all the target machines specified.
  3. #
  4. # This script can take a very long time to run!
  5. #
  6. # Copyright © 1990-1993 Apple Computer, Inc.
  7.  
  8. set GCC "`Directory -q`"
  9.  
  10. Set BuildList ""
  11. Set Testing ""
  12. Set CheckArg ""
  13. Set TargetMainFolder ":Targets:"
  14.  
  15. # Bison needs this to be defined.
  16.  
  17. If "{BISON_SIMPLE}" == ""
  18.     Set BISON_SIMPLE "{Libraries}bison.simple"
  19.     Export BISON_SIMPLE
  20. End If
  21.  
  22. # Recognize specific options, put everything else on the build list.
  23.  
  24. Loop
  25.      Break If "{#}" == 0
  26.     If "{1}" =~ /-check/
  27.         Set Testing "Echo '    '"
  28.         Set CheckArg "{1}"
  29.     Else If "{1}" =~ /-folder/
  30.         Shift 1
  31.         Set TargetMainFolder "{1}"
  32.     Else If "{1}" =~ /-help/
  33.         echo     "BuildGCC [<target>][,stages][,programs] ... [ options ]"
  34.         echo    "    -check                Display commands without executing them"
  35.         echo    "    -folder    <xxx>        Get following targets from folder <xxx>"
  36.         echo    "    -help                Display this message"
  37.         echo    ""
  38.         echo    "Target machines currently set up in {TargetMainFolder}"
  39.         echo    ""
  40.         For TargetFolder in `Files "{TargetMainFolder}"`
  41.             If "{TargetFolder}" =~ /:(≈)®1:/
  42.                 # should test for existence of all required files?
  43.                 If "`Exists {TargetMainFolder}{®1}:config.h`" != ""
  44.                     echo    "    " "{®1}"
  45.                 End If
  46.             End If
  47.         End For
  48.         Echo    ""
  49.         Exit 0
  50.     Else
  51.         Set BuildList "{BuildList} {1}"
  52.     End If
  53.     Shift 1
  54. End Loop
  55.  
  56. # Add a default build if none were requested.
  57.  
  58. if "{BuildList}" == ""
  59.     Set BuildList "Mac68K,1,all"
  60. End If
  61.  
  62. # Iterate through the different builds and stages.
  63.  
  64. For ABuild in {BuildList}
  65.     Set NumStages 1
  66.     Set TargetMachine Mac68K
  67.     Set Programs all
  68.     If "{ABuild}" =~ /(≈)®1,([0-9])®2,(≈)®3/
  69.         set TargetMachine "{®1}"
  70.         set NumStages "{®2}"
  71.         set Programs "{®3}"
  72.     Else If "{ABuild}" =~ /(≈)®1,([0-9])®2/
  73.         set TargetMachine "{®1}"
  74.         set NumStages "{®2}"
  75.     Else If "{ABuild}" =~ /([0-9])®1,(≈)®2/
  76.         set NumStages "{®1}"
  77.         set Programs "{®2}"
  78.     Else if "{ABuild}" =~ /([0-9])®2/
  79.         set NumStages "{®2}"
  80.     Else if "{ABuild}" =~ /[¬,]+/
  81.         set TargetMachine "{ABuild}"
  82.     Else
  83.         # Go with one stage of default build
  84.     End
  85.     Set StageN 1
  86.     Loop
  87.         Break If {StageN} > {NumStages}
  88.         Directory "{GCC}"
  89.         {Testing} {GCC}Build:BuildOneStage "{TargetMachine}" {StageN} "{Programs}"
  90.         If "{Testing}" != ""
  91.             {GCC}Build:BuildOneStage "{TargetMachine}" {StageN} "{Programs}" "{Testing}"
  92.         End If
  93.         Evaluate StageN += 1
  94.     End
  95. End For
  96.  
  97.