# $Id$

INCLUDES =								\
	-I$(top_builddir)						\
	-I$(top_srcdir)							\
	-DBINDIR=\"$(bindir)\"						\
	-DDATADIR=\"$(datadir)\"					\
	-DEXO_DISABLE_DEPRECATED					\
	-DG_LOG_DOMAIN=\"Thunar\"					\
	-DLIBDIR=\"$(libdir)\"						\
	-DLIBEXECDIR=\"$(libexecdir)\"					\
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
	-DTHUNAR_VERSION_API=\"$(THUNAR_VERSION_API)\"			\
	$(PLATFORM_CPPFLAGS)

bin_SCRIPTS =								\
	thunar-settings

bin_PROGRAMS =								\
	Thunar

thunar_built_sources =							\
	thunar-marshal.c						\
	thunar-marshal.h

Thunar_SOURCES =							\
	$(thunar_include_HEADERS)					\
	$(thunar_built_sources)						\
	$(thunar_dbus_sources)						\
	main.c								\
	sexy-url-label.c						\
	sexy-url-label.h						\
	thunar-abstract-dialog.c					\
	thunar-abstract-dialog.h					\
	thunar-abstract-icon-view-ui.h					\
	thunar-abstract-icon-view.c					\
	thunar-abstract-icon-view.h					\
	thunar-application.c						\
	thunar-application.h						\
	thunar-chooser-button.c						\
	thunar-chooser-button.h						\
	thunar-chooser-dialog.c						\
	thunar-chooser-dialog.h						\
	thunar-chooser-model.c						\
	thunar-chooser-model.h						\
	thunar-clipboard-manager.c					\
	thunar-clipboard-manager.h					\
	thunar-column-editor.c						\
	thunar-column-editor.h						\
	thunar-column-model.c						\
	thunar-column-model.h						\
	thunar-compact-view.c						\
	thunar-compact-view.h						\
	thunar-component.c						\
	thunar-component.h						\
	thunar-create-dialog.c						\
	thunar-create-dialog.h						\
	thunar-debug.h							\
	thunar-debug.c							\
	thunar-details-view-ui.h					\
	thunar-details-view.c						\
	thunar-details-view.h						\
	thunar-dialogs.c						\
	thunar-dialogs.h						\
	thunar-dnd.c							\
	thunar-dnd.h							\
	thunar-emblem-chooser.c						\
	thunar-emblem-chooser.h						\
	thunar-enum-types.c						\
	thunar-enum-types.h						\
	thunar-file.c							\
	thunar-file.h							\
	thunar-file-monitor.c						\
	thunar-file-monitor.h						\
	thunar-folder.c							\
	thunar-folder.h							\
	thunar-gdk-extensions.c						\
	thunar-gdk-extensions.h						\
	thunar-gobject-extensions.c					\
	thunar-gobject-extensions.h					\
	thunar-gtk-extensions.c						\
	thunar-gtk-extensions.h						\
	thunar-history-action.c						\
	thunar-history-action.h						\
	thunar-history.c						\
	thunar-history.h						\
	thunar-ice.c							\
	thunar-ice.h							\
	thunar-icon-factory.c						\
	thunar-icon-factory.h						\
	thunar-icon-renderer.c						\
	thunar-icon-renderer.h						\
	thunar-icon-view.c						\
	thunar-icon-view.h						\
	thunar-launcher.c						\
	thunar-launcher.h						\
	thunar-launcher-ui.h						\
	thunar-list-model.c						\
	thunar-list-model.h						\
	thunar-location-bar.c						\
	thunar-location-bar.h						\
	thunar-location-button.c					\
	thunar-location-button.h					\
	thunar-location-buttons.c					\
	thunar-location-buttons.h					\
	thunar-location-buttons-ui.h					\
	thunar-location-dialog.c					\
	thunar-location-dialog.h					\
	thunar-location-entry.c						\
	thunar-location-entry.h						\
	thunar-metafile.c						\
	thunar-metafile.h						\
	thunar-navigator.c						\
	thunar-navigator.h						\
	thunar-pango-extensions.c					\
	thunar-pango-extensions.h					\
	thunar-path-entry.c						\
	thunar-path-entry.h						\
	thunar-permissions-chooser.c					\
	thunar-permissions-chooser.h					\
	thunar-preferences-dialog.c					\
	thunar-preferences-dialog.h					\
	thunar-preferences.c						\
	thunar-preferences.h						\
	thunar-private.h						\
	thunar-progress-dialog.c					\
	thunar-progress-dialog.h					\
	thunar-properties-dialog.c					\
	thunar-properties-dialog.h					\
	thunar-renamer-dialog.c						\
	thunar-renamer-dialog.h						\
	thunar-renamer-dialog-ui.h					\
	thunar-renamer-model.c						\
	thunar-renamer-model.h						\
	thunar-renamer-pair.c						\
	thunar-renamer-pair.h						\
	thunar-renamer-progress.c					\
	thunar-renamer-progress.h					\
	thunar-sendto-model.c						\
	thunar-sendto-model.h						\
	thunar-session-client.c						\
	thunar-session-client.h						\
	thunar-shortcuts-icon-renderer.c				\
	thunar-shortcuts-icon-renderer.h				\
	thunar-shortcuts-model.c					\
	thunar-shortcuts-model.h					\
	thunar-shortcuts-pane.c						\
	thunar-shortcuts-pane.h						\
	thunar-shortcuts-pane-ui.h					\
	thunar-shortcuts-view.c						\
	thunar-shortcuts-view.h						\
	thunar-side-pane.c						\
	thunar-side-pane.h						\
	thunar-size-label.c						\
	thunar-size-label.h						\
	thunar-standard-view.c						\
	thunar-standard-view.h						\
	thunar-standard-view-ui.h					\
	thunar-statusbar.c						\
	thunar-statusbar.h						\
	thunar-stock.c							\
	thunar-stock.h							\
	thunar-templates-action.c					\
	thunar-templates-action.h					\
	thunar-text-renderer.c						\
	thunar-text-renderer.h						\
	thunar-throbber.c						\
	thunar-throbber.h						\
	thunar-throbber-fallback.c					\
	thunar-throbber-fallback.h					\
	thunar-thumbnail-frame.c					\
	thunar-thumbnail-frame.h					\
	thunar-thumbnail-generator.c					\
	thunar-thumbnail-generator.h					\
	thunar-trash-action.c						\
	thunar-trash-action.h						\
	thunar-tree-model.c						\
	thunar-tree-model.h						\
	thunar-tree-pane.c						\
	thunar-tree-pane.h						\
	thunar-tree-view.c						\
	thunar-tree-view.h						\
	thunar-util.c							\
	thunar-util.h							\
	thunar-view.c							\
	thunar-view.h							\
	thunar-window.c							\
	thunar-window.h							\
	thunar-window-ui.h						\
	xfce-heading.c							\
	xfce-heading.h							\
	xfce-titled-dialog.c						\
	xfce-titled-dialog.h

Thunar_CFLAGS =								\
	$(EXO_CFLAGS)							\
	$(GTHREAD_CFLAGS)						\
	$(LIBSM_CFLAGS)							\
	$(PLATFORM_CFLAGS)

Thunar_LDFLAGS =							\
	-no-undefined							\
	$(LIBSM_LDFLAGS)						\
	$(PLATFORM_LDFLAGS)

Thunar_LDADD =								\
	$(top_builddir)/tdb/libtdb.la					\
	$(top_builddir)/thunar-vfs/libthunar-vfs-$(THUNAR_VERSION_API).la \
	$(top_builddir)/thunarx/libthunarx-$(THUNAR_VERSION_API).la	\
	$(EXO_LIBS)							\
	$(GTHREAD_LIBS)							\
	$(LIBSM_LIBS)

Thunar_DEPENDENCIES =							\
	$(top_builddir)/tdb/libtdb.la					\
	$(top_builddir)/thunar-vfs/libthunar-vfs-$(THUNAR_VERSION_API).la \
	$(top_builddir)/thunarx/libthunarx-$(THUNAR_VERSION_API).la

if HAVE_DBUS
thunar_built_sources +=							\
	thunar-dbus-service-infos.h

thunar_dbus_sources =							\
	thunar-dbus-client.c						\
	thunar-dbus-client.h						\
	thunar-dbus-service.c						\
	thunar-dbus-service.h

Thunar_CFLAGS +=							\
	-DDBUS_API_SUBJECT_TO_CHANGE					\
	$(DBUS_CFLAGS)

Thunar_LDADD +=								\
	$(DBUS_LIBS)
endif

desktopdir = $(datadir)/applications
desktop_in_files = thunar-settings.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@

# install symlink to 'thunar'
install-data-local:
	$(mkinstalldirs) $(DESTDIR)$(bindir)
	-( cd $(DESTDIR)$(bindir) ; test -x thunar || ln -sf Thunar thunar )

clean-local:
	rm -f *.core core core.*

DISTCLEANFILES =								\
	thunar-settings.desktop

if MAINTAINER_MODE
CLEANFILES =								\
	xgen-tmc							\
	xgen-tmh

DISTCLEANFILES +=							\
	$(thunar_built_sources)						\
	stamp-thunar-marshal.h						\
	thunar-abstract-icon-view-ui.h					\
	thunar-details-view-ui.h					\
	thunar-launcher-ui.h						\
	thunar-location-buttons-ui.h					\
	thunar-shortcuts-pane-ui.h					\
	thunar-renamer-dialog-ui.h					\
	thunar-standard-view-ui.h					\
	thunar-throbber-fallback.c					\
	thunar-thumbnail-frame.c					\
	thunar-window-ui.h

BUILT_SOURCES =								\
	$(thunar_built_sources)						\
	thunar-abstract-icon-view-ui.h					\
	thunar-details-view-ui.h					\
	thunar-launcher-ui.h						\
	thunar-location-buttons-ui.h					\
	thunar-shortcuts-pane-ui.h					\
	thunar-renamer-dialog-ui.h					\
	thunar-standard-view-ui.h					\
	thunar-throbber-fallback.c					\
	thunar-thumbnail-frame.c					\
	thunar-window-ui.h

if HAVE_DBUS
thunar-dbus-service-infos.h: $(srcdir)/thunar-dbus-service-infos.xml Makefile
	dbus-binding-tool --prefix=thunar_dbus_service --mode=glib-server $(srcdir)/thunar-dbus-service-infos.xml > thunar-dbus-service-infos.h
endif

thunar-throbber-fallback.c: $(srcdir)/thunar-throbber-fallback.png Makefile
	(echo "#include <thunar/thunar-throbber-fallback.h>" && gdk-pixbuf-csource --extern --raw --stream --name=thunar_throbber_fallback $(srcdir)/thunar-throbber-fallback.png) > thunar-throbber-fallback.c

thunar-thumbnail-frame.c: $(srcdir)/thunar-thumbnail-frame.png Makefile
	(echo "#include <thunar/thunar-thumbnail-frame.h>" && gdk-pixbuf-csource --extern --raw --stream --name=thunar_thumbnail_frame $(srcdir)/thunar-thumbnail-frame.png) > thunar-thumbnail-frame.c

thunar-abstract-icon-view-ui.h: Makefile $(srcdir)/thunar-abstract-icon-view-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_abstract_icon_view_ui $(srcdir)/thunar-abstract-icon-view-ui.xml > thunar-abstract-icon-view-ui.h

thunar-details-view-ui.h: Makefile $(srcdir)/thunar-details-view-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_details_view_ui $(srcdir)/thunar-details-view-ui.xml > thunar-details-view-ui.h

thunar-launcher-ui.h: Makefile $(srcdir)/thunar-launcher-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_launcher_ui $(srcdir)/thunar-launcher-ui.xml > thunar-launcher-ui.h

thunar-location-buttons-ui.h: Makefile $(srcdir)/thunar-location-buttons-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_location_buttons_ui $(srcdir)/thunar-location-buttons-ui.xml > thunar-location-buttons-ui.h

thunar-shortcuts-pane-ui.h: Makefile $(srcdir)/thunar-shortcuts-pane-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_shortcuts_pane_ui $(srcdir)/thunar-shortcuts-pane-ui.xml > thunar-shortcuts-pane-ui.h

thunar-renamer-dialog-ui.h: Makefile $(srcdir)/thunar-renamer-dialog-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_renamer_dialog_ui $(srcdir)/thunar-renamer-dialog-ui.xml > thunar-renamer-dialog-ui.h

thunar-standard-view-ui.h: Makefile $(srcdir)/thunar-standard-view-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_standard_view_ui $(srcdir)/thunar-standard-view-ui.xml > thunar-standard-view-ui.h

thunar-window-ui.h: Makefile $(srcdir)/thunar-window-ui.xml
	exo-csource --strip-comments --strip-content --static --name=thunar_window_ui $(srcdir)/thunar-window-ui.xml > thunar-window-ui.h

thunar-marshal.h: stamp-thunar-marshal.h
	@true
stamp-thunar-marshal.h: thunar-marshal.list Makefile
	( cd $(srcdir) && glib-genmarshal \
		--prefix=_thunar_marshal \
		--header thunar-marshal.list ) >> xgen-tmh \
	&& ( cmp -s xgen-tmh thunar-marshal.h || cp xgen-tmh thunar-marshal.h ) \
	&& rm -f xgen-tmh \
	&& echo timestamp > $(@F)

thunar-marshal.c: thunar-marshal.list Makefile
	( cd $(srcdir) && glib-genmarshal \
		--prefix=_thunar_marshal \
		--body thunar-marshal.list ) >> xgen-tmc \
	&& cp xgen-tmc thunar-marshal.c \
	&& rm -f xgen-tmc
endif

EXTRA_DIST =									\
	thunar-abstract-icon-view-ui.xml			\
	thunar-dbus-service-infos.xml				\
	thunar-details-view-ui.xml					\
	thunar-launcher-ui.xml						\
	thunar-location-buttons-ui.xml				\
	thunar-marshal.list							\
	thunar-renamer-dialog-ui.xml				\
	thunar-standard-view-ui.xml					\
	thunar-thumbnail-frame.png					\
	thunar-window-ui.xml						\
	thunar-settings								\
	$(desktop_in_files)

# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
