home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21023 < prev    next >
Encoding:
Text File  |  1993-01-08  |  2.6 KB  |  88 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!haven.umd.edu!purdue!mentor.cc.purdue.edu!noose.ecn.purdue.edu!gn.ecn.purdue.edu!jess
  3. From: jess@gn.ecn.purdue.edu (Jess M Holle)
  4. Subject: ANSWER: MPW beep at end of build
  5. Message-ID: <1993Jan8.192751.3143@gn.ecn.purdue.edu>
  6. Organization: Purdue University Engineering Computer Network
  7. Date: Fri, 8 Jan 93 19:27:51 GMT
  8. Lines: 78
  9.  
  10. I posted a question regarding how to do this a couple of days back and
  11. got no answers (though I did get responses).  Anyway, after studying
  12. the MPW manuals and some experimentation, I got things working, so here
  13. it is if anybody else wants it.
  14.  
  15. (I did this so that I could do other things during long builds and be
  16. notified when they were done)
  17.  
  18. Jess Holle
  19.  
  20.  
  21. #    BuildProgram - build the specified program
  22. #
  23. #    Usage:
  24. #        BuildProgram program [optionsI] > log
  25. #
  26. #    The BuildProgram script builds the specified program (or target).
  27. #    A simple transcript of the build is written to standard output.
  28. #
  29. #    Make is used to generate the build commands.  If file <program>.make
  30. #    exists it is used as the makefile.    If not, file MakeFile is used.
  31. #
  32. #    The options specified are passed directly to Make, and control the
  33. #    generation of the build commands.
  34. #
  35. #
  36. #    Copyright Apple Computer, Inc. 1987 - 1990
  37. #    All rights reserved.
  38.  
  39. Set Exit 1
  40.  
  41. #    Find the program parameter.
  42.  
  43. Unset program
  44. For i In {"Parameters"}
  45.     If "{i}" !~ /-E/
  46.         Set program "{i}"
  47.         Break
  48.     End
  49. End
  50. If "{program}" == ""
  51.     Echo "### {0} - Specify a program to build." > Dev:StdErr
  52.     Echo "# Usage - {0} program [optionsI]" > Dev:StdErr
  53.     Beep; Beep; Exit 1
  54. End
  55.  
  56. #    Select the makefile.
  57.  
  58. Set makefile `(Files -t TEXT "{program}".make || 6
  59.     Files -t TEXT MakeFile || Echo '""') 3 Dev:Null`
  60. If "{makefile}" == ""
  61.     Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
  62.     Beep; Beep; Exit 1
  63. End
  64.  
  65. #    Run Make, then execute its output.
  66.  
  67. Echo "# `Date -t` ----- Build of {program}."
  68. Echo "# `Date -t` ----- Analyzing dependencies."
  69. Begin
  70.     Echo "Set Exit 1"
  71.     Echo "Set Echo 1"
  72.     Make {"Parameters"} -f "{makefile}"
  73. End > "{program}".makeout
  74. Echo "# `Date -t` ----- Executing build commands."
  75. Set Exit 0
  76. "{program}".makeout || (Beep; Beep; Set Exit 1; Exit 1)
  77. Set Exit 1; Beep; Beep  # this set of beeps can be moved to the end if desired
  78. Delete "{program}".makeout
  79. Echo "# `Date -t` ----- Done."
  80. Set type "`files -i -n -x t "{program}" 3 Dev:Null || Set Status 0`"
  81. If "{type}" =~ /E APPL/ OR "{type}" =~ /E MPST/     # application or tool
  82.     Echo -n 6t; Quote -n "{program}"; Echo -n " "
  83. Else If "{type}" =~ /E DFIL/                        # desk accessory
  84.     Echo -n 6t
  85.     Quote -n "Font/DA Mover" "{SystemFolder}"System "{program}";
  86.     Echo -n "  # Install DA"
  87. End
  88.