Blob Blame History Raw
#
# Makefile.am
#
# Author: Iago Toral Quiroga <itoral@igalia.com>
#
# Copyright (C) 2010, 2011 Igalia S.L. All rights reserved.

SUBDIRS = data

BUILT_SOURCES = \
	grl-marshal.h \
	grl-marshal.c \
	grl-type-builtins.h \
	grl-type-builtins.c \
	$(NULL)

# autogenerated files
grl-marshal.h: grl-marshal.list
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix grl_marshal	\
	--header $< > $@

grl-marshal.c: grl-marshal.list grl-marshal.h
	@echo "#include \"grl-marshal.h\"" > $@.tmp
	$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix grl_marshal	\
	--body $< >> $@.tmp && mv $@.tmp $@

enum_headers = grl-source.h grl-caps.h grl-operation-options.h grl-metadata-key.h data/grl-media.h

grl-type-builtins.h: $(enum_headers) grl-type-builtins.h.template
	$(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/grl-type-builtins.h.template	\
	$(addprefix $(srcdir)/,$(enum_headers)) > $@

grl-type-builtins.c: grl-type-builtins.h $(enum_headers) grl-type-builtins.c.template
	$(AM_V_GEN) $(GLIB_MKENUMS) --template $(srcdir)/grl-type-builtins.c.template	\
	$(addprefix $(srcdir)/,$(enum_headers)) > $@

lib_LTLIBRARIES = lib@GRL_NAME@.la

lib@GRL_NAME@_la_CFLAGS =	\
	$(DEPS_CFLAGS)		\
	-I$(srcdir)		\
	-I$(srcdir)/data	\
	-DLOCALEDIR=\"$(localedir)\" \
	-DGRILO_COMPILATION	\
	-DG_LOG_DOMAIN=\"Grilo\"

lib@GRL_NAME@_la_LIBADD =	\
	$(DEPS_LIBS)

lib@GRL_NAME@_la_LDFLAGS =				\
	-version-info $(GRL_LT_VERSION)	\
	-no-undefined

lib@GRL_NAME@_la_SOURCES =					\
	grl-plugin.c grl-plugin-priv.h		\
	grl-registry.c grl-registry-priv.h	\
	grl-metadata-key.c grl-metadata-key-priv.h		\
	grl-type-builtins.c grl-type-builtins.h			\
	grl-marshal.c grl-marshal.h				\
	grl-operation.c grl-operation.h				\
	grl-operation-priv.h grl-sync.c						\
	grl-source.c			\
	grl-util.c grl-multiple.c						\
	grl-log.c grl-log-priv.h				\
	grl-value-helper.c					\
	grl-caps.c 						\
	grl-operation-options.c grl-operation-options-priv.h	\
	grl-range-value.c					\
	grilo.c

data_c_sources =		\
	data/grl-data.c		\
	data/grl-related-keys.c	\
	data/grl-media.c	\
	data/grl-config.c

lib@GRL_NAME@_la_SOURCES += $(data_c_sources)

lib@GRL_NAME@incdir =	\
	$(includedir)/@GRL_NAME@

lib@GRL_NAME@inc_HEADERS =	\
	grilo.h			\
	grl-error.h		\
	grl-plugin.h	\
	grl-registry.h	\
	grl-metadata-key.h	\
	grl-source.h	\
	grl-log.h 		\
	grl-multiple.h		\
	grl-util.h		\
	grl-definitions.h	\
	grl-operation.h		\
	grl-value-helper.h	\
	grl-caps.h		\
	grl-operation-options.h \
	grl-range-value.h

data_h_headers =		\
	data/grl-data.h		\
	data/grl-related-keys.h	\
	data/grl-media.h	\
	data/grl-config.h

lib@GRL_NAME@inc_HEADERS += $(data_h_headers)

noinst_HEADERS =			\
	grl-registry-priv.h	\
	grl-plugin-priv.h		\
	grl-metadata-key-priv.h		\
	grl-operation-priv.h		\
	grl-sync-priv.h			\
	grl-type-builtins.h		\
	grl-operation-options-priv.h	\
	grl-marshal.h

EXTRA_DIST =				\
	grl-marshal.list		\
	grl-type-builtins.h.template	\
	grl-type-builtins.c.template

CLEANFILES = *.gir

-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(srcdir)/data

# introspection support
if HAVE_INTROSPECTION
introspection_sources = \
	$(lib@GRL_NAME@inc_HEADERS)	\
	$(filter %.c,$(lib@GRL_NAME@_la_SOURCES)) \
	grl-type-builtins.h

Grl-@GRL_MAJORMINOR@.gir: lib@GRL_NAME@.la
Grl_@GRL_MAJORMINOR_NORM@_gir_INCLUDES = GObject-2.0 GModule-2.0 Gio-2.0
Grl_@GRL_MAJORMINOR_NORM@_gir_CFLAGS = $(lib@GRL_NAME@_la_CFLAGS)
Grl_@GRL_MAJORMINOR_NORM@_gir_LIBS = lib@GRL_NAME@.la
Grl_@GRL_MAJORMINOR_NORM@_gir_FILES = $(introspection_sources)
Grl_@GRL_MAJORMINOR_NORM@_gir_SCANNERFLAGS = --c-include="grilo.h"
INTROSPECTION_GIRS += Grl-@GRL_MAJORMINOR@.gir

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

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

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

-include $(top_srcdir)/git.mk