if UNINSTALLED
shareddir = $(abs_top_builddir)/data
sysconfigdir = $(shareddir)
desktopdir = $(shareddir)
plugindir = $(abs_top_builddir)/src/plugins
enginedir = $(abs_top_builddir)/src/media-engines
icondir = $(shareddir)/icons/32x32
presetdir = $(shareddir)/presets

install: all-am
	@echo "You called configure with --enable-uninstalled. Cannot install"

else
shareddir = $(datadir)/rygel
sysconfigdir = $(sysconfdir)
desktopdir = $(datadir)/applications
plugindir = $(libdir)/rygel-2.0/plugins
enginedir = $(libdir)/rygel-2.0/engines
icondir = $(datadir)/icons/hicolor/32x32/apps
presetdir = $(shareddir)/presets
endif

smallicondir = $(shareddir)/icons/48x48
bigicondir = $(shareddir)/icons/120x120

rygeldir = $(top_srcdir)/src/rygel
librygelcoredir = $(top_srcdir)/src/librygel-core
librygelserverdir = $(top_srcdir)/src/librygel-server
librygelrendererdir = $(top_srcdir)/src/librygel-renderer

MAINTAINERCLEANFILES = Makefile.in

AM_CFLAGS = \
	$(LIBGUPNP_CFLAGS) \
	$(LIBGUPNP_AV_CFLAGS) \
	$(GEE_CFLAGS) \
	$(UUID_CFLAGS) \
	$(COVERAGE_CFLAGS) \
	-I$(rygeldir) \
	-I$(librygelcoredir) \
	-I$(librygelserverdir) \
	-I$(librygelrendererdir) \
	-DDATA_DIR='"$(shareddir)"' -DSYS_CONFIG_DIR='"$(sysconfigdir)"'\
	-DPLUGIN_DIR='"$(plugindir)"' -DDESKTOP_DIR='"$(desktopdir)"'\
	-DPRESET_DIR='"$(presetdir)"' -DENGINE_DIR='"$(enginedir)"' \
	-include config.h

RYGEL_BASE_LIBS = \
	$(LIBGUPNP_LIBS) \
	$(GEE_LIBS) \
	$(COVERAGE_LIBS)

RYGEL_COMMON_LIBS = \
	$(RYGEL_BASE_LIBS) \
	$(LIBGUPNP_AV_LIBS) \
	$(top_builddir)/src/librygel-core/librygel-core-2.0.la

RYGEL_COMMON_SERVER_LIBS = \
	$(top_builddir)/src/librygel-server/librygel-server-2.0.la \
	$(RYGEL_COMMON_LIBS)

RYGEL_COMMON_RENDERER_LIBS = \
	$(top_builddir)/src/librygel-renderer/librygel-renderer-2.0.la \
	$(RYGEL_COMMON_LIBS)

# Note: the -g needs to be at the end of VALAFLAGS to not break make dist
RYGEL_COMMON_PLUGIN_VALAFLAGS = \
	--pkg rygel-core-2.0 \
	$(RYGEL_COMMON_VALAFLAGS)

RYGEL_COMMON_SERVER_PLUGIN_VALAFLAGS = \
	--pkg rygel-server-2.0 \
	--vapidir=$(top_builddir)/src/librygel-server \
	$(RYGEL_COMMON_PLUGIN_VALAFLAGS)

RYGEL_COMMON_RENDERER_PLUGIN_VALAFLAGS = \
	--pkg rygel-renderer-2.0 \
	--vapidir=$(top_builddir)/src/librygel-renderer \
	$(RYGEL_COMMON_PLUGIN_VALAFLAGS)

RYGEL_COMMON_VALAFLAGS_PKG = --pkg gupnp-1.0 --pkg gupnp-av-1.0 --pkg gee-1.0

RYGEL_COMMON_VALAFLAGS = \
	--pkg rygel-build-config \
	--vapidir=$(rygeldir) \
	--vapidir=$(librygelcoredir) \
	$(RYGEL_COMMON_VALAFLAGS_PKG) \
	$(RYGEL_DEBUG_VALAFLAGS) \
	$(COVERAGE_VALAFLAGS)

RYGEL_PLUGIN_LINKER_FLAGS = -shared -fPIC -module -avoid-version

vala-clean:
	rm -f `find . -name "*.stamp"`
