# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
#
# This file may be copied and used freely without restrictions.  It may
# be used in projects which are not available under a GNU Public License,
# but which still want to provide support for the GNU gettext functionality.
#
# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
#
# - Modified by jacob berkman <jacob@ximian.com> to install
#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
#
# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
#
# We have the following line for use by intltoolize:
# INTLTOOL_MAKEFILE

GETTEXT_PACKAGE = ario
PACKAGE = ario
VERSION = 1.6

SHELL = /bin/sh

srcdir = .
top_srcdir = ..
top_builddir = ..


prefix = /usr/local
exec_prefix = ${prefix}
datadir = ${datarootdir}
datarootdir = ${prefix}/share
libdir = ${exec_prefix}/lib
DATADIRNAME = share
itlocaledir = $(prefix)/$(DATADIRNAME)/locale
subdir = po
install_sh = ${SHELL} /home/tim/ario/ario-player/install-sh
# Automake >= 1.8 provides $(MKDIR_P).
# Until it can be supposed, use the safe fallback:
mkdir_p = $(install_sh) -d

INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644

GMSGFMT = /usr/bin/msgfmt
MSGFMT = /usr/bin/msgfmt
XGETTEXT = /usr/bin/xgettext
INTLTOOL_UPDATE = /usr/bin/intltool-update
INTLTOOL_EXTRACT = /usr/bin/intltool-extract
MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot

ALL_LINGUAS = 

PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)

USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep ^$$lang$$`"; then printf "$$lang "; fi; done; fi)

USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)

POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)

DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS

POTFILES = \
	../data/ario.desktop.in.in \
	../data/ui/browser-prefs.ui \
	../data/ui/connection-autodetect.ui \
	../data/ui/connection-widget.ui \
	../data/ui/cover-prefs.ui \
	../data/ui/connection-prefs.ui \
	../data/ui/connection-assistant.ui \
	../data/ui/cover-prefs.ui \
	../data/ui/cover-progress.ui \
	../data/ui/cover-select.ui \
	../data/ui/others-prefs.ui \
	../data/ui/lyrics-prefs.ui \
	../data/ui/lyrics-select.ui \
	../data/ui/playlist-prefs.ui \
	../data/ui/server-prefs.ui \
	../data/ui/similar-artists.ui \
	../data/ui/stats-prefs.ui \
	../data/ui/song-infos.ui \
	../data/ui/trayicon-prefs.ui \
	../src/ario-avahi.c \
	../src/ario-avahi.h \
	../src/ario-debug.h \
	../src/ario-main.c \
	../src/ario-profiles.c \
	../src/ario-profiles.h \
	../src/ario-util.c \
	../src/ario-util.h \
	../src/covers/ario-cover-amazon.c \
	../src/covers/ario-cover-amazon.h \
	../src/covers/ario-cover.c \
	../src/covers/ario-cover.h \
	../src/covers/ario-cover-handler.c \
	../src/covers/ario-cover-handler.h \
	../src/covers/ario-cover-lastfm.c \
	../src/covers/ario-cover-lastfm.h \
	../src/covers/ario-cover-local.c \
	../src/covers/ario-cover-local.h \
	../src/covers/ario-cover-manager.c \
	../src/covers/ario-cover-manager.h \
	../src/covers/ario-cover-provider.c \
	../src/covers/ario-cover-provider.h \
	../src/lib/ario-conf.c \
	../src/lib/ario-conf.h \
	../src/lib/libmpdclient.c \
	../src/lib/libmpdclient.h \
	../src/lib/gtk-builder-helpers.c \
	../src/lib/gtk-builder-helpers.h \
	../src/lyrics/ario-lyrics-manager.c \
	../src/lyrics/ario-lyrics-manager.h \
	../src/lyrics/ario-lyrics-provider.c \
	../src/lyrics/ario-lyrics-provider.h \
	../src/lyrics/ario-lyrics-letras.c \
	../src/lyrics/ario-lyrics-letras.h \
	../src/lyrics/ario-lyrics.c \
	../src/lyrics/ario-lyrics.h \
	../src/notification/ario-notification-manager.c \
	../src/notification/ario-notification-manager.h \
	../src/notification/ario-notifier.c \
	../src/notification/ario-notifier.h \
	../src/notification/ario-notifier-tooltip.c \
	../src/notification/ario-notifier-tooltip.h \
	../src/playlist/ario-playlist-dynamic.c \
	../src/playlist/ario-playlist-mode.c \
	../src/playlist/ario-playlist-queue.c \
	../src/playlist/ario-playlist-manager.c \
	../src/playlist/ario-playlist-normal.c \
	../src/plugins/ario-module.c \
	../src/plugins/ario-module.h \
	../src/plugins/ario-plugin.c \
	../src/plugins/ario-plugin.h \
	../src/plugins/ario-plugin-info.c \
	../src/plugins/ario-plugin-info.h \
	../src/plugins/ario-plugin-info-priv.h \
	../src/plugins/ario-plugin-manager.c \
	../src/plugins/ario-plugin-manager.h \
	../src/plugins/ario-plugins-engine.c \
	../src/plugins/ario-plugins-engine.h \
	../src/preferences/ario-browser-preferences.c \
	../src/preferences/ario-connection-preferences.c \
	../src/preferences/ario-connection-preferences.h \
	../src/preferences/ario-cover-preferences.c \
	../src/preferences/ario-cover-preferences.h \
	../src/preferences/ario-others-preferences.c \
	../src/preferences/ario-others-preferences.h \
	../src/preferences/ario-lyrics-preferences.c \
	../src/preferences/ario-lyrics-preferences.h \
	../src/preferences/ario-server-preferences.c \
	../src/preferences/ario-server-preferences.h \
	../src/preferences/ario-stats-preferences.c \
	../src/preferences/ario-stats-preferences.h \
	../src/preferences/ario-taskbar-preferences.c \
	../src/preferences/ario-preferences.h \
	../src/servers/ario-mpd.c \
	../src/servers/ario-mpd.h \
	../src/servers/ario-mpd2.c \
	../src/servers/ario-mpd2.h \
	../src/servers/ario-server.c \
	../src/servers/ario-server.h \
	../src/servers/ario-server-interface.c \
	../src/servers/ario-server-interface.h \
	../src/servers/ario-xmms.c \
	../src/servers/ario-xmms.h \
	../src/sources/ario-browser.c \
	../src/sources/ario-browser.h \
	../src/sources/ario-search.c \
	../src/sources/ario-search.h \
	../src/sources/ario-source.c \
	../src/sources/ario-source.h \
	../src/sources/ario-storedplaylists.c \
	../src/sources/ario-storedplaylists.h \
	../src/sources/ario-tree.c \
	../src/sources/ario-tree-albums.c \
	../src/sources/ario-tree-songs.c \
	../src/shell/ario-shell.c \
	../src/shell/ario-shell.h \
	../src/shell/ario-shell-coverdownloader.c \
	../src/shell/ario-shell-coverdownloader.h \
	../src/shell/ario-shell-coverselect.c \
	../src/shell/ario-shell-coverselect.h \
	../src/shell/ario-shell-lyrics.c \
	../src/shell/ario-shell-lyrics.h \
	../src/shell/ario-shell-lyricsselect.c \
	../src/shell/ario-shell-lyricsselect.h \
	../src/shell/ario-shell-preferences.c \
	../src/shell/ario-shell-preferences.h \
	../src/shell/ario-shell-similarartists.c \
	../src/shell/ario-shell-similarartists.h \
	../src/shell/ario-shell-songinfos.c \
	../src/shell/ario-shell-songinfos.h \
	../src/widgets/ario-connection-widget.c \
	../src/widgets/ario-firstlaunch.c \
	../src/widgets/ario-firstlaunch.h \
	../src/widgets/ario-header.c \
	../src/widgets/ario-header.h \
	../src/widgets/ario-lyrics-editor.c \
	../src/widgets/ario-lyrics-editor.h \
	../src/widgets/ario-playlist.c \
	../src/widgets/ario-playlist.h \
	../src/widgets/ario-songlist.c \
	../src/widgets/ario-songlist.h \
	../src/widgets/ario-status-bar.c \
	../src/widgets/ario-status-bar.h \
	../src/widgets/ario-tooltip.c \
	../src/widgets/ario-tooltip.h \
	../src/widgets/ario-tray-icon.c \
	../src/widgets/ario-tray-icon.h \
	../src/widgets/ario-volume.c \
	../src/widgets/ario-volume.h \
	../plugins/audioscrobbler/ario-audioscrobbler.c \
	../plugins/audioscrobbler/ario-audioscrobbler.h \
	../plugins/audioscrobbler/ario-audioscrobbler-plugin.c \
	../plugins/audioscrobbler/audioscrobbler-prefs.ui \
	../plugins/audioscrobbler/audioscrobbler.ario-plugin.desktop.in \
	../plugins/filesystem/ario-filesystem.c \
	../plugins/filesystem/ario-filesystem.h \
	../plugins/filesystem/ario-filesystem-plugin.c \
	../plugins/filesystem/ario-filesystem-plugin.h \
	../plugins/filesystem/filesystem.ario-plugin.desktop.in \
	../plugins/information/ario-information.c \
	../plugins/information/ario-information.h \
	../plugins/information/ario-information-plugin.c \
	../plugins/information/ario-information-plugin.h \
	../plugins/information/information.ario-plugin.desktop.in \
	../plugins/information/information.ui \
	../plugins/libnotify/libnotify.ario-plugin.desktop.in \
	../plugins/libnotify/ario-libnotify-plugin.c \
	../plugins/libnotify/ario-libnotify-plugin.h \
	../plugins/libnotify/ario-notifier-libnotify.c \
	../plugins/libnotify/ario-notifier-libnotify.h \
	../plugins/mmkeys/ario-mmkeys-plugin.c \
	../plugins/mmkeys/ario-mmkeys-plugin.h \
	../plugins/mmkeys/mmkeys.ario-plugin.desktop.in \
	../plugins/radios/ario-radio.c \
	../plugins/radios/ario-radio.h \
	../plugins/radios/ario-radios-plugin.c \
	../plugins/radios/ario-radios-plugin.h \
	../plugins/radios/radios.ario-plugin.desktop.in \
	../plugins/wikipedia/ario-wikipedia-plugin.c \
	../plugins/wikipedia/ario-wikipedia-plugin.h \
	../plugins/wikipedia/wikipedia.ario-plugin.desktop.in

CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)

.SUFFIXES:
.SUFFIXES: .po .pox .gmo .mo .msg .cat

.po.pox:
	$(MAKE) $(GETTEXT_PACKAGE).pot
	$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox

.po.mo:
	$(MSGFMT) -o $@ $<

.po.gmo:
	file=`echo $* | sed 's,.*/,,'`.gmo \
	  && rm -f $$file && $(GMSGFMT) -o $$file $<

.po.cat:
	sed -f ../intl/po2msg.sed < $< > $*.msg \
	  && rm -f $@ && gencat $@ $*.msg


all: all-yes

all-yes: $(CATALOGS)
all-no:

$(GETTEXT_PACKAGE).pot: $(POTFILES)
	$(GENPOT)

install: install-data
install-data: install-data-yes
install-data-no: all
install-data-yes: all
	linguas="$(USE_LINGUAS)"; \
	for lang in $$linguas; do \
	  dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
	  $(mkdir_p) $$dir; \
	  if test -r $$lang.gmo; then \
	    $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
	    echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
	  else \
	    $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
	    echo "installing $(srcdir)/$$lang.gmo as" \
		 "$$dir/$(GETTEXT_PACKAGE).mo"; \
	  fi; \
	  if test -r $$lang.gmo.m; then \
	    $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
	    echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
	  else \
	    if test -r $(srcdir)/$$lang.gmo.m ; then \
	      $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
		$$dir/$(GETTEXT_PACKAGE).mo.m; \
	      echo "installing $(srcdir)/$$lang.gmo.m as" \
		   "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
	    else \
	      true; \
	    fi; \
	  fi; \
	done

# Empty stubs to satisfy archaic automake needs
dvi info tags TAGS ID:

# Define this as empty until I found a useful application.
install-exec installcheck:

uninstall:
	linguas="$(USE_LINGUAS)"; \
	for lang in $$linguas; do \
	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
	  rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
	done

check: all $(GETTEXT_PACKAGE).pot
	rm -f missing notexist
	srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
	if [ -r missing -o -r notexist ]; then \
	  exit 1; \
	fi

mostlyclean:
	rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
	rm -f .intltool-merge-cache

clean: mostlyclean

distclean: clean
	rm -f Makefile Makefile.in POTFILES stamp-it
	rm -f *.mo *.msg *.cat *.cat.m *.gmo

maintainer-clean: distclean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."
	rm -f Makefile.in.in

distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir: $(DISTFILES)
	dists="$(DISTFILES)"; \
	extra_dists="$(EXTRA_DISTFILES)"; \
	for file in $$extra_dists; do \
	  test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
	done; \
	for file in $$dists; do \
	  test -f $$file || file="$(srcdir)/$$file"; \
	  ln $$file $(distdir) 2> /dev/null \
	    || cp -p $$file $(distdir); \
	done

update-po: Makefile
	$(MAKE) $(GETTEXT_PACKAGE).pot
	tmpdir=`pwd`; \
	linguas="$(USE_LINGUAS)"; \
	for lang in $$linguas; do \
	  echo "$$lang:"; \
	  result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
	  if $$result; then \
	    if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
	      rm -f $$tmpdir/$$lang.new.po; \
            else \
	      if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
	        :; \
	      else \
	        echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
	        rm -f $$tmpdir/$$lang.new.po; \
	        exit 1; \
	      fi; \
	    fi; \
	  else \
	    echo "msgmerge for $$lang.gmo failed!"; \
	    rm -f $$tmpdir/$$lang.new.po; \
	  fi; \
	done

Makefile POTFILES: stamp-it
	@if test ! -f $@; then \
	  rm -f stamp-it; \
	  $(MAKE) stamp-it; \
	fi

stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
	cd $(top_builddir) \
	  && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
	       $(SHELL) ./config.status

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
