* Just to be sure everybody gets to read all this stuff, let's turn on echo
set echo on
*
* This exec file will compile, link, etc to produce the rTutor.S16 application
*
* First, we compile and link the APW C source to produce the data fork
*
compile rtutor.cc keep=$
linkIIGS 2/start.root rtutor.root -lib 2/clib -t exe -o rtutor.dfork
*
* Second, we compile the Rez source to create the resource fork
* be sure to set the resulting file type to that of a "resource only file"
* see Apple II File Type Note for file type $5E
* The Rez source has been split into two files so that the stuff that hasn't
* changed since the last time doesn't have to be recompiled.  This helps
* speed up future compiles.  The new stuff is simply "appended" to the old stuff
compile rtutor.rez keep=rtutor.rfork rez=(-t $5E)
compile rtutor.new.rez keep=rtutor.rfork rez=(-t $5E -a rtutor.rfork)
*
* Now put the pieces together to form the complete app
* First, we delete the old app (which may or may not exist)
* To protect against this script exiting if we try to delete a file
* that doesn't exist, we'll just turn off the "exit" variable before
* we try to delete the file.  Turn it back on afterwards to catch other
* errors
unset exit
delete rtutor.s16
set exit on
* Copy the data fork to the new app
duplicate -d rtutor.dfork rtutor.s16
* Copy the resource fork to the new app
duplicate -r rtutor.rfork rtutor.s16
*
* Set the file type of the resulting application to S16
filetype rtutor.s16 s16
*
* That's it, go run the app and then study it to learn more about how
* wonderful resources are!!
*
