# $Id: Makefile.am 17769 2005-09-22 21:39:22Z benny $

INCLUDES =								\
	-I$(top_srcdir)							\
	-DG_LOG_DOMAIN=\"thunarx\"					\
	-DTHUNARX_COMPILATION						\
	$(PLATFORM_CPPFLAGS)

libthunarx_built_sources =						\
	thunarx-alias.h							\
	thunarx-aliasdef.c

libthunarx_headers =							\
	thunarx.h							\
	thunarx-config.h						\
	thunarx-file-info.h						\
	thunarx-menu-provider.h						\
	thunarx-property-page.h						\
	thunarx-property-page-provider.h

libthunarx_includedir =							\
	$(includedir)/thunarx-$(THUNAR_VERSION_API)/thunarx

libthunarx_include_HEADERS =						\
	$(libthunarx_headers)

lib_LTLIBRARIES =							\
	libthunarx-1.la

libthunarx_1_la_SOURCES =						\
	$(libthunarx_built_sources)					\
	$(libthunarx_headers)						\
	thunarx-config.c						\
	thunarx-file-info.c						\
	thunarx-menu-provider.c						\
	thunarx-property-page.c						\
	thunarx-property-page-provider.c

libthunarx_1_la_CFLAGS =						\
	$(GTK_CFLAGS)							\
	$(PLATFORM_CFLAGS)

libthunarx_1_la_LDFLAGS =						\
	-export-dynamic							\
	-export-symbols-regex "^[^_].*"					\
	-version-info $(THUNAR_VERINFO)					\
	$(PLATFORM_LDFLAGS)

libthunarx_1_la_LIBADD =						\
	$(GTK_LIBS)

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = thunarx-1.pc

EXTRA_DIST =								\
	abicheck.sh							\
	make-thunarx-alias.pl						\
	thunarx.symbols							\
	thunarx-alias.h							\
	thunarx-aliasdef.c

##
## 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 =								\
	actual-abi							\
	expected-abi

DISTCLEANFILES =							\
	$(libthunarx_built_sources)

BUILT_SOURCES =								\
	$(libthunarx_built_sources)

if HAVE_GNUC_VISIBILITY
TESTS =									\
	abicheck.sh
endif

thunarx-alias.h: make-thunarx-alias.pl thunarx.symbols
	$(PERL) $(srcdir)/make-thunarx-alias.pl < $(srcdir)/thunarx.symbols > thunarx-alias.h

thunarx-aliasdef.c: make-thunarx-alias.pl thunarx.symbols
	$(PERL) $(srcdir)/make-thunarx-alias.pl -def < $(srcdir)/thunarx.symbols > thunarx-aliasdef.c
endif

# required for gtk-doc
dist-hook: all

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