@SET_MAKE@

AUTOMAKE_OPTIONS = subdir-objects

SUBDIRS = po po-doc

bin_PROGRAMS = src/xfce4-screenshooter

distclean-local:
	rm -rf *.cache *~

dist-bz2: dist
	zcat $(PACKAGE)-$(VERSION).tar.gz | bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2

distcheck-bz2: distcheck
	zcat $(PACKAGE)-$(VERSION).tar.gz | bzip2 --best -c > $(PACKAGE)-$(VERSION).tar.bz2

# Convienence library for the application and the panel plugin
noinst_LTLIBRARIES = lib/libscreenshooter.la

lib_libscreenshooter_la_SOURCES =	\
	$(lib_libscreenshooter_built_sources) \
  lib/exo-job.c lib/exo-job.h \
	lib/exo-simple-job.c lib/exo-simple-job.h \
	lib/katze-throbber.c lib/katze-throbber.h \
	lib/libscreenshooter.h \
  lib/sexy-url-label.c lib/sexy-url-label.h \
	lib/screenshooter-actions.c lib/screenshooter-actions.h \
	lib/screenshooter-capture.c lib/screenshooter-capture.h \
  lib/screenshooter-dialogs.c lib/screenshooter-dialogs.h \
	lib/screenshooter-global.h \
	lib/screenshooter-job.c lib/screenshooter-job.h \
	lib/screenshooter-simple-job.c lib/screenshooter-simple-job.h \
	lib/screenshooter-utils.c lib/screenshooter-utils.h \
	lib/screenshooter-zimagez.c lib/screenshooter-zimagez.h

lib_libscreenshooter_la_CFLAGS = \
	-I$(top_srcdir)	\
  @GTK_CFLAGS@ \
	@GLIB_CFLAGS@ \
	@LIBXFCE4UTIL_CFLAGS@ \
	@LIBXFCEGUI4_CFLAGS@ \
	@SOUP_CFLAGS@ \
  -DPACKAGE_LOCALE_DIR=\"$(localedir)\"

lib_libscreenshooter_la_LIBADD = \
  @GTK_LIBS@ \
	@LIBXFCE4UTIL_LIBS@ \
	@LIBXFCEGUI4_LIBS@ \
  @GLIB_LIBS@ \
	@SOUP_LIBS@

lib_libscreenshooter_built_sources = \
	lib/screenshooter-marshal.c lib/screenshooter-marshal.h

#Autogenerated sources for the library
BUILT_SOURCES =	$(lib_libscreenshooter_built_sources)

lib/screenshooter-marshal.h: lib/stamp-screenshooter-marshal.h
	@true
lib/stamp-screenshooter-marshal.h: lib/screenshooter-marshal.list Makefile
	$(AM_V_GEN) ( \
		echo '/* this file is autogenerated -- do not edit */' >lib/screenshooter-marshal.h \
		&& glib-genmarshal --prefix=_screenshooter_marshal --header $(top_srcdir)/lib/screenshooter-marshal.list >>lib/screenshooter-marshal.h \
		&& echo timestamp >$@ \
	)

lib/screenshooter-marshal.c: lib/screenshooter-marshal.list Makefile
	$(AM_V_GEN) ( \
		echo '/* this file is autogenerated -- do not edit */' >$@ \
		&& echo '#include "screenshooter-marshal.h"' >>$@ \
		&& glib-genmarshal --prefix=_screenshooter_marshal --body $(top_srcdir)/lib/screenshooter-marshal.list >>$@ \
	)

# Main application
src_xfce4_screenshooter_CFLAGS = \
	-I$(top_srcdir)/lib/ \
	@GTK_CFLAGS@ \
	@GLIB_CFLAGS@ \
	@LIBXFCE4UTIL_CFLAGS@ \
	@LIBXFCEGUI4_CFLAGS@ \
	@GTHREAD_CFLAGS@ \
	@SOUP_CFLAGS@ \
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"
	
src_xfce4_screenshooter_LDFLAGS = \
	@GTK_LIBS@ \
	@GLIB_LIBS@ \
	@GTHREAD_LIBS@ \
	@SOUP_LIBS@ \
	@LIBXFCE4UTIL_LIBS@ \
	@LIBXFCEGUI4_LIBS@

src_xfce4_screenshooter_LDADD = lib/libscreenshooter.la
	
src_xfce4_screenshooter_SOURCES = src/main.c

# Desktop file for the application
app_desktopdir = $(datadir)/applications
app_desktop_in_in_files = src/xfce4-screenshooter.desktop.in.in
app_desktop_in_files = $(app_desktop_in_in_files:.desktop.in.in=.desktop.in)
app_desktop_DATA = $(app_desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@

src/xfce4-screenshooter.desktop.in: src/xfce4-screenshooter.desktop.in.in
	$(AM_V_GEN) ( \
		sed -e "s^@PLUGIN_PATH@^$(libexecdir)/applications^" \
			$< > $@ \
	)

# Panel plugin
plugindir = $(libexecdir)/xfce4/panel-plugins
plugin_PROGRAMS = panel-plugin/xfce4-screenshooter-plugin

panel_plugin_xfce4_screenshooter_plugin_CFLAGS =	\
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"	\
	-I$(top_srcdir)	\
	-I$(top_srcdir)/lib/	\
	@LIBXFCE4PANEL_CFLAGS@ \
	@GTHREAD_CFLAGS@ \
	@SOUP_CFLAGS@

panel_plugin_xfce4_screenshooter_plugin_LDFLAGS = \
	@LIBXFCE4PANEL_LIBS@ \
	@GTHREAD_LIBS@ \
	@SOUP_LIBS@

panel_plugin_xfce4_screenshooter_plugin_LDADD = lib/libscreenshooter.la

panel_plugin_xfce4_screenshooter_plugin_SOURCES = \
	panel-plugin/screenshooter-plugin.c

# Panel plugin desktop file
panel_desktopdir = $(datadir)/xfce4/panel-plugins
panel_desktop_in_in_files = panel-plugin/screenshooter.desktop.in.in
panel_desktop_in_files = $(panel_desktop_in_in_files:.desktop.in.in=.desktop.in)
panel_desktop_DATA = $(panel_desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@

panel-plugin/screenshooter.desktop.in: panel-plugin/screenshooter.desktop.in.in
	$(AM_V_GEN) ( \
		sed -e "s^@PLUGIN_PATH@^$(libexecdir)/xfce4/panel-plugins^" \
			$< > $@ \
	)

# Fallback icons

# 48x48 icons
48iconsdir = $(datadir)/icons/hicolor/48x48/apps
48icons_DATA = icons/48x48/applets-screenshooter.png

# Scalable icons
scaliconsdir = $(datadir)/icons/hicolor/scalable/apps
scalicons_DATA = icons/scalable/applets-screenshooter.svg

# Update the icon cache
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor

install-data-hook:
	@-if test -z "$(DESTDIR)"; then								\
		echo "Updating Gtk icon cache.";						\
		$(gtk_update_icon_cache);								\
	else														\
		echo "*** Icon cache not updated. Remember to run:";	\
		echo "***";												\
		echo "***   $(gtk_update_icon_cache)";					\
		echo "***";												\
	fi

# Documentation
noinst_DATA = \
	docs/manual/C/xfce4-screenshooter.xml	\
	docs/manual/ast/xfce4-screenshooter.xml \
	docs/manual/ca/xfce4-screenshooter.xml \
	docs/manual/da/xfce4-screenshooter.xml \
	docs/manual/es/xfce4-screenshooter.xml \
	docs/manual/fr/xfce4-screenshooter.xml \
	docs/manual/gl/xfce4-screenshooter.xml \
	docs/manual/id/xfce4-screenshooter.xml \
	docs/manual/it/xfce4-screenshooter.xml \
	docs/manual/ja/xfce4-screenshooter.xml \
	docs/manual/pt/xfce4-screenshooter.xml \
	docs/manual/tr/xfce4-screenshooter.xml \
	docs/manual/zh_CN/xfce4-screenshooter.xml

# Asturian documentation
astdocdir = $(datadir)/xfce4/doc/ast
astdoc_DATA = docs/manual/ast/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/ast/xfce4-screenshooter.html: docs/manual/ast/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/ast/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/ast/xfce4-screenshooter.xml
endif
endif

astimagesdir = $(datadir)/xfce4/doc/ast/images
astimages_DATA = \
	docs/manual/ast/images/xfce4-screenshooter-dialog1.png \
	docs/manual/ast/images/xfce4-screenshooter-dialog2.png \
	docs/manual/ast/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/ast/images/xfce4-screenshooter-zimagez-result-dialog.png


# C documentation
cdocdir = $(datadir)/xfce4/doc/C
cdoc_DATA = docs/manual/C/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/C/xfce4-screenshooter.html: docs/manual/C/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/C/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/C/xfce4-screenshooter.xml
endif
endif

cimagesdir = $(datadir)/xfce4/doc/C/images
cimages_DATA = \
	docs/manual/C/images/xfce4-screenshooter-dialog1.png \
	docs/manual/C/images/xfce4-screenshooter-dialog2.png \
	docs/manual/C/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/C/images/xfce4-screenshooter-zimagez-result-dialog.png


# Catalan documentation
cadocdir = $(datadir)/xfce4/doc/ca
cadoc_DATA = docs/manual/ca/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/ca/xfce4-screenshooter.html: docs/manual/ca/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/ca/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/ca/xfce4-screenshooter.xml
endif
endif

caimagesdir = $(datadir)/xfce4/doc/ca/images
caimages_DATA = \
	docs/manual/ca/images/xfce4-screenshooter-dialog1.png \
	docs/manual/ca/images/xfce4-screenshooter-dialog2.png \
	docs/manual/ca/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/ca/images/xfce4-screenshooter-zimagez-result-dialog.png


# Danish documentation
dadocdir = $(datadir)/xfce4/doc/da
dadoc_DATA = docs/manual/da/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/da/xfce4-screenshooter.html: docs/manual/da/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/da/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/da/xfce4-screenshooter.xml
endif
endif

daimagesdir = $(datadir)/xfce4/doc/da/images
daimages_DATA = \
	docs/manual/da/images/xfce4-screenshooter-dialog1.png \
	docs/manual/da/images/xfce4-screenshooter-dialog2.png \
	docs/manual/da/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/da/images/xfce4-screenshooter-zimagez-result-dialog.png

# Portuguese documentation
ptdocdir = $(datadir)/xfce4/doc/pt
ptdoc_DATA = docs/manual/pt/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/pt/xfce4-screenshooter.html: docs/manual/pt/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/pt/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/pt/xfce4-screenshooter.xml
endif
endif

ptimagesdir = $(datadir)/xfce4/doc/pt/images
ptimages_DATA = \
	docs/manual/pt/images/xfce4-screenshooter-dialog1.png \
	docs/manual/pt/images/xfce4-screenshooter-dialog2.png \
	docs/manual/pt/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/pt/images/xfce4-screenshooter-zimagez-result-dialog.png

# Spanish documentation
esdocdir = $(datadir)/xfce4/doc/es
esdoc_DATA = docs/manual/es/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/es/xfce4-screenshooter.html: docs/manual/es/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/es/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/es/xfce4-screenshooter.xml
endif
endif

esimagesdir = $(datadir)/xfce4/doc/es/images
esimages_DATA = \
	docs/manual/es/images/xfce4-screenshooter-dialog1.png \
	docs/manual/es/images/xfce4-screenshooter-dialog2.png \
	docs/manual/es/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/es/images/xfce4-screenshooter-zimagez-result-dialog.png

# French documentation
frdocdir = $(datadir)/xfce4/doc/fr
frdoc_DATA = docs/manual/fr/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/fr/xfce4-screenshooter.html: docs/manual/fr/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/fr/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/fr/xfce4-screenshooter.xml
endif
endif

frimagesdir = $(datadir)/xfce4/doc/fr/images
frimages_DATA = \
	docs/manual/fr/images/xfce4-screenshooter-dialog1.png \
	docs/manual/fr/images/xfce4-screenshooter-dialog2.png \
	docs/manual/fr/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/fr/images/xfce4-screenshooter-zimagez-result-dialog.png

# Galician documentation
gldocdir = $(datadir)/xfce4/doc/gl
gldoc_DATA = docs/manual/gl/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/gl/xfce4-screenshooter.html: docs/manual/gl/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/gl/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/gl/xfce4-screenshooter.xml
endif
endif

glimagesdir = $(datadir)/xfce4/doc/gl/images
glimages_DATA = \
	docs/manual/gl/images/xfce4-screenshooter-dialog1.png \
	docs/manual/gl/images/xfce4-screenshooter-dialog2.png \
	docs/manual/gl/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/gl/images/xfce4-screenshooter-zimagez-result-dialog.png

# Indonesian documentation
iddocdir = $(datadir)/xfce4/doc/id
iddoc_DATA = docs/manual/id/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/id/xfce4-screenshooter.html: docs/manual/id/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/id/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/id/xfce4-screenshooter.xml
endif
endif

idimagesdir = $(datadir)/xfce4/doc/id/images
idimages_DATA = \
	docs/manual/id/images/xfce4-screenshooter-dialog1.png \
	docs/manual/id/images/xfce4-screenshooter-dialog2.png \
	docs/manual/id/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/id/images/xfce4-screenshooter-zimagez-result-dialog.png

# Italian documentation
itdocdir = $(datadir)/xfce4/doc/it
itdoc_DATA = docs/manual/it/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/it/xfce4-screenshooter.html: docs/manual/it/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/it/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/it/xfce4-screenshooter.xml
endif
endif

itimagesdir = $(datadir)/xfce4/doc/it/images
itimages_DATA = \
	docs/manual/it/images/xfce4-screenshooter-dialog1.png \
	docs/manual/it/images/xfce4-screenshooter-dialog2.png \
	docs/manual/it/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/it/images/xfce4-screenshooter-zimagez-result-dialog.png

# Japanese documentation
jadocdir = $(datadir)/xfce4/doc/ja
jadoc_DATA = docs/manual/ja/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/ja/xfce4-screenshooter.html: docs/manual/ja/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/ja/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/ja/xfce4-screenshooter.xml
endif
endif

jaimagesdir = $(datadir)/xfce4/doc/ja/images
jaimages_DATA = \
	docs/manual/ja/images/xfce4-screenshooter-dialog1.png \
	docs/manual/ja/images/xfce4-screenshooter-dialog2.png \
	docs/manual/ja/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/ja/images/xfce4-screenshooter-zimagez-result-dialog.png

# Turkish documentation
trdocdir = $(datadir)/xfce4/doc/tr
trdoc_DATA = docs/manual/tr/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/tr/xfce4-screenshooter.html: docs/manual/tr/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/tr/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/tr/xfce4-screenshooter.xml
endif
endif

trimagesdir = $(datadir)/xfce4/doc/tr/images
trimages_DATA = \
	docs/manual/tr/images/xfce4-screenshooter-dialog1.png \
	docs/manual/tr/images/xfce4-screenshooter-dialog2.png \
	docs/manual/tr/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/tr/images/xfce4-screenshooter-zimagez-result-dialog.png


# Siplified Chinese documentation
zhcndocdir = $(datadir)/xfce4/doc/zh_CN
zhcndoc_DATA = docs/manual/zh_CN/xfce4-screenshooter.html
if MAINTAINER_MODE
if ENABLE_XSLTPROC
docs/manual/zh_CN/xfce4-screenshooter.html: docs/manual/zh_CN/xfce4-screenshooter.xml
	$(XSLTPROC) -o docs/manual/zh_CN/ $(top_srcdir)/docs/manual/xfce-nochunk.xsl docs/manual/zh_CN/xfce4-screenshooter.xml
endif
endif

zhcnimagesdir = $(datadir)/xfce4/doc/zh_CN/images
zhcnimages_DATA = \
	docs/manual/zh_CN/images/xfce4-screenshooter-dialog1.png \
	docs/manual/zh_CN/images/xfce4-screenshooter-dialog2.png \
	docs/manual/zh_CN/images/xfce4-screenshooter-zimagez-login-dialog.png \
	docs/manual/zh_CN/images/xfce4-screenshooter-zimagez-result-dialog.png


.PHONY: ChangeLog

ChangeLog: Makefile
	(GIT_DIR=$(top_srcdir)/.git git log > .changelog.tmp \
	&& mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) \
	|| (touch ChangeLog; echo 'Git directory not found: installing possibly empty changelog.' >&2)

dist-hook: ChangeLog

# Extra dist and distclean rules
EXTRA_DIST = \
	README	\
	intltool-extract.in	\
	intltool-merge.in	\
	intltool-update.in \
	lib/screenshooter-marshal.list \
	$(app_desktop_in_in_files) \
	$(panel_desktop_in_in_files) \
	$(48icons_DATA) \
	$(scalicons_DATA) \
	docs/manual/xfce-nochunk.xsl \
	$(noinst_DATA) \
	$(astdoc_DATA) $(astimages_DATA) \
	$(cdoc_DATA) $(cimages_DATA) \
	$(cadoc_DATA) $(caimages_DATA) \
	$(dadoc_DATA) $(daimages_DATA) \
	$(esdoc_DATA) $(esimages_DATA) \
	$(frdoc_DATA) $(frimages_DATA) \
	$(gldoc_DATA) $(glimages_DATA) \
	$(itdoc_DATA) $(itimages_DATA) \
	$(iddoc_DATA) $(idimages_DATA) \
	$(jadoc_DATA) $(jaimages_DATA) \
	$(ptdoc_DATA) $(ptimages_DATA) \
	$(trdoc_DATA) $(trimages_DATA) \
	$(zhcndoc_DATA) $(zhcnimages_DATA)

DISTCLEANFILES = \
	intltool-extract \
	intltool-merge \
	intltool-update \
	stamp-screenshooter-marshal.h \
	$(lib_libscreenshooter_built_sources) \
	lib/stamp-screenshooter-marshal.h \
	$(app_desktop_DATA) $(app_desktop_in_files) \
	$(panel_desktop_DATA) $(panel_desktop_in_files)

# Man pages
dist_man_MANS = xfce4-screenshooter.1

