NULL =

GLIB_GENMARSHAL = `pkg-config --variable=glib_genmarshal glib-2.0`
GLIB_MKENUMS = `pkg-config --variable=glib_mkenums glib-2.0`

INCLUDES = \
	-I$(top_srcdir) 		\
	-DPREFIX=\""$(prefix)"\" 	\
	-DLIBDIR=\""$(libdir)"\" 	\
	-DG_DISABLE_DEPRECATED 		\
	-DG_LOG_DOMAIN=\"Tidy\" 	\
	$(DEPS_CFLAGS) 			\
	$(NULL)

BUILT_SOURCES = \
	tidy-enum-types.h 	\
	tidy-enum-types.c 	\
	tidy-marshal.h 		\
	tidy-marshal.c

STAMP_FILES = stamp-tidy-marshal.h stamp-tidy-enum-types.h

source_h = \
	$(top_srcdir)/tidy/tidy-actor.h 		\
	$(top_srcdir)/tidy/tidy-adjustment.h		\
	$(top_srcdir)/tidy/tidy-button.h 		\
	$(top_srcdir)/tidy/tidy-cell-renderer.h 	\
	$(top_srcdir)/tidy/tidy-cell-renderer-default.h \
	$(top_srcdir)/tidy/tidy-debug.h \
	$(top_srcdir)/tidy/tidy-depth-group.h		\
	$(top_srcdir)/tidy/tidy-finger-scroll.h		\
	$(top_srcdir)/tidy/tidy-finger-toggle.h		\
	$(top_srcdir)/tidy/tidy-frame.h			\
	$(top_srcdir)/tidy/tidy-list-column.h 		\
	$(top_srcdir)/tidy/tidy-list-column-default.h 	\
	$(top_srcdir)/tidy/tidy-list-view.h 		\
	$(top_srcdir)/tidy/tidy-proxy-texture.h 	\
	$(top_srcdir)/tidy/tidy-scroll-bar.h		\
	$(top_srcdir)/tidy/tidy-scrollable.h		\
	$(top_srcdir)/tidy/tidy-scroll-view.h		\
	$(top_srcdir)/tidy/tidy-stylable.h		\
	$(top_srcdir)/tidy/tidy-style.h 		\
	$(top_srcdir)/tidy/tidy-text.h \
	$(top_srcdir)/tidy/tidy-texture-cache.h 	\
	$(top_srcdir)/tidy/tidy-texture-frame.h 	\
	$(top_srcdir)/tidy/tidy-texture-reflection.h	\
	$(top_srcdir)/tidy/tidy-types.h 		\
	$(top_srcdir)/tidy/tidy-util.h 			\
	$(top_srcdir)/tidy/tidy-viewport.h		\
	$(top_srcdir)/tidy/tidy-behaviour-bounce.h	\
	$(top_srcdir)/tidy/tidy-behaviour-grow.h	\
	$(NULL)

source_h_private = \
	tidy-debug.h \
	$(NULL)

source_c = \
	tidy-actor.c \
	tidy-adjustment.c \
	tidy-button.c \
	tidy-cell-renderer.c \
	tidy-cell-renderer-default.c \
	tidy-depth-group.c \
	tidy-finger-scroll.c \
	tidy-finger-toggle.c \
	tidy-frame.c \
	tidy-list-column.c \
	tidy-list-column-default.c \
	tidy-list-view.c \
	tidy-proxy-texture.c \
	tidy-scroll-bar.c \
	tidy-scrollable.c \
	tidy-scroll-view.c \
	tidy-stylable.c \
	tidy-style.c \
	tidy-text.c \
	tidy-texture-cache.c \
	tidy-texture-frame.c \
	tidy-texture-reflection.c \
	tidy-util.c \
	tidy-viewport.c \
	tidy-behaviour-bounce.c \
	tidy-behaviour-grow.c \
	$(NULL)

tidy-marshal.h: stamp-tidy-marshal.h
	@true
stamp-tidy-marshal.h: Makefile tidy-marshal.list
	$(GLIB_GENMARSHAL) \
		--prefix=_tidy_marshal \
		--header \
	$(srcdir)/tidy-marshal.list > xgen-tmh && \
	(cmp -s xgen-tmh tidy-marshal.h || cp -f xgen-tmh tidy-marshal.h) && \
	rm -f xgen-tmh && \
	echo timestamp > $(@F)

tidy-marshal.c: Makefile tidy-marshal.list
	(echo "#include \"tidy-marshal.h\"" ; \
	 $(GLIB_GENMARSHAL) \
		--prefix=_tidy_marshal \
		--body \
	 $(srcdir)/tidy-marshal.list ) > xgen-tmc && \
	cp -f xgen-tmc tidy-marshal.c && \
	rm -f xgen-tmc

tidy-enum-types.h: stamp-tidy-enum-types.h Makefile
	@true
stamp-tidy-enum-types.h: $(source_h) tidy-enum-types.h.in
	( cd $(srcdir) && \
	  $(GLIB_MKENUMS) \
	    --template $(srcdir)/tidy-enum-types.h.in \
	  $(source_h) ) >> xgen-teth && \
	(cmp xgen-teth tidy-enum-types.h || cp xgen-teth tidy-enum-types.h) && \
	rm -f xgen-teth && \
	echo timestamp > $(@F)

tidy-enum-types.c: stamp-tidy-enum-types.h tidy-enum-types.c.in
	( cd $(srcdir) && \
	  $(GLIB_MKENUMS) \
	    --template $(srcdir)/tidy-enum-types.c.in \
	  $(source_h) ) >> xgen-tetc && \
	cp xgen-tetc tidy-enum-types.c && \
	rm -f xgen-tetc

noinst_LTLIBRARIES = libtidy-1.0.la

libtidy_1_0_la_LIBADD = $(TIDY_LIBS) $(DEPS_LIBS)
libtidy_1_0_la_SOURCES = \
	$(source_c) \
	$(source_h) \
	$(source_h_priv) \
	$(BUILT_SOURCES) \
	$(NULL)
libtidy_1_0_la_LDFLAGS = $(LDADD)


CLEANFILES = $(STAMP_FILES) $(BUILT_SOURCES)

DISTCLEANFILES = tidy-version.h

EXTRA_DIST = \
	tidy-enum-types.h.in \
	tidy-enum-types.c.in \
	tidy-private.h \
	tidy-version.h.in \
	tidy.h \
	tidy-marshal.list

