SUBDIRS = m4 pixmaps include src doc browser-plugin misc po

#DEB_FILES = debian/rules debian/changelog debian/control debian/copyright debian/README.Debian debian/menu
EXTRA_DIST = config.rpath gxine.desktop.in mime.default mime.extra autogen.sh gxine-test \
	BUGS README.de README.cs README_l10n

Applicationsdir = $(datadir)/applications
nodist_Applications_DATA = gxine.desktop

BUILT_SOURCES = gxine.desktop
CLEANFILES = $(BUILT_SOURCES)

MOSTLYCLEANFILES = \
	$(PACKAGE)-$(VERSION).tar.bz2 \
	$(distdir).tar.gz \
	$(PACKAGE).tgz \
	package_descriptions \
	$(distdir)

MAINTAINERCLEANFILES = \
	Makefile.in configure acinclude.m4 aclocal.m4 \
	ltconfig ltmain.sh \
	config.guess config.sub install-sh missing mkinstalldirs \
	libtool-nofpic depcomp compile config.log

debug:
	@list='$(SUBDIRS)'; for subdir in $$list; do \
	  (cd $$subdir && \
	   $(MAKE) $@ CFLAGS="$(DEBUG_CFLAGS)" LDFLAGS="$(DEBUG_LDFLAGS)") \
	  || exit; \
	done;
	$(MAKE) all-am CFLAGS="$(DEBUG_CFLAGS)" LDFLAGS="$(DEBUG_LDFLAGS)"

install-debug: debug
	@list='$(SUBDIRS)'; for subdir in $$list; do \
	  (cd $$subdir && \
	   $(MAKE) $@ CFLAGS="$(DEBUG_CFLAGS)" LDFLAGS="$(DEBUG_LDFLAGS)") \
	  || exit; \
	done;
	$(MAKE) install-am CFLAGS="$(DEBUG_CFLAGS)" LDFLAGS="$(DEBUG_LDFLAGS)"

prune-cache:
	-rm -f config.cache

maintainer-clean-generic-hook:
	rm -f config.status

dist: dist-pre dist-bzip2
	:

dist-pre:
	$(MAKE) -C $(top_builddir)/src mktrans
	$(MAKE) -C $(top_builddir)/misc xmltrans

translator: dist-pre
	$(MAKE) -C $(top_builddir)/po update-po
	$(MAKE) -C $(top_builddir)/misc/po update-po

if XINE_LIST
gxine.desktop: gxine.desktop.in @XINE_LIST@
	exec > $@; \
	cat $<; \
	@XINE_LIST@; \
	awk '{ printf "%s;", $$1 }' <$(srcdir)/mime.extra
else
XINE_MIME = $(if $(shell test "$(XINE_CONFIG)" = '' && echo y),$(shell pkg-config --variable=plugindir libxine),$(shell $(XINE_CONFIG) --plugindir))/mime.types
MIME = $(if $(shell test -f $(XINE_MIME) && echo y),$(XINE_MIME),$(srcdir)/mime.default)
gxine.desktop: gxine.desktop.in $(MIME) $(srcdir)/mime.extra
	exec > $@; \
	cat $<; \
	cat $(MIME) $(srcdir)/mime.extra | awk '{ printf "%s;", $$1 }'
endif

ACLOCAL_AMFLAGS = -I m4 -I m4/gettext
