INCLUDES = 								\
	-I$(top_srcdir)							\
	-DDBUS_API_SUBJECT_TO_CHANGE					\
	-DEXO_API_SUBJECT_TO_CHANGE					\
	-DEXO_COMPILATION						\
	-DG_LOG_DOMAIN=\"exo\"						\
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"

lib_LTLIBRARIES = libexo-0.3.la

libexo_headers =							\
	exo-binding.h							\
	exo-cell-renderer-ellipsized-text.h				\
	exo-ellipsized-label.h						\
	exo-gdk-pixbuf-extensions.h					\
	exo-gtk-extensions.h						\
	exo-gobject-extensions.h					\
	exo-icon-bar.h							\
	exo-icon-view.h							\
	exo-md5.h							\
	exo-pango-extensions.h						\
	exo-string.h							\
	exo-toolbars-editor.h						\
	exo-toolbars-editor-dialog.h					\
	exo-toolbars-model.h						\
	exo-toolbars-view.h						\
	exo-xsession-client.h

libexo_built_public_sources =						\
	exo-enum-types.h

libexo_built_sources =							\
	$(libexo_built_public_sources)					\
	exo-enum-types.c						\
	exo-marshal.c							\
	exo-marshal.h

libexoincludedir = $(includedir)/exo-0.3/exo

libexoinclude_HEADERS =							\
	$(libexo_built_public_sources)					\
	$(libexo_headers)						\
	exo.h								\
	exo-config.h

libexo_0_3_la_SOURCES =							\
	$(libexoinclude_HEADERS)					\
	$(libexo_built_sources)						\
	exo-binding.c							\
	exo-cell-renderer-ellipsized-text.c				\
	exo-config.c							\
	exo-ellipsized-label.c						\
	exo-gdk-pixbuf-extensions.c					\
	exo-gtk-extensions.c						\
	exo-gobject-extensions.c					\
	exo-icon-bar.c							\
	exo-icon-view.c							\
	exo-md5.c							\
	exo-pango-extensions.c						\
	exo-private.c							\
	exo-private.h							\
	exo-string.c							\
	exo-toolbars-editor.c						\
	exo-toolbars-editor-dialog.c					\
	exo-toolbars-model.c						\
	exo-toolbars-private.c						\
	exo-toolbars-private.h						\
	exo-toolbars-view.c						\
	exo-xsession-client.c

libexo_0_3_la_CFLAGS =							\
	$(LIBX11_CFLAGS)						\
	$(LIBXFCEGUI4_CFLAGS)

libexo_0_3_la_LDFLAGS =							\
	-export-dynamic							\
	-version-info $(LIBEXO_VERINFO)					\
	-export-symbols-regex "^[^_].*"					\
	-no-undefined

libexo_0_3_la_LIBADD =							\
	$(LIBX11_LIBS)							\
	$(LIBXFCEGUI4_LIBS)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = exo-0.3.pc


##
## Rules to auto-generate built sources
##
## This is a bit tricky with automake, and non-trivial to implement. The
## rules below seem to work fine and don't seem to break the build, but
## they are only enabled in maintainer mode, so arbitrary users don't get
## trapped in automake's oddities. Therefore we ship the autogenerated
## files as part of the dist tarball.
##
if MAINTAINER_MODE
CLEANFILES =								\
	xgen-eetc							\
	xgen-eeth							\
	xgen-emc							\
	xgen-emh

DISTCLEANFILES =							\
	stamp-exo-enum-types.h						\
	stamp-exo-marshal.h						\
	$(libexo_built_sources)

BUILT_SOURCES =								\
	$(libexo_built_sources)

exo-enum-types.h: stamp-exo-enum-types.h
	@true
stamp-exo-enum-types.h: $(libexo_headers) Makefile
	( cd $(srcdir) && glib-mkenums \
		--fhead "#ifndef __EXO_ENUM_TYPES_H__\n#define __EXO_ENUM_TYPES_H__\n#include <libxfce4util/libxfce4util.h>\nG_BEGIN_DECLS\n" \
		--fprod "/* enumerations from \"@filename@\" */\n" \
		--vhead "GType @enum_name@_get_type (void);\n#define EXO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
		--ftail "G_END_DECLS\n\n#endif /* !__EXO_ENUM_TYPES_H__ */" \
		$(libexo_headers) ) >> xgen-eeth \
	&& (cmp -s xgen-eeth exo-enum-types.h || cp xgen-eeth exo-enum-types.h ) \
	&& rm -f xgen-eeth \
	&& echo timestamp > $(@F)

exo-enum-types.c: $(libexo_headers) Makefile
	( cd $(srcdir) && glib-mkenums \
		--fhead "#undef GTK_DISABLE_DEPRECATED\n#define GTK_ENABLE_BROKEN\n#include <exo/exo.h>\n" \
		--fprod "\n/* enumerations from \"@filename@\" */" \
		--vhead "GType\n@enum_name@_get_type (void)\n{\n\tstatic GType type = 0;\n\tif (type == 0) {\n\tstatic const G@Type@Value values[] = {"\
		--vprod "\t{ @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
		--vtail "\t{ 0, NULL, NULL }\n\t};\n\ttype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n\treturn type;\n}\n" \
		$(libexo_headers) ) >> xgen-eetc \
	&& cp xgen-eetc exo-enum-types.c \
	&& rm -f xgen-eetc

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

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


# required for gtk-doc
dist-hook: all

EXTRA_DIST = 								\
	exo-marshal.list

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