# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file file be copied and used freely without restrictions.  It can
# be used in projects which are not available under the GNU Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.

PACKAGE = xine-lib
LIBNAME = libxine1
VERSION = 1-rc1

# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..

SHELL = /bin/sh


srcdir = .
top_srcdir = ..


prefix = /usr/local
exec_prefix = ${prefix}
datadir = ${prefix}/share
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po

INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
MKINSTALLDIRS = ./mkinstalldirs
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`

CC = gcc
GMSGFMT = /usr/bin/msgfmt
MSGFMT = /usr/bin/msgfmt
XGETTEXT = /usr/bin/xgettext
MSGMERGE = msgmerge

DEFS = -DHAVE_CONFIG_H
CFLAGS = -mcpu=pentiumpro -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4  -mpreferred-stack-boundary=2 -fexpensive-optimizations -fschedule-insns2 -fno-strict-aliasing -ffast-math -funroll-loops -finline-functions -Wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $(MULTIPASS_CFLAGS) -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes     
CPPFLAGS = 

INCLUDES = -I.. -I$(top_srcdir)/intl

COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)

POFILES =  fr.po pt_BR.po de.po sk.po es.po pl_PL.po cs.po it.po
GMOFILES =  fr.gmo pt_BR.gmo de.gmo sk.gmo es.gmo pl_PL.gmo cs.gmo it.gmo
DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \
$(POFILES) $(GMOFILES)

POTFILES = \
     ../src/audio_out/audio_alsa_out.c \
     ../src/audio_out/audio_arts_out.c \
     ../src/audio_out/audio_directx_out.c \
     ../src/audio_out/audio_esd_out.c \
     ../src/audio_out/audio_irixal_out.c \
     ../src/audio_out/audio_none_out.c \
     ../src/audio_out/audio_oss_out.c \
     ../src/audio_out/audio_sun_out.c \
     ../src/demuxers/demux_avi.c \
     ../src/demuxers/demux_film.c \
     ../src/demuxers/demux_mpeg_block.c \
     ../src/demuxers/demux_mpeg_pes.c \
     ../src/demuxers/demux_nsf.c \
     ../src/demuxers/demux_ogg.c \
     ../src/demuxers/demux_pes.c \
     ../src/demuxers/demux_pva.c \
     ../src/demuxers/demux_roq.c \
     ../src/demuxers/demux_smjpeg.c \
     ../src/demuxers/demux_snd.c \
     ../src/demuxers/demux_str.c \
     ../src/demuxers/demux_voc.c \
     ../src/demuxers/demux_wc3movie.c \
     ../src/dxr3/dxr3.h \
     ../src/dxr3/dxr3_decode_video.c \
     ../src/dxr3/dxr3_mpeg_encoders.c \
     ../src/dxr3/dxr3_scr.c \
     ../src/dxr3/video_out_dxr3.c \
     ../src/input/input_cdda.c \
     ../src/input/input_dvb.c \
     ../src/input/input_file.c \
     ../src/input/input_gnome_vfs.c \
     ../src/input/input_http.c \
     ../src/input/input_mms.c \
     ../src/input/input_net.c \
     ../src/input/input_pnm.c \
     ../src/input/input_pvr.c \
     ../src/input/input_rtp.c \
     ../src/input/input_rtsp.c \
     ../src/input/input_stdin_fifo.c \
     ../src/input/input_v4l.c \
     ../src/input/input_vcd.c \
     ../src/input/mms.c \
     ../src/input/mmsh.c \
     ../src/input/net_buf_ctrl.c \
     ../src/liba52/xine_decoder.c \
     ../src/libdivx4/xine_decoder.c \
     ../src/libffmpeg/xine_decoder.c \
     ../src/libffmpeg/xine_encoder.c \
     ../src/libreal/audio_decoder.c \
     ../src/libreal/xine_decoder.c \
     ../src/libspucc/xine_decoder.c \
     ../src/libsputext/xine_decoder.c \
     ../src/libsputext/xine_decoder_ogm.c \
     ../src/libw32dll/qt_decoder.c \
     ../src/libw32dll/w32codec.c \
     ../src/libxinevdec/fli.c \
     ../src/libxinevdec/msrle.c \
     ../src/libxinevdec/qtrpza.c \
     ../src/libxinevdec/qtsmc.c \
     ../src/libxvid/xine_decoder.c \
     ../src/post/goom/xine_goom.c \
     ../src/post/mosaico/mosaico.c \
     ../src/post/mosaico/switch.c \
     ../src/video_out/video_out_aa.c \
     ../src/video_out/video_out_directfb.c \
     ../src/video_out/video_out_directx.c \
     ../src/video_out/video_out_fb.c \
     ../src/video_out/video_out_none.c \
     ../src/video_out/video_out_opengl.c \
     ../src/video_out/video_out_sdl.c \
     ../src/video_out/video_out_stk.c \
     ../src/video_out/video_out_syncfb.c \
     ../src/video_out/video_out_vidix.c \
     ../src/video_out/video_out_xshm.c \
     ../src/video_out/video_out_xv.c \
     ../src/xine-engine/audio_out.c \
     ../src/xine-engine/configfile.c \
     ../src/xine-engine/input_rip.c \
     ../src/xine-engine/load_plugins.c \
     ../src/xine-engine/osd.c \
     ../src/xine-engine/video_out.c \
     ../src/xine-engine/vo_scale.c \
     ../src/xine-engine/xine.c \
     ../src/xine-utils/memcpy.c

CATALOGS =  fr.gmo pt_BR.gmo de.gmo sk.gmo es.gmo pl_PL.gmo cs.gmo it.gmo

.SUFFIXES:
.SUFFIXES: .c .o .po .pox .gmo .mo

.c.o:
	$(COMPILE) $<

.po.pox:
	$(MAKE) $(PACKAGE).pot
	$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox

.po.mo:
	$(MSGFMT) -o $@ $<

.po.gmo:
	file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
	  && rm -f $$file && $(GMSGFMT) --check --statistics -o $$file $<


all: all-yes

all-yes: $(CATALOGS)
all-no:

# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
# otherwise packages like GCC can not be built if only parts of the source
# have been downloaded.

$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
	$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
	  --add-comments --keyword=_ --keyword=N_ \
	  --files-from=$(srcdir)/POTFILES.in \
	&& test ! -f $(PACKAGE).po \
	   || ( rm -f $(srcdir)/$(PACKAGE).pot \
		&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )


install: install-exec install-data
install-exec:
install-data: install-data-yes
	if test "$(PACKAGE)" = "gettext"; then \
	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
	  $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
			  $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
	else \
	  : ; \
	fi
install-data-no: all
install-data-yes: all
	$(mkinstalldirs) $(DESTDIR)$(datadir)
	@catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
	  dir=$(localedir)/$$lang/LC_MESSAGES; \
	  $(mkinstalldirs) $(DESTDIR)$$dir; \
	  if test -r $$cat; then \
	    $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(LIBNAME).mo; \
	    echo "installing $$cat as $(DESTDIR)$$dir/$(LIBNAME).mo"; \
	  elif test -r $(srcdir)/$$cat; then \
	    $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(LIBNAME).mo; \
	    echo "installing $(srcdir)/$$cat as" \
		 "$(DESTDIR)$$dir/$(LIBNAME).mo"; \
	  else \
	    echo "WARNING: compiled message file $$cat is missing"; \
	  fi; \
	done

# Define this as empty until I found a useful application.
installcheck:

uninstall:
	catalogs='$(CATALOGS)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
	  rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
	done
	if test "$(PACKAGE)" = "gettext"; then \
	  rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
	else \
	  : ; \
	fi

check: all

dvi info tags TAGS ID:

mostlyclean:
	rm -f core core.* *.pox $(PACKAGE).po *.new.po
	rm -fr *.o *~ \#* .*~ .\#*

clean: mostlyclean

distclean: clean
	rm -f Makefile Makefile.in POTFILES *.mo

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 $(GMOFILES)

distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
dist distdir:
	$(MAKE) update-po
	@$(MAKE) dist2
# This is a separate target because 'update-po' must be executed before.
dist2: $(DISTFILES)
	dists="$(DISTFILES)"; \
	for file in $$dists; do \
	  if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
	  cp -p $$dir/$$file $(distdir); \
	done

update-po: Makefile
	$(MAKE) $(PACKAGE).pot
	if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
	cd $(srcdir); \
	catalogs='$(GMOFILES)'; \
	for cat in $$catalogs; do \
	  cat=`basename $$cat`; \
	  lang=`echo $$cat | sed 's/\.gmo$$//'`; \
	  echo "$$lang:"; \
	  if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
	    mv -f $$lang.new.po $$lang.po; \
	  else \
	    echo "msgmerge for $$cat failed!"; \
	    rm -f $$lang.new.po; \
	  fi; \
	done
	$(MAKE) update-gmo

update-gmo: Makefile $(GMOFILES)
	@:

Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
	cd $(top_builddir) \
	  && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
	       $(SHELL) ./config.status

debug:	 
install-debug: install

# 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:
