bin_PROGRAMS = \
	zoom
pkgdata_DATA = zoomrc

EXTRA_DIST = zcode.ops zoomrc zoom.rc.in zoom.ico zoomsmall.ico \
	macos/Info.plist macos/PkgInfo macos/zoom-app.icns \
	macos/zoom-file.icns macos/zoom-game.icns \
	macos/zoom.nib/classes.nib macos/zoom.nib/info.nib \
	macos/zoom.nib/objects.xib macos/macreadme.rtf macos/zoomrc \
	zoomCocoa/PlugIns/README \
	zoomCocoa/ZDisplay.m              zoomCocoa/ZoomScrollView.m \
	zoomCocoa/ZFiles.m                zoomCocoa/ZoomServer.h \
	zoomCocoa/ZoomAppDelegate.h       zoomCocoa/ZoomServer.m \
	zoomCocoa/ZoomAppDelegate.m       zoomCocoa/ZoomTextView.h \
	zoomCocoa/ZoomClient.h            zoomCocoa/ZoomTextView.m \
	zoomCocoa/ZoomClient.m            zoomCocoa/ZoomUpperWindow.h \
	zoomCocoa/ZoomClientController.h  zoomCocoa/ZoomUpperWindow.m \
	zoomCocoa/ZoomClientController.m  zoomCocoa/ZoomUpperWindowView.h \
	zoomCocoa/ZoomLowerWindow.h       zoomCocoa/ZoomUpperWindowView.m \
	zoomCocoa/ZoomLowerWindow.m       zoomCocoa/ZoomView.h \
	zoomCocoa/ZoomMoreView.h          zoomCocoa/ZoomView.m \
	zoomCocoa/ZoomMoreView.m          zoomCocoa/ZoomZMachine.h \
	zoomCocoa/ZoomProtocol.h          zoomCocoa/ZoomZMachine.m \
	zoomCocoa/ZoomProtocol.m          zoomCocoa/main.m \
	zoomCocoa/ZoomScrollView.h 	  zoomCocoa/ZoomPreferences.m \
	zoomCocoa/ZoomPreferences.h	  zoomCocoa/ZoomPreferenceWindow.h \
	zoomCocoa/ZoomPreferenceWindow.m  zoomCocoa/ZoomMetadata.h \
	zoomCocoa/ZoomMetadata.m	  zoomCocoa/ZoomStory.h \
	zoomCocoa/ZoomStory.m		  zoomCocoa/ZoomStoryID.h \
	zoomCocoa/ZoomStoryID.m		  zoomCocoa/ZoomiFictionController.h \
	zoomCocoa/ZoomiFictionController.m zoomCocoa/ZoomStoryOrganiser.h \
	zoomCocoa/ZoomStoryOrganiser.m    zoomCocoa/ZoomGameInfoController.h \
	zoomCocoa/ZoomGameInfoController.m zoomCocoa/ZoomiFButton.h \
	zoomCocoa/ZoomiFButton.m 	  zoomCocoa/ZoomCollapsableView.h \
	zoomCocoa/ZoomCollapsableView.m	  zoomCocoa/ZoomSavePreview.h \
	zoomCocoa/ZoomSavePreview.m	  zoomCocoa/ZoomSavePreviewView.h \
	zoomCocoa/ZoomSavePreviewView.m	  zoomCocoa/ZoomRatingCell.h \
	zoomCocoa/ZoomRatingCell.m	  zoomCocoa/Z6Display.m \
	zoomCocoa/ZoomPixmapWindow.h	  zoomCocoa/ZoomPixmapWindow.m \
	zoomCocoa/ZoomCursor.h		  zoomCocoa/ZoomCursor.m \
	zoomCocoa/Skein/ZoomSkein.h       zoomCocoa/Skein/ZoomSkeinItem.h \
	zoomCocoa/Skein/ZoomSkein.m       zoomCocoa/Skein/ZoomSkeinItem.m \
	zoomCocoa/Resources/ZoomBlorbFile.h zoomCocoa/Resources/ZoomBlorbFile.m \
	zoomCocoa/ZoomCollapsingSplitView.h zoomCocoa/ZoomCollapsingSplitView.m \
	zoomCocoa/ZoomConnector.h         zoomCocoa/ZoomConnector.m \
	zoomCocoa/ZoomInputLine.h         zoomCocoa/ZoomInputLine.m \
	zoomCocoa/Resources/ZoomResourceDrop.h      zoomCocoa/Resources/ZoomResourceDrop.m \
	zoomCocoa/Skein/ZoomSkeinController.h zoomCocoa/Skein/ZoomSkeinController.m \
	zoomCocoa/Skein/ZoomSkeinLayout.h zoomCocoa/Skein/ZoomSkeinLayout.m \
	zoomCocoa/Skein/ZoomSkeinLayoutItem.h \
	zoomCocoa/Skein/ZoomSkeinLayoutItem.m \
	zoomCocoa/Skein/ZoomSkeinView.h   zoomCocoa/Skein/ZoomSkeinView.m \
	zoomCocoa/Skein/ZoomSkeinViewWeb.m zoomCocoa/Skein/ZoomSkeinWeb.m \
	zoomCocoa/Skein/ZoomSkeinXML.m \
	zoomCocoa/ZoomStoryTableView.h    zoomCocoa/ZoomStoryTableView.m \
	zoomCocoa/ZoomTextToSpeech.h	  zoomCocoa/ZoomTextToSpeech.m \
	zoomCocoa/ZoomHQImageView.h	  zoomCocoa/ZoomHQImageView.m \
	zoomCocoa/ZoomNotesController.h	  zoomCocoa/ZoomNotesController.m \
	zoomCocoa/ZoomClearView.h \
	zoomCocoa/ZoomClearView.m \
	zoomCocoa/ZoomDownloadView.h \
	zoomCocoa/ZoomDownloadView.m \
	zoomCocoa/ZoomJSError.h \
	zoomCocoa/ZoomJSError.m \
	zoomCocoa/ZoomWindowThatIsKey.h \
	zoomCocoa/ZoomWindowThatIsKey.m \
	zoomCocoa/PlugIns/ZoomGlkDocument.h \
	zoomCocoa/PlugIns/ZoomGlkDocument.m \
	zoomCocoa/PlugIns/ZoomGlkPlugIn.h \
	zoomCocoa/PlugIns/ZoomGlkPlugIn.m \
	zoomCocoa/PlugIns/ZoomGlkWindowController.h \
	zoomCocoa/PlugIns/ZoomGlkWindowController.m \
	zoomCocoa/PlugIns/ZoomGlulxe.h \
	zoomCocoa/PlugIns/ZoomGlulxe.m \
	zoomCocoa/PlugIns/ZoomPlugIn.h \
	zoomCocoa/PlugIns/ZoomPlugIn.m \
	zoomCocoa/PlugIns/ZoomBabel.h \
	zoomCocoa/PlugIns/ZoomBabel.m \
	zoomCocoa/PlugIns/ZoomGlkSaveRef.h \
	zoomCocoa/PlugIns/ZoomGlkSaveRef.m \
	zoomCocoa/PlugIns/ZoomDownload.h \
	zoomCocoa/PlugIns/ZoomDownload.m \
	zoomCocoa/PlugIns/ZoomPlugInCell.h \
	zoomCocoa/PlugIns/ZoomPlugInCell.m \
	zoomCocoa/PlugIns/ZoomPlugInController.h \
	zoomCocoa/PlugIns/ZoomPlugInController.m \
	zoomCocoa/PlugIns/ZoomPlugInInfo.h \
	zoomCocoa/PlugIns/ZoomPlugInInfo.m \
	zoomCocoa/PlugIns/ZoomPlugInManager.h \
	zoomCocoa/PlugIns/ZoomPlugInManager.m \
	zoomCocoa/PlugIns/ZoomSignPost.h \
	zoomCocoa/PlugIns/ZoomSignPost.m \
	zoomCocoa/ZoomWindowThatCanBecomeKey.h \
	zoomCocoa/ZoomWindowThatCanBecomeKey.m \
	zoomCocoa/Spotlight/MetadataImporter.h \
	zoomCocoa/Spotlight/MetadataImporter.m \
	zoomCocoa/Leopard/GeneratePreviewForURL.m \
	zoomCocoa/Leopard/GenerateThumbnailForURL.m \
	zoomCocoa/Leopard/ZoomLFlipView.h \
	zoomCocoa/Leopard/ZoomLFlipView.m \
	zoomCocoa/Leopard/ZoomLeopard.h \
	zoomCocoa/Leopard/ZoomLeopard.m \
	zoomCocoa/Leopard/ZoomSaveQuickLook.c \
	zoomCocoa/ZoomFadeView.h	zoomCocoa/ZoomFadeView.m \
	zoomCocoa/ZoomFlipView.h	zoomCocoa/ZoomFlipView.m \
	zoomCocoa/ZoomWhiteView.h	zoomCocoa/ZoomWhiteView.m \
	md5.c				md5.h \
	zoomCocoa/Spotlight/schema.xml \
	zoomCocoa/MainMenu.nib/classes.nib zoomCocoa/MainMenu.nib/info.nib \
	zoomCocoa/MainMenu.nib/keyedobjects.nib \
	zoomCocoa/MainMenu.nib/objects.nib \
	zoomCocoa/ZoomClient.nib/classes.nib zoomCocoa/ZoomClient.nib/info.nib \
	zoomCocoa/ZoomClient.nib/keyedobjects.nib \
	zoomCocoa/ZoomClient.nib/objects.nib \
    zoomCocoa/GameInfo.nib/classes.nib \
    zoomCocoa/GameInfo.nib/info.nib \
    zoomCocoa/GameInfo.nib/keyedobjects.nib \
    zoomCocoa/GameInfo.nib/objects.nib \
	zoomCocoa/Preferences.nib/classes.nib \
	zoomCocoa/Preferences.nib/info.nib \
	zoomCocoa/Preferences.nib/keyedobjects.nib \
	zoomCocoa/Preferences.nib/objects.nib \
	zoomCocoa/iFiction.nib/classes.nib \
    zoomCocoa/iFiction.nib/info.nib \
    zoomCocoa/iFiction.nib/keyedobjects.nib \
    zoomCocoa/iFiction.nib/objects.nib \
	zoomCocoa/iFiction-10.2.nib/classes.nib \
	zoomCocoa/iFiction-10.2.nib/info.nib \
	zoomCocoa/iFiction-10.2.nib/keyedobjects.nib \
	zoomCocoa/iFiction-10.2.nib/objects.nib \
	zoomCocoa/Skein.nib/classes.nib \
	zoomCocoa/Skein.nib/info.nib \
	zoomCocoa/Skein.nib/keyedobjects.nib \
	zoomCocoa/Skein.nib/objects.nib \
	zoomCocoa/NoteWindow.nib/classes.nib \
	zoomCocoa/NoteWindow.nib/info.nib \
	zoomCocoa/NoteWindow.nib/keyedobjects.nib \
	zoomCocoa/PlugIns/English.lproj/GlkWindow.nib/classes.nib \
	zoomCocoa/PlugIns/English.lproj/GlkWindow.nib/info.nib \
	zoomCocoa/PlugIns/English.lproj/GlkWindow.nib/keyedobjects.nib \
	zoomCocoa/PlugIns/English.lproj/GlkWindow.nib/objects.nib \
	zoomCocoa/PluginManager.nib/classes.nib \
	zoomCocoa/PluginManager.nib/info.nib \
	zoomCocoa/PluginManager.nib/keyedobjects.nib \
	infocom.iFiction archive.iFiction ifmetadata.c ifmetadata.h \
	ifmetabase.c ifmetabase.h \
	ifmetaxml.c ifmetaxml.h \
	ifmetabase-internal.h \
	zoomCocoa/add-in.png 		zoomCocoa/add-out.png \
	zoomCocoa/continue-in.png	zoomCocoa/continue-out.png \
	zoomCocoa/colourSettings.png 	zoomCocoa/disabledButton.png \
	zoomCocoa/drawer-in.png 	zoomCocoa/drawer-out.png \
	zoomCocoa/fontSettings.png 	zoomCocoa/gameSettings.png \
	zoomCocoa/generalSettings.png 	zoomCocoa/information-in.png \
	zoomCocoa/information-out.png	zoomCocoa/newgame-in.png \
	zoomCocoa/newgame-out.png	zoomCocoa/Z-Decal.png  \
	zoomCocoa/Metal-Title.png 	zoomCocoa/stars-grey.png \
	zoomCocoa/stars-red.png		zoomCocoa/stars-none.png \
	zoomCocoa/iFiction.icns 	zoomCocoa/saveBackground.png \
	zoomCocoa/saveHighlightActive.png zoomCocoa/saveHighlightInactive.png \
	zoomCocoa/Blorb.icns		zoomCocoa/Resources/NeedDrop.png \
	zoomCocoa/GlkClient.icns	zoomCocoa/HUGO.icns \
	zoomCocoa/signpost.icns \
	zoomCocoa/TADS.icns		zoomCocoa/top-shading.png \
	zoomCocoa/typographicSettings.png zoomCocoa/displaySettings.png \
	zoomCocoa/Skein/Skein-active.png zoomCocoa/Skein/Skein-changed.png \
	zoomCocoa/Skein/Skein-selected.png zoomCocoa/Skein/Skein-unchanged.png \
	zoomCocoa/Skein/Skein-unplayed.png zoomCocoa/Skein/SkeinAdd.png \
	zoomCocoa/Skein/SkeinAnnotate.png zoomCocoa/Skein/SkeinDelete.png \
	zoomCocoa/Skein/SkeinLocked.png zoomCocoa/Skein/SkeinTranscript.png \
	zoomCocoa/Skein/SkeinUnlocked.png \
	zoomCocoa/Skein-annotation.png \
	zoomCocoa/SkeinDiffersBadge.png \
	zoomCocoa/IFDB-back.png \
	zoomCocoa/English.lproj/IFDB-connecting.png \
	zoomCocoa/IFDB-downloading.png \
	zoomCocoa/English.lproj/IFDB-error.png \
	zoomCocoa/English.lproj/ifdb-failed.html \
	zoomCocoa/IFDB-forward.png \
	zoomCocoa/IFDB-home.png \
	zoomCocoa/English.lproj/ifdb-loading.html \
	zoomCocoa/English.lproj/Credits.rtf

zoom_SOURCES = \
	main.c interp.c file.c options.c zmachine.c zscii.c display.c \
	xdisplay.c hash.c tokenise.c stream.c font3.c state.c rc.c \
	rc_parse.y rc_lex.l menu.c xfont.c windisplay.c winfont.c random.c \
	format.c v6display.c carbondisplay.c carbonfont.c carbonsupport.c \
	carbonprefs.c debug.c eval.y iff.c blorb.c image_libpng.c \
	image_ximage.c image_carbon.c image_none.c \
	\
	file.h zmachine.h options.h interp.h zscii.h display.h hash.h \
	tokenise.h stream.h font3.h state.h rc.h rcp.h rc_parse.h \
	menu.h xdisplay.h xfont.h zoomres.h windisplay.h random.h format.h \
	carbondisplay.h v6display.h debug.h blorb.h image.h image_ximage.h \
	sound.h

interp.o: interp_z3.h
interp.o: interp_z4.h
interp.o: interp_z5.h
interp.o: interp_z6.h
interp.o: interp_gen.h
interp.o: varop.h

WINDRES = @WINDRES@

if WINDOWS_VERSION
%.o: %.rc
	$(WINDRES) -i $< -o $@

%.res: %.rc
	$(WINDRES) -fo$@ $<
else
zoom$(EXEEXT): $(zoom_OBJECTS) $(zoom_DEPENDENCIES)
	@rm -f zoom
	$(LINK) $(zoom_LDFLAGS) $(zoom_OBJECTS) $(zoom_LDADD) $(LIBS)
if CARBON_VERSION
	-mkdir Zoom.app
	-mkdir Zoom.app/Contents
	-mkdir Zoom.app/Contents/MacOS
	-mkdir Zoom.app/Contents/Resources
	-mkdir Zoom.app/Contents/Resources/English.lproj
	-mkdir Zoom.app/Contents/Resources/Zoom\ Help
	-mkdir Zoom.app/Contents/Resources/Zoom\ Help/main
	cp zoom$(EXEEXT) Zoom.app/Contents/MacOS/Zoom
	cp -Rf $(srcdir)/macos/zoom.nib Zoom.app/Contents/Resources/English.lproj
	cp $(srcdir)/macos/zoom-app.icns $(srcdir)/macos/zoom-file.icns $(srcdir)/macos/zoom-game.icns $(srcdir)/macos/zoomrc Zoom.app/Contents/Resources
	cp $(srcdir)/macos/Info.plist $(srcdir)/macos/PkgInfo Zoom.app/Contents
	cp $(srcdir)/../manual/*.html $(srcdir)/../manual/*.png Zoom.app/Contents/Resources/Zoom\ Help/main
	cp $(srcdir)/../manual/ztitle.html $(srcdir)/../manual/zicon.gif Zoom.app/Contents/Resources/Zoom\ Help
	cp $(srcdir)/../manual/idx Zoom.app/Contents/Resources/Zoom\ Help/Zoom\ Help\ idx
	mv Zoom.app/Contents/Resources/Zoom\ Help/ztitle.html Zoom.app/Contents/Resources/Zoom\ Help/Zoom\ Help.htm
endif
endif

CFLAGS = @CFLAGS@ @X_CFLAGS@ -DDATADIR="\"${pkgdatadir}\""
OBJCFLAGS = @CFLAGS@ @X_CFLAGS@ -DDATADIR="\"${pkgdatadir}\""
LIBS = @LIBS@
YFLAGS = -d

debug.c: eval.h

varop.h: $(top_srcdir)/builder/varopdecode.pl
	 @PERL@ $(top_srcdir)/builder/varopdecode.pl 4 varop >varop.h
doubleop.h: $(top_srcdir)/builder/varopdecode.pl
	 @PERL@ $(top_srcdir)/builder/varopdecode.pl 8 doubleop >doubleop.h

interp_gen.h: zcode.ops $(top_builddir)/builder/builder
	     $(top_builddir)/builder/builder interp_gen.h -1 $(top_srcdir)/src/zcode.ops
interp_z3.h: zcode.ops $(top_builddir)/builder/builder
	     $(top_builddir)/builder/builder interp_z3.h 3 $(top_srcdir)/src/zcode.ops
interp_z4.h: zcode.ops $(top_builddir)/builder/builder
	     $(top_builddir)/builder/builder interp_z4.h 4 $(top_srcdir)/src/zcode.ops
interp_z5.h: zcode.ops $(top_builddir)/builder/builder
	     $(top_builddir)/builder/builder interp_z5.h 5 $(top_srcdir)/src/zcode.ops
interp_z6.h: zcode.ops $(top_builddir)/builder/builder
	     $(top_builddir)/builder/builder interp_z6.h 6 $(top_srcdir)/src/zcode.ops
