# $Id$

CLEANFILES =

AM_CPPFLAGS =								\
	-I$(top_srcdir)							\
	-DDEFAULT_XDG_CACHE_HOME=\"~/.cache\"				\
	-DDEFAULT_XDG_DATA_HOME=\"~/.local/share\"			\
	-DDEFAULT_XDG_CONFIG_HOME=\"~/.config\"				\
	-DDEFAULT_XDG_DATA_DIRS=\"$(datadir):/usr/local/share:/usr/share\" \
	-DDEFAULT_XDG_CONFIG_DIRS=\"$(sysconfdir)/xdg:$(sysconfdir)/xfce4:/etc/xdg\" \
	-DDATADIR=\"$(datadir)\"					\
	-DSYSCONFDIR=\"$(sysconfdir)\"					\
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\"				\
	-DG_LOG_DOMAIN=\"libxfce4util\"					\
	-DKIOSKDIR=\"$(sysconfdir)/xdg/xfce4/kiosk\"			\
	-DKIOSKDEF=\"ALL\"						\
	-DLIBXFCE4UTIL_COMPILATION

lib_LTLIBRARIES =							\
	libxfce4util.la

libxfce4util_headers =							\
	xfce-consolekit.h							\
	xfce-debug.h							\
	xfce-fileutils.h						\
	xfce-generics.h							\
	xfce-gio-extensions.h						\
	xfce-i18n.h							\
	xfce-kiosk.h							\
	xfce-license.h							\
	xfce-miscutils.h						\
	xfce-posix-signal-handler.h					\
	xfce-rc.h							\
	xfce-resource.h							\
	xfce-string.h						\
	xfce-systemd.h						\
	xfce-utf8.h

libxfce4util_built_sources =						\
	libxfce4util-visibility.h					\
	libxfce4util-visibility.c

libxfce4utilincludedir = $(includedir)/xfce4/libxfce4util
libxfce4utilinclude_HEADERS =						\
	$(libxfce4util_headers)						\
	libxfce4util.h							\
	libxfce4util-config.h

libxfce4util_la_SOURCES =						\
	$(libxfce4utilinclude_HEADERS)					\
	$(libxfce4util_built_sources)					\
	libxfce4util-config.c						\
	libxfce4util-private.c						\
	libxfce4util-private.h						\
	xfce-consolekit.c							\
	xfce-fileutils.c						\
	xfce-gio-extensions.c						\
	xfce-i18n.c							\
	xfce-kiosk.c							\
	xfce-license.c							\
	xfce-miscutils.c						\
	xfce-posix-signal-handler.c					\
	xfce-private.h							\
	xfce-rc.c							\
	xfce-rc-config.c						\
	xfce-rc-private.h						\
	xfce-rc-simple.c						\
	xfce-resource.c							\
	xfce-string.c						\
	xfce-systemd.c						\
	xfce-utf8.c

libxfce4util_la_CFLAGS = 						\
	$(GLIB_CFLAGS) \
	$(GIO_CFLAGS) \
	$(GOBJECT_CFLAGS)

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

libxfce4util_la_LIBADD =						\
	$(GLIB_LIBS) \
	$(GIO_LIBS) \
	$(GOBJECT_LIBS)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libxfce4util-1.0.pc


-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ENV = CC="$(CC)"
INTROSPECTION_SCANNER_ARGS = \
	--add-include-path=$(srcdir) \
	--warn-all \
	--identifier-prefix=Xfce \
	--identifier-prefix=xfce \
	--identifier-prefix=libxfce \
	-DLIBXFCE4UTIL_COMPILATION \
	--c-include=libxfce4util/libxfce4util.h
INTROSPECTION_COMPILER_ARGS = \
	--includedir=$(srcdir) \
	--includedir=.

if HAVE_INTROSPECTION
introspection_sources = $(filter-out %private.h, $(libxfce4util_la_SOURCES))

Libxfce4util-1.0.gir: libxfce4util.la Makefile
Libxfce4util_1_0_gir_INCLUDES = GObject-2.0 GLib-2.0 Gio-2.0
Libxfce4util_1_0_gir_CFLAGS = $(AM_CPPFLAGS)
Libxfce4util_1_0_gir_LIBS = libxfce4util.la
Libxfce4util_1_0_gir_FILES = $(introspection_sources)
Libxfce4util_1_0_gir_EXPORT_PACKAGES = libxfce4util-1.0
INTROSPECTION_GIRS += Libxfce4util-1.0.gir

girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)

typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)

CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

##
## 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
DISTCLEANFILES =							\
	$(libxfce4util_built_sources)

BUILT_SOURCES =								\
	$(libxfce4util_built_sources)

libxfce4util-visibility.h: libxfce4util.symbols Makefile
	$(AM_V_GEN) $(XDT_GEN_VISIBILITY) --kind=header $< $@

libxfce4util-visibility.c: libxfce4util.symbols Makefile
	$(AM_V_GEN) $(XDT_GEN_VISIBILITY) --kind=source $< $@

endif

# required for gtk-doc
dist-hook: all

EXTRA_DIST =								\
	libxfce4util.symbols						\
	libxfce4util-visibility.h					\
	libxfce4util-visibility.c

if ENABLE_VAPIGEN
-include $(VAPIGEN_MAKEFILE)

libxfce4util-1.0.vapi: Libxfce4util-1.0.gir

VAPIGEN_DEPS = gio-2.0
VAPIGEN_VAPIS = libxfce4util-1.0.vapi
VAPIGEN_GIRDIRS = $(prefix)/share/gir-1.0

## libxfce4util_1_0_vapi_DEPS = libxfce4util-1.0
libxfce4util_1_0_vapi_METADATADIRS = $(srcdir)
libxfce4util_1_0_vapi_FILES = Libxfce4util-1.0.gir

vapidir = $(datadir)/vala/vapi
vapi_DATA = $(VAPIGEN_VAPIS)
## $(VAPIGEN_VAPIS:.vapi=.deps)

endif

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