home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!haven.umd.edu!purdue!mentor.cc.purdue.edu!noose.ecn.purdue.edu!gn.ecn.purdue.edu!jess
- From: jess@gn.ecn.purdue.edu (Jess M Holle)
- Subject: ANSWER: MPW beep at end of build
- Message-ID: <1993Jan8.192751.3143@gn.ecn.purdue.edu>
- Organization: Purdue University Engineering Computer Network
- Date: Fri, 8 Jan 93 19:27:51 GMT
- Lines: 78
-
- I posted a question regarding how to do this a couple of days back and
- got no answers (though I did get responses). Anyway, after studying
- the MPW manuals and some experimentation, I got things working, so here
- it is if anybody else wants it.
-
- (I did this so that I could do other things during long builds and be
- notified when they were done)
-
- Jess Holle
-
-
- # BuildProgram - build the specified program
- #
- # Usage:
- # BuildProgram program [optionsI] > log
- #
- # The BuildProgram script builds the specified program (or target).
- # A simple transcript of the build is written to standard output.
- #
- # Make is used to generate the build commands. If file <program>.make
- # exists it is used as the makefile. If not, file MakeFile is used.
- #
- # The options specified are passed directly to Make, and control the
- # generation of the build commands.
- #
- #
- # Copyright Apple Computer, Inc. 1987 - 1990
- # All rights reserved.
-
- Set Exit 1
-
- # Find the program parameter.
-
- Unset program
- For i In {"Parameters"}
- If "{i}" !~ /-E/
- Set program "{i}"
- Break
- End
- End
- If "{program}" == ""
- Echo "### {0} - Specify a program to build." > Dev:StdErr
- Echo "# Usage - {0} program [optionsI]" > Dev:StdErr
- Beep; Beep; Exit 1
- End
-
- # Select the makefile.
-
- Set makefile `(Files -t TEXT "{program}".make || 6
- Files -t TEXT MakeFile || Echo '""') 3 Dev:Null`
- If "{makefile}" == ""
- Echo "### {0} - No makefile exists for {program}." > Dev:StdErr
- Beep; Beep; Exit 1
- End
-
- # Run Make, then execute its output.
-
- Echo "# `Date -t` ----- Build of {program}."
- Echo "# `Date -t` ----- Analyzing dependencies."
- Begin
- Echo "Set Exit 1"
- Echo "Set Echo 1"
- Make {"Parameters"} -f "{makefile}"
- End > "{program}".makeout
- Echo "# `Date -t` ----- Executing build commands."
- Set Exit 0
- "{program}".makeout || (Beep; Beep; Set Exit 1; Exit 1)
- Set Exit 1; Beep; Beep # this set of beeps can be moved to the end if desired
- Delete "{program}".makeout
- Echo "# `Date -t` ----- Done."
- Set type "`files -i -n -x t "{program}" 3 Dev:Null || Set Status 0`"
- If "{type}" =~ /E APPL/ OR "{type}" =~ /E MPST/ # application or tool
- Echo -n 6t; Quote -n "{program}"; Echo -n " "
- Else If "{type}" =~ /E DFIL/ # desk accessory
- Echo -n 6t
- Quote -n "Font/DA Mover" "{SystemFolder}"System "{program}";
- Echo -n " # Install DA"
- End
-