# 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 General 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 = cinepaint
VERSION = 1.3.0

# These two variables depend on the location of this directory.
subdir = po
top_builddir = ..

SHELL = /bin/sh


srcdir = .
top_srcdir = ..


prefix = /usr/bin
exec_prefix = ${prefix}
datarootdir = ${prefix}/share
datadir = ${datarootdir}
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po

INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
#MKINSTALLDIRS = ./mkinstalldirs
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
#mkinstalldirs = $(MKINSTALLDIRS)

CC = gcc
GMSGFMT = /usr/bin/msgfmt
MSGFMT = /usr/bin/msgfmt
XGETTEXT = /usr/bin/xgettext
MSGMERGE = msgmerge

DEFS = -DHAVE_CONFIG_H
CFLAGS =   -g -O2 -Wall
CPPFLAGS = 

INCLUDES = -I.. -I$(top_srcdir)/intl

COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)

POFILES =  ca.po cs.po da.po de.po el.po en_GB.po es.po eu.po fi.po fr.po ga.po gl.po hu.po hr.po it.po ja.po ko.po lt.po nl.po nn.po no.po pl.po pt.po pt_BR.po ro.po ru.po sk.po sl.po sv.po tr.po uk.po zh_CN.po zh_TW.po
GMOFILES =  ca.gmo cs.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hu.gmo hr.gmo it.gmo ja.gmo ko.gmo lt.gmo nl.gmo nn.gmo no.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sv.gmo tr.gmo uk.gmo zh_CN.gmo zh_TW.gmo
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
$(POFILES) $(GMOFILES)

POTFILES = \
	../app/about_dialog.c \
	../app/airbrush.c \
	../app/app_procs.c \
	../app/depth/bezier_select.c \
	../app/drawable.c \
	../app/blend.c \
	../app/base_frame_manager.c \
	../app/store_frame_manager.c \
	../app/depth/brightness_contrast.c \
	../app/brush_edit.c \
	../app/depth/brush_select.c \
	../app/bucket_fill.c \
	../app/by_color_select.c \
	../app/depth/channel.c \
	../app/channel_ops.c \
	../app/channels_dialog.c \
	../app/clone.c \
	../app/depth/color_balance.c \
	../app/depth/color_picker.c \
	../app/depth/color_select.c \
	../app/depth/commands.c \
	../app/cms.c \
	../app/convert.c \
	../app/convolve.c \
	../app/crop.c \
	../app/depth/curves.c \
	../app/depth/desaturate.c \
	../app/devices.c \
	../app/disp_callbacks.c \
	../app/depth/dodgeburn.c \
	../app/edit_selection.c \
	../app/depth/equalize.c \
	../app/eraser.c \
	../app/expose_image.c \
	../app/fileops.c \
	../app/flip_tool.c \
	../app/floating_sel.c \
	../app/fuzzy_select.c \
	../app/depth/gamma_expose.c \
	../app/gdisplay.c \
	../app/gdisplay_ops.c \
	../app/gimage_mask.c \
	../app/brush.c \
	../app/brushlist.c \
	../app/depth/brushgenerated.c \
	../app/drawable.c \
	../app/gimage.c \
	../app/rc.c \
	../app/global_edit.c \
	../app/gradient.c \
	../app/histogram_tool.c \
	../app/depth/hue_saturation.c \
	../app/info_dialog.c \
	../app/install.c \
	../app/depth/info_window.c \
	../app/interface.c \
	../app/internal_procs.c \
	../app/depth/invert.c \
	../app/depth/layer.c \
	../app/layer_select.c \
	../app/layers_dialog.c \
	../app/depth/levels.c \
	../app/magnify.c \
	../app/main.c \
	../app/measure.c \
	../app/menus.c \
	../app/move.c \
	../app/depth/paint_core_16.c \
	../app/depth/paint_funcs_area.c \
	../app/paintbrush.c \
	../app/palette.c \
	../app/pattern_select.c \
	../app/patterns.c \
	../app/pencil.c \
	../app/perspective_tool.c \
	../app/depth/plug_in.c \
	../app/depth/posterize.c \
	../app/procedural_db.c \
	../app/rect_select.c \
	../app/resize.c \
	../app/rotate_tool.c \
	../app/scale_tool.c \
	../app/shear_tool.c \
	../app/smudge.c \
	../app/depth/text_tool.c \
	../app/depth/threshold.c \
	../app/tile_swap.c \
	../app/tips_dialog.c \
	../app/tool_options.c \
	../app/tools.c \
	../app/depth/transform_core.c \
	../app/transform_tool.c \
	../app/undo.c \
	../app/undo_cmds.c \
	../app/depth/xcf.c \

CATALOGS =  ca.gmo cs.gmo da.gmo de.gmo el.gmo en_GB.gmo es.gmo eu.gmo fi.gmo fr.gmo ga.gmo gl.gmo hu.gmo hr.gmo it.gmo ja.gmo ko.gmo lt.gmo nl.gmo nn.gmo no.gmo pl.gmo pt.gmo pt_BR.gmo ro.gmo ru.gmo sk.gmo sl.gmo sv.gmo tr.gmo uk.gmo zh_CN.gmo zh_TW.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) --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/$(PACKAGE).mo; \
	    echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
	  else \
	    $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
	    echo "installing $(srcdir)/$$cat as" \
		 "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
	  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

# 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:
