Skip to content
Snippets Groups Projects
Makefile.am 7.15 KiB
Newer Older
Jasper Huijsmans's avatar
Jasper Huijsmans committed
@SET_MAKE@

AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
SUBDIRS = po

bin_PROGRAMS = src/xfce4-screenshooter
Jasper Huijsmans's avatar
Jasper Huijsmans committed

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

Jérôme Guelfucci's avatar
Jérôme Guelfucci committed
distuninstallcheck_listfiles = \
	find . -type f -print | grep -v ./share/icons/hicolor/icon-theme.cache

Jasper Huijsmans's avatar
Jasper Huijsmans committed
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/libscreenshooter.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-job-callbacks.c lib/screenshooter-job-callbacks.h \
	lib/screenshooter-simple-job.c lib/screenshooter-simple-job.h \
	lib/screenshooter-utils.c lib/screenshooter-utils.h \
	lib/screenshooter-imgur.c lib/screenshooter-imgur.h \
	lib/screenshooter-imgur-dialog.c lib/screenshooter-imgur-dialog.h

lib_libscreenshooter_la_CFLAGS = \
	-I$(top_srcdir) \
	-I$(top_builddir)/lib \
	@EXO_CFLAGS@ \
	@GTK_CFLAGS@ \
	@GLIB_CFLAGS@ \
	@LIBXFCE4UTIL_CFLAGS@ \
	@LIBXFCE4UI_CFLAGS@ \
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"

lib_libscreenshooter_la_LIBADD = \
	-lm \
	@GTK_LIBS@ \
	@GLIB_LIBS@ \
Lionel Le Folgoc's avatar
Lionel Le Folgoc committed
	@SOUP_LIBS@ \
Lionel Le Folgoc's avatar
Lionel Le Folgoc committed
	@LIBXEXT_LIBS@ \

lib_libscreenshooter_built_sources = \
	lib/screenshooter-marshal.c lib/screenshooter-marshal.h \
	lib/screenshooter-imgur-dialog_ui.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 >>$@ \
	)
lib/screenshooter-imgur-dialog_ui.h: lib/screenshooter-imgur-dialog.ui
	$(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=screenshooter_imgur_dialog_ui $< >$@

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

src_xfce4_screenshooter_LDADD = lib/libscreenshooter.la
src_xfce4_screenshooter_SOURCES = src/main.c
# Manual file for the application
if HAVE_HELP2MAN
xfce4-screenshooter.1: src/xfce4-screenshooter
	$(HELP2MAN) -o $@ --no-info $<
endif

# 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) ( \
		$(MKDIR_P) $(dir $@); \
		sed -e "s^@PLUGIN_PATH@^$(libexecdir)/applications^" \
			$< > $@ \
plugindir = $(libdir)/xfce4/panel/plugins
plugin_LTLIBRARIES = panel-plugin/libscreenshooterplugin.la
panel_plugin_libscreenshooterplugin_la_CFLAGS =	\
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"	\
	-I$(top_srcdir)	\
	-I$(top_srcdir)/lib/	\
	@LIBXFCE4UI_CFLAGS@ \
panel_plugin_libscreenshooterplugin_la_LDFLAGS = \
Samuli Suominen's avatar
Samuli Suominen committed
	-avoid-version \
	-module \
	-no-undefined \
	-export-symbols-regex '^xfce_panel_module_(preinit|init|construct)' \
	$(PLATFORM_LDFLAGS)

panel_plugin_libscreenshooterplugin_la_LIBADD = \
	@LIBXFCE4PANEL_LIBS@ \
	@GTHREAD_LIBS@ \
Samuli Suominen's avatar
Samuli Suominen committed
	@LIBXFCE4UI_LIBS@ \
	lib/libscreenshooter.la
panel_plugin_libscreenshooterplugin_la_SOURCES = \
	panel-plugin/screenshooter-plugin.c

# Panel plugin desktop file
panel_desktopdir = $(datadir)/xfce4/panel/plugins
panel_desktop_in_files = panel-plugin/screenshooter.desktop.in
panel_desktop_DATA = $(panel_desktop_in_files:.desktop.in=.desktop)
Eric Koegel's avatar
Eric Koegel committed
# appdata file for the application
@INTLTOOL_XML_RULE@
appdatadir = $(datadir)/metainfo
Eric Koegel's avatar
Eric Koegel committed
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
appdata_in_files = src/xfce4-screenshooter.appdata.xml.in


# 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

.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 \
	lib/screenshooter-imgur-dialog.ui \
	$(app_desktop_in_in_files) \
	$(panel_desktop_in_files) \
Eric Koegel's avatar
Eric Koegel committed
	$(scalicons_DATA) \
	$(appdata_in_files)
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) \
Eric Koegel's avatar
Eric Koegel committed
	$(panel_desktop_DATA) \
	$(appdata_DATA) \
	xfce4-screenshooter.1
dist_man_MANS = xfce4-screenshooter.1