familymsg.temp:  alt.temp family.tcl family.prefix
	metasend -P family.prefix -b -s "It's the Borenstein family message!" -o familymsg.temp -/ enabled-mail -E -f alt.temp -n -m application/safe-tcl -f family.tcl -e 7bit -D "The Safe-Tcl program that controls the interactive version of the message"

#AUDIOEXT=ext

#EXTREFS = miriam-startrek.ext miriam.ext  rachel.ext  shana.ext trina.ext nsb.ext

# Replace the above two definitions with the two below to produce a 
# version in which the audio is all in-line.

AUDIOEXT=auext.temp

EXTREFS = miriam-startrek.auext.temp miriam.auext.temp  rachel.auext.temp  shana.auext.temp trina.auext.temp nsb.auext.temp

TEXT = intro.txt greenbush.txt  miriam.txt  rachel.txt  shana.txt trina.txt nsb.txt latenews.txt technical.txt end.txt

AUDIO= miriam-startrek.au miriam.au  rachel.au  shana.au trina.au nsb.au

IMAGE = FishyTrina.gif HappyMiriam.gif HappyRachel.gif HappyShana.gif  HappyTrina2.gif MiriamAndRachel.gif ShanaAndMiriam.gif ThoughtfulMiriam.gif ThoughtfulTrina.gif UglyShana.gif Nathaniel.gif Nathaniel-recline.gif LonelyBridge.gif NewDeck.gif ViewFromRoad.gif

fulltext.temp : $(TEXT)
	cat $(TEXT) > fulltext.temp

alt.temp: fulltext.temp multi.temp alt.prefix
	metasend -P alt.prefix -b -o alt.temp -/ alternative -m text/plain -f fulltext.temp -e 7bit -D "The plain text version of the whole letter" -n -E -f multi.temp -e 7bit

miriam-startrek.ext: ext.generic
	sed -e "s/GENERIC/miriam-startrek.au/g;s/DETAILS/Miriam's Star Trek audio (by external reference)/" < ext.generic > miriam-startrek.ext

miriam.ext: ext.generic
	sed -e "s/GENERIC/miriam.au/g;s/DETAILS/Miriam reading her message aloud (by external reference)/" < ext.generic > miriam.ext

rachel.ext: ext.generic
	sed -e "s/GENERIC/rachel.au/g;s/DETAILS/Rachel reading her message aloud (by external reference)/" < ext.generic > rachel.ext

shana.ext: ext.generic
	sed -e "s/GENERIC/shana.au/g;s/DETAILS/Shana reading her message aloud (by external reference)/" < ext.generic > shana.ext

trina.ext: ext.generic
	sed -e "s/GENERIC/trina.au/g;s/DETAILS/Trina reading her message aloud (by external reference)/" < ext.generic > trina.ext

nsb.ext: ext.generic
	sed -e "s/GENERIC/nsb.au/g;s/DETAILS/Nathaniel reading his message aloud (by external reference)/" < ext.generic > nsb.ext

miriam-startrek.auext.temp: auext.generic
	sed -e "s/GENERIC/miriam-startrek.au/g;s/DETAILS/Miriam's Star Trek audio (by external reference)/" < auext.generic > miriam-startrek.auext.temp
	mmencode -b miriam-startrek.au >> miriam-startrek.auext.temp

miriam.auext.temp: auext.generic
	sed -e "s/GENERIC/miriam.au/g;s/DETAILS/Miriam reading her message aloud (by external reference)/" < auext.generic > miriam.auext.temp
	mmencode -b miriam.au >> miriam.auext.temp

rachel.auext.temp: auext.generic
	sed -e "s/GENERIC/rachel.au/g;s/DETAILS/Rachel reading her message aloud (by external reference)/" < auext.generic > rachel.auext.temp
	mmencode -b rachel.au >> rachel.auext.temp

shana.auext.temp: auext.generic
	sed -e "s/GENERIC/shana.au/g;s/DETAILS/Shana reading her message aloud (by external reference)/" < auext.generic > shana.auext.temp
	mmencode -b shana.au >> shana.auext.temp

trina.auext.temp: auext.generic
	sed -e "s/GENERIC/trina.au/g;s/DETAILS/Trina reading her message aloud (by external reference)/" < auext.generic > trina.auext.temp
	mmencode -b trina.au >> trina.auext.temp

nsb.auext.temp: auext.generic
	sed -e "s/GENERIC/nsb.au/g;s/DETAILS/Nathaniel reading his message aloud (by external reference)/" < auext.generic > nsb.auext.temp
	mmencode -b nsb.au >> nsb.auext.temp

multi.temp:   $(TEXT) $(IMAGE) $(EXTREFS) goodbye.au multi.prefix
	metasend -P multi.prefix -b -o multi.temp -s "It's the Borenstein family message!" \
	-D "The Borenstein family annual letter (introduction)" \
	-m text/plain -e 7bit -f intro.txt -i "<intro.txt@guppylake.bellcore.com>" -n \
	-D "Our summer in Greenbush" -e 7bit \
	-m text/plain -f greenbush.txt -i "<greenbush.txt@guppylake.bellcore.com>" -n \
	-D "The bridge Nathaniel built, surrounded by high water" \
	-m image/gif -e base64 -f LonelyBridge.gif -i "<LonelyBridge.gif@guppylake.bellcore.com>"  -n \
	-D "The new deck at Guppy Lake" \
	-m image/gif -e base64 -f NewDeck.gif -i "<NewDeck.gif@guppylake.bellcore.com>"  -n \
	-D "The View of Guppy Lake from the road, at high water" \
	-m image/gif -e base64 -f ViewFromRoad.gif -i "<ViewFromRoad.gif@guppylake.bellcore.com>"  -n \
	-D "Miriam talks about her year" \
	-m text/plain -e 7bit -f miriam.txt -i "<miriam.txt@guppylake.bellcore.com>" -n \
	-E -f miriam.$(AUDIOEXT)  -n \
	-E -f miriam-startrek.$(AUDIOEXT) -n \
	-D "Miriam looking happy" \
	-m image/gif -e base64 -f HappyMiriam.gif -i "<HappyMiriam.gif@guppylake.bellcore.com>" -n \
	-D "Shana and Miriam together" \
	-m image/gif -e base64 -f ShanaAndMiriam.gif -i "<ShanaAndMiriam.gif@guppylake.bellcore.com>" -n \
	-D "Miriam looking thoughtful" \
	-m image/gif -e base64 -f ThoughtfulMiriam.gif -i "<ThoughtfulMiriam.gif@guppylake.bellcore.com>" -n \
	-D "Rachel talks about her year" \
	-m text/plain -e 7bit -f rachel.txt -i "<rachel.txt@guppylake.bellcore.com>" -n \
	-E -f rachel.$(AUDIOEXT)  -n \
	-D "Rachel looking happy" \
	-m image/gif -e base64 -f HappyRachel.gif -i "<HappyRachel.gif@guppylake.bellcore.com>" -n \
	-D "Rachel and Miriam together" \
	-m image/gif -e base64 -f MiriamAndRachel.gif -i "<MiriamAndRachel.gif@guppylake.bellcore.com>" -n \
	-D "Shana talks about her year" \
	-m text/plain -e 7bit -f shana.txt -i "<shana.txt@guppylake.bellcore.com>" -n \
	-E -f shana.$(AUDIOEXT) -n \
	-D "Shana looking happy" \
	-m image/gif -e base64 -f HappyShana.gif -i "<HappyShana.gif@guppylake.bellcore.com>" -n \
	-D "Shana looking ugly" \
	-m image/gif -e base64 -f UglyShana.gif -i "<UglyShana.gif@guppylake.bellcore.com>" -n \
	-D "Trina talks about her year" \
	-m text/plain -e 7bit -f trina.txt -i "<trina.txt@guppylake.bellcore.com>" -n \
	-E -f trina.$(AUDIOEXT)  -n \
	-D "Trina making a fishy face" \
	-m image/gif -e base64 -f FishyTrina.gif -i "<FishyTrina.gif@guppylake.bellcore.com>" -n \
	-D "Trina looking happy" \
	-m image/gif -e base64 -f HappyTrina2.gif -i "<HappyTrina2.gif@guppylake.bellcore.com>" -n \
	-D "Trina looking thoughtful" \
	-m image/gif -e base64 -f ThoughtfulTrina.gif -i "<ThoughtfulTrina.gif@guppylake.bellcore.com>" -n \
	-D "Nathaniel talks about his year" \
	-m text/plain -e 7bit -f nsb.txt -i "<nsb.txt@guppylake.bellcore.com>" -n \
	-E -f nsb.$(AUDIOEXT)  -n \
	-D "Nathaniel playing guitar" \
	-m image/gif -e base64 -f Nathaniel.gif -i "<Nathaniel.gif@guppylake.bellcore.com>"  -n \
	-D "Nathaniel looking relaxed" \
	-m image/gif -e base64 -f Nathaniel-recline.gif -i "<Nathaniel-recline.gif@guppylake.bellcore.com>" -n \
	-D "Late breaking news" \
	-m text/plain -e 7bit -f latenews.txt -i "<latenews.txt@guppylake.bellcore.com>"  -n \
	-D "Technical notes on this message" \
	-m text/plain -e 7bit -f technical.txt -i "<technical.txt@guppylake.bellcore.com>" -n \
	-E -f psfile.ext  -n \
	-E -f whole.ext  -n \
	-E -f Makefile.ext -e 7bit -n \
	-D "Goodbye until next year!" \
	-m text/plain -e 7bit -f end.txt -i "<end.txt@guppylake.bellcore.com>"   -n \
	-D "Goodbye from all of us (audio)" \
	-m audio/basic -e base64 -f  goodbye.au -i "<goodbye.au@guppylake.bellcore.com>" 


clean:
	-rm multi.temp familymsg.temp

