# Makefile.in generated by automake 1.16.5 from Makefile.am.
# Makefile.  Generated from Makefile.in by configure.

# Copyright (C) 1994-2021 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.



am__is_gnu_make = { \
  if test -z '$(MAKELEVEL)'; then \
    false; \
  elif test -n '$(MAKE_HOST)'; then \
    true; \
  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
    true; \
  else \
    false; \
  fi; \
}
am__make_running_with_option = \
  case $${target_option-} in \
      ?) ;; \
      *) echo "am__make_running_with_option: internal error: invalid" \
              "target option '$${target_option-}' specified" >&2; \
         exit 1;; \
  esac; \
  has_opt=no; \
  sane_makeflags=$$MAKEFLAGS; \
  if $(am__is_gnu_make); then \
    sane_makeflags=$$MFLAGS; \
  else \
    case $$MAKEFLAGS in \
      *\\[\ \	]*) \
        bs=\\; \
        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
    esac; \
  fi; \
  skip_next=no; \
  strip_trailopt () \
  { \
    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
  }; \
  for flg in $$sane_makeflags; do \
    test $$skip_next = yes && { skip_next=no; continue; }; \
    case $$flg in \
      *=*|--*) continue;; \
        -*I) strip_trailopt 'I'; skip_next=yes;; \
      -*I?*) strip_trailopt 'I';; \
        -*O) strip_trailopt 'O'; skip_next=yes;; \
      -*O?*) strip_trailopt 'O';; \
        -*l) strip_trailopt 'l'; skip_next=yes;; \
      -*l?*) strip_trailopt 'l';; \
      -[dEDm]) skip_next=yes;; \
      -[JT]) skip_next=yes;; \
    esac; \
    case $$flg in \
      *$$target_option*) has_opt=yes; break;; \
    esac; \
  done; \
  test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/gimp-help
pkgincludedir = $(includedir)/gimp-help
pkglibdir = $(libdir)/gimp-help
pkglibexecdir = $(libexecdir)/gimp-help
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-pc-linux-gnu
#am__append_1 = --mode=hardlink,copy
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4macros/python3dev.m4 \
	$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
	$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
	$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
 configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = stylesheets/plainhtml.xsl \
	stylesheets/htmlalternate.xsl
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo "  GEN     " $@;
am__v_GEN_1 = 
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 = 
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
	ctags-recursive dvi-recursive html-recursive info-recursive \
	install-data-recursive install-dvi-recursive \
	install-exec-recursive install-html-recursive \
	install-info-recursive install-pdf-recursive \
	install-ps-recursive install-recursive installcheck-recursive \
	installdirs-recursive pdf-recursive ps-recursive \
	tags-recursive uninstall-recursive
am__can_run_installinfo = \
  case $$AM_UPDATE_INFO_DIR in \
    n|no|NO) false;; \
    *) (install-info --version) >/dev/null 2>&1;; \
  esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
  distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
  $(RECURSIVE_TARGETS) \
  $(RECURSIVE_CLEAN_TARGETS) \
  $(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
	cscope distdir distdir-am dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates.  Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
  BEGIN { nonempty = 0; } \
  { items[$$0] = 1; nonempty = 1; } \
  END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique.  This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
  list='$(am__tagged_files)'; \
  unique=`for i in $$list; do \
    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
  done | $(am__uniquify_input)`
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in \
	$(top_srcdir)/stylesheets/htmlalternate.xsl.in \
	$(top_srcdir)/stylesheets/plainhtml.xsl.in AUTHORS COPYING \
	ChangeLog INSTALL NEWS README.md config.guess config.sub \
	install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
  if test -d "$(distdir)"; then \
    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
      && rm -rf "$(distdir)" \
      || { sleep 5 && rm -rf "$(distdir)"; }; \
  else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
  dir0=`pwd`; \
  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
  sed_rest='s,^[^/]*/*,,'; \
  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
  sed_butlast='s,/*[^/]*$$,,'; \
  while test -n "$$dir1"; do \
    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
    if test "$$first" != "."; then \
      if test "$$first" = ".."; then \
        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
      else \
        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
        if test "$$first2" = "$$first"; then \
          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
        else \
          dir2="../$$dir2"; \
        fi; \
        dir0="$$dir0"/"$$first"; \
      fi; \
    fi; \
    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
  done; \
  reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = aclocal -I /opt/xorg/share/aclocal
ALL_LINGUAS = en
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AUTOCONF = ${SHELL} '/home/bdubbs/gimp-help.git/missing' autoconf
AUTOHEADER = ${SHELL} '/home/bdubbs/gimp-help.git/missing' autoheader
AUTOMAKE = ${SHELL} '/home/bdubbs/gimp-help.git/missing' automake-1.16
AWK = gawk
CSCOPE = cscope
CTAGS = ctags
CYGPATH_W = echo
DBLATEX = 
DBLATEXFLAGS = --backend=xetex --style=db2latex --verbose
DEFS = -DPACKAGE_NAME=\"GIMP-Help\" -DPACKAGE_TARNAME=\"gimp-help\" -DPACKAGE_VERSION=\"2.99.0\" -DPACKAGE_STRING=\"GIMP-Help\ 2.99.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"gimp-help\" -DVERSION=\"2.99.0\"
DOT = /usr/bin/dot
ECHO_C = 
ECHO_N = -n
ECHO_T = 
ETAGS = etags
GIMP_CFLAGS = -I/usr/include/gimp-3.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gegl-0.4 -I/usr/include/json-glib-1.0 -I/usr/include/babl-0.1 -I/usr/include/gio-unix-2.0 -I/usr/include/pango-1.0 -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
GIMP_LIBS = -lgimp-3.0 -lgimpbase-3.0 -lgimpcolor-3.0 -lgimpconfig-3.0 -lgimpmath-3.0 -lgdk_pixbuf-2.0 -lcairo -lgegl-0.4 -lgegl-npd-0.4 -Wl,--export-dynamic -lgmodule-2.0 -pthread -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lbabl-0.1
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
INTLTOOL_EXTRACT = /usr/bin/intltool-extract
INTLTOOL_MERGE = 
INTLTOOL_UPDATE = /usr/bin/intltool-update
LIBOBJS = 
LIBS = 
LN_S = ln -s
LTLIBOBJS = 
MAINT = #
MAKEINFO = ${SHELL} '/home/bdubbs/gimp-help.git/missing' makeinfo
MKDIR_P = /usr/bin/mkdir -p
MSGCAT = /usr/bin/msgcat
MSGCATFLAGS = --width=$(MSGWIDTH)
MSGFMT = /usr/bin/msgfmt
MSGFMTFLAGS = --check --use-fuzzy --statistics
MSGINIT = /usr/bin/msginit
MSGINITFLAGS = --no-translator --width=$(MSGWIDTH)
MSGMERGE = /usr/bin/msgmerge
MSGMERGEFLAGS = --quiet --width=$(MSGWIDTH)
MSGUNIQ = /usr/bin/msguniq
MSGUNIQFLAGS = 
MSGWIDTH = 79
PACKAGE = gimp-help
PACKAGE_BUGREPORT = 
PACKAGE_NAME = GIMP-Help
PACKAGE_STRING = GIMP-Help 2.99.0
PACKAGE_TARNAME = gimp-help
PACKAGE_URL = 
PACKAGE_VERSION = 2.99.0
PATH_SEPARATOR = :
PKG_CONFIG = /usr/bin/pkg-config
PKG_CONFIG_LIBDIR = 
PKG_CONFIG_PATH = /opt/kf6/lib/pkgconfig:/opt/kf5/lib/pkgconfig:/opt/qt6/lib/pkgconfig:/opt/qt5/lib/pkgconfig:/opt/xorg/lib/pkgconfig:/opt/xorg/share/pkgconfig
PNGCRUSH = 
PNGNQ = 
PYTHON = /usr/bin/python3
PYTHON_EXEC_PREFIX = ${exec_prefix}
PYTHON_PLATFORM = linux
PYTHON_PREFIX = ${prefix}
PYTHON_VERSION = 3.12.3
SED = /usr/bin/sed
SET_MAKE = 
SHELL = /bin/sh
STRIP = 
STYLEBASE = http://docbook.sourceforge.net/release/xsl/current
SVG2PDF = /usr/bin/rsvg-convert
SVG2PDF_FLAGS = -a -f pdf
VERSION = 2.99.0
XML2PO = $(PYTHON) $(top_srcdir)/tools/xml2po.py
XML2POFLAGS = --mode=gimphelp --base=$(top_srcdir)/
XMLLINT = /usr/bin/xmllint
XMLLINTFLAGS = --nonet
XSLTFLAGS =  --nonet
XSLTPROC = /usr/bin/xsltproc
abs_builddir = /home/bdubbs/gimp-help.git
abs_srcdir = /home/bdubbs/gimp-help.git
abs_top_builddir = /home/bdubbs/gimp-help.git
abs_top_srcdir = /home/bdubbs/gimp-help.git
am__leading_dot = .
am__tar = tar --format=posix -chf - "$$tardir"
am__untar = tar -xf -
bindir = ${exec_prefix}/bin
build = x86_64-pc-linux-gnu
build_alias = 
build_cpu = x86_64
build_os = linux-gnu
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
gimpdatadir = /usr/share/gimp/3.0
host_alias = 
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/bdubbs/gimp-help.git/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
pkgpyexecdir = ${pyexecdir}/gimp-help
pkgpythondir = ${pythondir}/gimp-help
prefix = /usr
program_transform_name = s,x,x,
psdir = ${docdir}
pyexecdir = ${exec_prefix}/lib/python3.12/site-packages
pythondir = ${prefix}/lib/python3.12/site-packages
runstatedir = ${localstatedir}/run
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = .
sysconfdir = ${prefix}/etc
target_alias = 
top_build_prefix = 
top_builddir = .
top_srcdir = .
SUBDIRS = quickreference m4macros po-windows-installer build

# used for creating the ChangeLog
LAST_RELEASE_TAG = GIMP_HELP_2_10_0

########################################################################
####            The GIMP manual languages                           ####
########################################################################
LANGUAGES = $(if $(LINGUAS),$(filter $(ALL_LINGUAS),$(LINGUAS)),$(ALL_LINGUAS))
ifneq ($(DOC_LINGUAS),)
$(warning Do not set the internal variable DOC_LINGUAS)
endif
DOC_LINGUAS = $(LINGUAS)

ifneq ($(XML_LANG),)
$(error You must not set the internal variable XML_LANG)
endif
ifneq ($(PO_LANGS),)
$(error You must not set the internal variable PO_LANGS)
endif
XML_LANG = en
PO_LANGS = $(filter-out $(XML_LANG), $(LANGUAGES))

########################################################################
####            External programs                                   ####
########################################################################

ifneq ($(srcdir),$(builddir))
XSLTFLAGS += --path $(builddir)
endif

# Standard shell commands
find_l = find -L
echo_n = echo $(ECHO_N)

# Calling make recursively
RMAKE = $(MAKE) --no-print-directory

# Local (gimp-help-specific) tools
MAKE_IMAGE_LINKS = $(srcdir)/make.d/make_image_links.pl
MAKE_IMAGE_LINKS_FLAGS = -v $(am__append_1)

########################################################################
####            Files and directories                               ####
########################################################################

### Find files and directories

# XML files excluding automatically generated files
src_file_predicates = \
	-name '*.xml' \
	-not -name '$(notdir $(AUTHORS_DOCBOOK_XML))'

src_dir_predicates = -name images -prune -o -type d -print
pot_file_predicates = -type f
po_file_predicates = -type f -not -name "$(COMPENDIUM)"
xml_file_predicates = -name '*.xml'

# list of authors and contributors (no DocBook)
AUTHORS_DATA_XML = stylesheets/authors.xml
# automatically generated authors section (DocBook)
AUTHORS_DOCBOOK_XML = src/preface/authors.xml
AUTHORS_DOCBOOK_DIRNAME = $(dir $(AUTHORS_DOCBOOK_XML))
AUTHORS_DOCBOOK_FILENAME = $(notdir $(AUTHORS_DOCBOOK_XML))
# Stylesheets generating AUTHORS
AUTHORS_TEXT_STYLESHEETS = \
	stylesheets/authors_text.xsl \
	stylesheets/authors_common.xsl

# Stylesheets generating src/preface/authors.xml
AUTHORS_DOCBOOK_STYLESHEETS = \
	stylesheets/authors_docbook.xsl \
	stylesheets/authors_common.xsl

# Stylesheet generating MAINTAINERS
DOAP_STYLESHEET = stylesheets/doap2text.xsl

# Targets which don't require source file list
QUICK_TARGETS = help clean dot image-% AUTHORS MAINTAINERS

# lists of source (XML) files and source directories
ifeq ($(filter $(QUICK_TARGETS),$(MAKECMDGOALS)),)
SRC_DIRS  := $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
SRC_FILES := $(shell cd $(srcdir) && $(find_l) src/ $(src_file_predicates))
else
SRC_DIRS  = $(shell cd $(srcdir) && $(find_l) src/ $(src_dir_predicates))
SRC_FILES = $(shell cd $(srcdir) && $(find_l) src/ $(src_file_predicates))
endif
SRC_FILES += $(AUTHORS_DOCBOOK_XML)

# TODO?: rename "plainhtml.xsl" to "html.xsl" and use ...
# ... HTML_STYLESHEETS = stylesheets/html*.xsl
HTML_STYLESHEETS = stylesheets/plainhtml.xsl stylesheets/htmlalternate.xsl

# This variable is used by "msgmerge";
# use empty variable to disable the compendium option
COMPENDIUM = Compendium.po

### List of files for the autotools' "dist" rules

# lists of PO files (translations)
PO_FILES = $(shell cd $(srcdir) && $(find_l) po/ -type f)

# stylesheets for HTML
COMMON_CSS_FILES = \
	stylesheets/gimp-help-plain.css	\
	stylesheets/gimp-help-screen.css


# alternate stylesheets for HTML
OTHER_CSS_FILES = \
	stylesheets/gimp22.css


# stylesheets (and more) for XSLT
XSL_FILES = \
	stylesheets/authors.dtd 	\
	stylesheets/plainhtml.xsl.in	\
	stylesheets/entities.xml	\
	stylesheets/languageVocab.xml	\
	$(shell cd $(srcdir) && $(find_l) stylesheets/ -type f -name '*.xsl')	\
	gimp-help.doap


# tools needed for building
DIST_TOOLS = \
	autogen.sh \
	make.d \
	tools/xml2po.py \
	tools/xml2po


# additional files to be distributed (automake)
EXTRA_DIST = \
	AUTHORS			\
	MAINTAINERS		\
	HACKING			\
	INSTALL			\
	TERMINOLOGY		\
	$(COMMON_CSS_FILES)	\
	$(OTHER_CSS_FILES)	\
	$(SRC_FILES)		\
	$(AUTHORS_DATA_XML)	\
	$(PO_FILES)		\
	$(XSL_FILES)		\
	$(DIST_TOOLS)


#
DISTCHECK_CONFIGURE_FLAGS = --without-gimp

# gimp-help directories
helpdir = $(gimpdatadir)/help
#xml2pot = echo "Error: couldn't find xml2po or gettext tools"; exit 69

########################################################################
####            Control the amount of output messages               ####
########################################################################
#
# Usage of the "msg" and "cmd" variables:
# In the command lines of the make rules, use
#     $(msg) bla bla bla   instead of   @echo bla bla bla
#     $(cmd) command args  instead of   @command args (or command args)
# then
#     messages will be suppressed if (and only if) VERBOSE=0,
#     commands will be printed if (and only if) VERBOSE=2.
#
VERBOSE ?= 1
ifeq ($(VERBOSE),0)
msg = @:
cmd = @
else
ifeq ($(VERBOSE),2)
msg = @echo
cmd =
else
msg = @echo
cmd = @
endif
endif

########################################################################
####            Functions                                           ####
########################################################################

#--------------------------------------------------------------#
#       The main functions used to transform                   #
#               (a) XML files to POT files                     #
#               (b) POT files to PO files                      #
#               (c) XML and PO files to XML files              #
#--------------------------------------------------------------#

# Create a PO-template (POT)
#
# Usage:
#     $(call xml2pot,xml-files,pot-file)
# Parameters:
#     $1 - input:  original (untranslated) XML files
#                  and other prerequisites, e.g. images or "FORCE"
#     $2 - output: POT template file containing translatable tags
xml2pot = $(XML2PO) $(XML2POFLAGS) --output='-' $(filter %.xml,$(1)) \
          | $(MSGUNIQ) $(MSGUNIQFLAGS) \
          | $(MSGCAT) $(MSGCATFLAGS) - > "$(2)"; \
          test -s "$(2)" || rm -f "$(2)"; \
          touch -c -r $(call get_recent_file,$(1)) "$(2)" || true; \
          test -s "$(2)"

#pot2po = echo "Error: couldn't find gettext tools (msgmerge, msginit, msgfmt)"; exit 69

# Merge template (pot) and message catalog (po) or create a new catalog
#
# Usage:
#     $(call pot2po,pot-file,language,po-file)
# Parameters:
#     $1 - input POT file
#     $2 - translation language
#     $3 - output PO file
pot2po = test -e $(3) || \
             $(MSGINIT) $(MSGINITFLAGS) --input $(1) --locale=$(2) --output=$(3); \
         with_compendium="$(shell $(call get_compendium,$3)) \
                          $(shell $(call use_gimp_po_files,$2))"; \
         $(MSGMERGE) $(MSGMERGEFLAGS) $${with_compendium} --update $(3) $(1) \
         && $(MSGFMT) $(MSGFMTFLAGS) $(3) || exit 70; \
         rm -f $(3)~ messages.mo messages.gmo

#po2xml = echo "Error: couldn't find xml2po or gettext tools"; exit 69

# Merge PO file into (translated) XML file
#
# Usage:
#     $(call po2xml,en-xml-file,po-file,language,translated-xml-file)
# Parameters:
#     $1 - original (untranslated) XML file
#     $2 - PO file containing translations
#     $3 - translation language
#     $4 - resulting (translated) XML file
po2xml = $(XML2PO) $(XML2POFLAGS) --po-file=$(2) --language=$(3) --output=$(4) $(1); \
         rm -f .xml2po.mo


#--------------------------------------------------------------#
#       Helper functions                                       #
#                                                              #
#       (special thanks to automake for resorting - of         #
#       course you know it better than any human author!)      #
#--------------------------------------------------------------#
make_target_dir = f=$(1); d=$${f%/*}; test -d $$d || $(MKDIR_P) $$d
get_recent_file = $(shell ls -t $(1) 2>/dev/null | $(SED) 1q)
copy = $(LN_S) $(abs_srcdir)/$(1) $(2)

########################################################################
####            Generate XML prerequisites                          ####
########################################################################

ifeq ($(filter $(QUICK_TARGETS),$(MAKECMDGOALS)),)
include $(foreach LANG,$(PO_LANGS),xml/$(LANG)/.deps.mk)
endif

# The dynamically generated and updated ".deps.mk" files contain
# rules to register the po prereqisite for every xml file, e.g.
#	xml/LANG/*.xml: po/LANG/gimp.po
#	xml/LANG/filters/*.xml: po/LANG/filters.po
#	xml/LANG/filters/generic/*.xml: po/LANG/filters/generic.po
#	etc.

#xml/$(1)/.deps.mk: $(AUTHORS_DOCBOOK_XML) $$($(1)_PO_FILES)
# TODO: simplify
define MAKE_DEP_RULES
xml/$(1)/.deps.mk: $(AUTHORS_DOCBOOK_XML) $$(SRC_FILES)
	$$(cmd) $$(call make_target_dir,$$@)
	$$(msg) "[DEP] $$@"
	$$(cmd) echo "first: all" > $$@
	$$(cmd) for path in $(SRC_DIRS); do \
		ls $$(srcdir)/$$$${path}/*.xml >/dev/null 2>&1 || \
		ls $$$${path}/*.xml >/dev/null 2>&1 || continue; \
		path=$$$${path%/}; \
		xmldir=xml/$(1)$$$${path#src}; \
		test "$$$${path}" != "src" || path="src/gimp"; \
		pofile=po/$(1)$$$${path#src}.po; \
		echo "$$$${xmldir}/*.xml: $$$${pofile}"; \
	done >> $$@
endef
$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_DEP_RULES,$(LANG))))

########################################################################
####            Make XML files:  PO --> XML(non-en)                 ####
########################################################################
#
# TODO: check xml/$(1) vs. xml-$(1) prerequisites (XML_FILES)
define MAKE_XML_RULES
$(1)_XML_FILES = $$(SRC_FILES:src/%=xml/$(1)/%)
xml/$(1)/%.xml:
	$$(msg) "[XML] $$@"
	$$(cmd) $$(call make_target_dir,$$@)
	$$(cmd) xmlfile=$$@; \
	stem=$$*; \
	srcfile=$$(srcdir)/src/$$$${stem}.xml; \
	test "$$$${stem}" != "$$$${stem%/*}" && stem=$$$${stem%/*} || stem=gimp; \
	pofile=$$(srcdir)/po/$(1)/$$$${stem}.po; \
	test -e "$$$${pofile}" || $$(RMAKE) "$$$${pofile}"; \
	$(call po2xml,$$$${srcfile},$$$${pofile},$(1),$$@)
# Special case: authors.xml
xml/$(1)/$(AUTHORS_DOCBOOK_XML:src/%=%): $(AUTHORS_DOCBOOK_XML)
	$$(msg) "[XML] $$@"
	$$(cmd) $$(call make_target_dir,$$@)
	$$(cmd) xmlfile=$$@; \
	srcfile=$(AUTHORS_DOCBOOK_XML); \
	stem=$$(dir $$(@:xml/$(1)/%=%)); \
	pofile=$$(srcdir)/po/$(1)/$$$${stem%/}.po; \
	test -e "$$$${pofile}" || $$(RMAKE) "$$$${pofile}"; \
	$(call po2xml,$$$${srcfile},$$$${pofile},$(1),$$@)

# This is indirectly used as HTML and PDF prerequisite:
xml/$(1): $$($(1)_XML_FILES) | xml/$(1)/images
	$$(cmd) test -d $$@ && touch $$@ || $(MKDIR_P) $$@

# Targets suitable for command line
xml-$(1): po-$(1) xml/$(1) cleanup-xml-$(1) ;
endef
$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_XML_RULES,$(LANG))))

# Special case: en
en_XML_FILES = $(SRC_FILES:src/%=xml/en/%)

########################################################################
####            Make language-specific HTML tarballs                ####
########################################################################
tarball_prefix = gimp-help-html
tarball_dir = gimp-help
HTMLMETAFILES = README.md documentation-guidelines.md AUTHORS COPYING MAINTAINERS

# Delete the default suffixes (we don't compile C files)
SUFFIXES = 



all: all-recursive

.SUFFIXES:
.SUFFIXES: 
am--refresh: Makefile
	@:
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
stylesheets/plainhtml.xsl: $(top_builddir)/config.status $(top_srcdir)/stylesheets/plainhtml.xsl.in
	cd $(top_builddir) && $(SHELL) ./config.status $@
stylesheets/htmlalternate.xsl: $(top_builddir)/config.status $(top_srcdir)/stylesheets/htmlalternate.xsl.in
	cd $(top_builddir) && $(SHELL) ./config.status $@

# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
#     (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
	@fail=; \
	if $(am__make_keepgoing); then \
	  failcom='fail=yes'; \
	else \
	  failcom='exit 1'; \
	fi; \
	dot_seen=no; \
	target=`echo $@ | sed s/-recursive//`; \
	case "$@" in \
	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
	  *) list='$(SUBDIRS)' ;; \
	esac; \
	for subdir in $$list; do \
	  echo "Making $$target in $$subdir"; \
	  if test "$$subdir" = "."; then \
	    dot_seen=yes; \
	    local_target="$$target-am"; \
	  else \
	    local_target="$$target"; \
	  fi; \
	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
	  || eval $$failcom; \
	done; \
	if test "$$dot_seen" = "no"; then \
	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
	fi; test -z "$$fail"

ID: $(am__tagged_files)
	$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags

tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
	set x; \
	here=`pwd`; \
	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
	  include_option=--etags-include; \
	  empty_fix=.; \
	else \
	  include_option=--include; \
	  empty_fix=; \
	fi; \
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    test ! -f $$subdir/TAGS || \
	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
	  fi; \
	done; \
	$(am__define_uniq_tagged_files); \
	shift; \
	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
	  test -n "$$unique" || unique=$$empty_fix; \
	  if test $$# -gt 0; then \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      "$$@" $$unique; \
	  else \
	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
	      $$unique; \
	  fi; \
	fi
ctags: ctags-recursive

CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
	$(am__define_uniq_tagged_files); \
	test -z "$(CTAGS_ARGS)$$unique" \
	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
	     $$unique

GTAGS:
	here=`$(am__cd) $(top_builddir) && pwd` \
	  && $(am__cd) $(top_srcdir) \
	  && gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
	test ! -s cscope.files \
	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
	-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive

cscopelist-am: $(am__tagged_files)
	list='$(am__tagged_files)'; \
	case "$(srcdir)" in \
	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
	  *) sdir=$(subdir)/$(srcdir) ;; \
	esac; \
	for i in $$list; do \
	  if test -f "$$i"; then \
	    echo "$(subdir)/$$i"; \
	  else \
	    echo "$$sdir/$$i"; \
	  fi; \
	done >> $(top_builddir)/cscope.files

distclean-tags:
	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(BUILT_SOURCES)
	$(MAKE) $(AM_MAKEFLAGS) distdir-am

distdir-am: $(DISTFILES)
	$(am__remove_distdir)
	test -d "$(distdir)" || mkdir "$(distdir)"
	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
	list='$(DISTFILES)'; \
	  dist_files=`for file in $$list; do echo $$file; done | \
	  sed -e "s|^$$srcdirstrip/||;t" \
	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
	case $$dist_files in \
	  */*) $(MKDIR_P) `echo "$$dist_files" | \
			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
			   sort -u` ;; \
	esac; \
	for file in $$dist_files; do \
	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
	  if test -d $$d/$$file; then \
	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
	    if test -d "$(distdir)/$$file"; then \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
	    fi; \
	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
	  else \
	    test -f "$(distdir)/$$file" \
	    || cp -p $$d/$$file "$(distdir)/$$file" \
	    || exit 1; \
	  fi; \
	done
	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
	  if test "$$subdir" = .; then :; else \
	    $(am__make_dryrun) \
	      || test -d "$(distdir)/$$subdir" \
	      || $(MKDIR_P) "$(distdir)/$$subdir" \
	      || exit 1; \
	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
	    $(am__relativize); \
	    new_distdir=$$reldir; \
	    dir1=$$subdir; dir2="$(top_distdir)"; \
	    $(am__relativize); \
	    new_top_distdir=$$reldir; \
	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
	    ($(am__cd) $$subdir && \
	      $(MAKE) $(AM_MAKEFLAGS) \
	        top_distdir="$$new_top_distdir" \
	        distdir="$$new_distdir" \
		am__remove_distdir=: \
		am__skip_length_check=: \
		am__skip_mode_fix=: \
	        distdir) \
	      || exit 1; \
	  fi; \
	done
	$(MAKE) $(AM_MAKEFLAGS) \
	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
	  dist-hook
	-test -n "$(am__skip_mode_fix)" \
	|| find "$(distdir)" -type d ! -perm -755 \
		-exec chmod u+rwx,go+rx {} \; -o \
	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
	|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
	$(am__post_remove_distdir)
dist-bzip2: distdir
	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
	$(am__post_remove_distdir)

dist-lzip: distdir
	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
	$(am__post_remove_distdir)

dist-xz: distdir
	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
	$(am__post_remove_distdir)

dist-zstd: distdir
	tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
	$(am__post_remove_distdir)

dist-tarZ: distdir
	@echo WARNING: "Support for distribution archives compressed with" \
		       "legacy program 'compress' is deprecated." >&2
	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
	$(am__post_remove_distdir)

dist-shar: distdir
	@echo WARNING: "Support for shar distribution archives is" \
	               "deprecated." >&2
	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
	$(am__post_remove_distdir)

dist-zip: distdir
	-rm -f $(distdir).zip
	zip -rq $(distdir).zip $(distdir)
	$(am__post_remove_distdir)

dist dist-all:
	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
	$(am__post_remove_distdir)

# This target untars the dist file and tries a VPATH configuration.  Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
	case '$(DIST_ARCHIVES)' in \
	*.tar.gz*) \
	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
	*.tar.bz2*) \
	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
	*.tar.lz*) \
	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
	*.tar.xz*) \
	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
	*.tar.Z*) \
	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
	*.shar.gz*) \
	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
	*.zip*) \
	  unzip $(distdir).zip ;;\
	*.tar.zst*) \
	  zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
	esac
	chmod -R a-w $(distdir)
	chmod u+w $(distdir)
	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
	chmod a-w $(distdir)
	test -d $(distdir)/_build || exit 0; \
	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
	  && am__cwd=`pwd` \
	  && $(am__cd) $(distdir)/_build/sub \
	  && ../../configure \
	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
	    $(DISTCHECK_CONFIGURE_FLAGS) \
	    --srcdir=../.. --prefix="$$dc_install_base" \
	  && $(MAKE) $(AM_MAKEFLAGS) \
	  && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
	  && $(MAKE) $(AM_MAKEFLAGS) check \
	  && $(MAKE) $(AM_MAKEFLAGS) install \
	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
	        distuninstallcheck \
	  && chmod -R a-w "$$dc_install_base" \
	  && ({ \
	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
	  && rm -rf "$$dc_destdir" \
	  && $(MAKE) $(AM_MAKEFLAGS) dist \
	  && rm -rf $(DIST_ARCHIVES) \
	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
	  && cd "$$am__cwd" \
	  || exit 1
	$(am__post_remove_distdir)
	@(echo "$(distdir) archives ready for distribution: "; \
	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
	@test -n '$(distuninstallcheck_dir)' || { \
	  echo 'ERROR: trying to run $@ with an empty' \
	       '$$(distuninstallcheck_dir)' >&2; \
	  exit 1; \
	}; \
	$(am__cd) '$(distuninstallcheck_dir)' || { \
	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
	  exit 1; \
	}; \
	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
	   || { echo "ERROR: files left after uninstall:" ; \
	        if test -n "$(DESTDIR)"; then \
	          echo "  (check DESTDIR support)"; \
	        fi ; \
	        $(distuninstallcheck_listfiles) ; \
	        exit 1; } >&2
distcleancheck: distclean
	@if test '$(srcdir)' = . ; then \
	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
	  exit 1 ; \
	fi
	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
	  || { echo "ERROR: files left in build directory after distclean:" ; \
	       $(distcleancheck_listfiles) ; \
	       exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile all-local
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive

install-am: all-am
	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am

installcheck: installcheck-recursive
install-strip:
	if test -z '$(STRIP)'; then \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	      install; \
	else \
	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
	fi
mostlyclean-generic:

clean-generic:

distclean-generic:
	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)

maintainer-clean-generic:
	@echo "This command is intended for maintainers to use"
	@echo "it deletes files that may require special tools to rebuild."
pdf-local:
clean: clean-recursive

clean-am: clean-generic clean-local mostlyclean-am

distclean: distclean-recursive
	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
	-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-local \
	distclean-tags

dvi: dvi-recursive

dvi-am:

html: html-recursive

html-am: html-local

info: info-recursive

info-am:

install-data-am: install-data-local

install-dvi: install-dvi-recursive

install-dvi-am:

install-exec-am:

install-html: install-html-recursive

install-html-am:

install-info: install-info-recursive

install-info-am:

install-man:

install-pdf: install-pdf-recursive

install-pdf-am:

install-ps: install-ps-recursive

install-ps-am:

installcheck-am:

maintainer-clean: maintainer-clean-recursive
	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
	-rm -rf $(top_srcdir)/autom4te.cache
	-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic \
	maintainer-clean-local

mostlyclean: mostlyclean-recursive

mostlyclean-am: mostlyclean-generic mostlyclean-local

pdf: pdf-recursive

pdf-am: pdf-local

ps: ps-recursive

ps-am:

uninstall-am: uninstall-local

.MAKE: $(am__recursive_targets) install-am install-strip

.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \
	am--refresh check check-am clean clean-cscope clean-generic \
	clean-local cscope cscopelist-am ctags ctags-am dist dist-all \
	dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \
	dist-xz dist-zip dist-zstd distcheck distclean \
	distclean-generic distclean-local distclean-tags \
	distcleancheck distdir distuninstallcheck dvi dvi-am html \
	html-am html-local info info-am install install-am \
	install-data install-data-am install-data-local install-dvi \
	install-dvi-am install-exec install-exec-am install-html \
	install-html-am install-info install-info-am install-man \
	install-pdf install-pdf-am install-ps install-ps-am \
	install-strip installcheck installcheck-am installdirs \
	installdirs-am maintainer-clean maintainer-clean-generic \
	maintainer-clean-local mostlyclean mostlyclean-generic \
	mostlyclean-local pdf pdf-am pdf-local ps ps-am tags tags-am \
	uninstall uninstall-am uninstall-local

.PRECIOUS: Makefile


ifneq ($(COMPENDIUM),)
get_compendium = \
	file="$(1)"; dir=$${file%/*}; \
	while true; do \
		if test -f $${dir}/$(COMPENDIUM); then \
			echo "--compendium=$${dir}/$(COMPENDIUM)"; \
		fi; \
		case "$${dir}" in \
			po|*/po) break;; \
			    */*) dir="$${dir%/*}";; \
			      *) break;; \
		esac; \
	done
else
get_compendium =
endif

ifneq ($(GIMP_PO_ROOT),)
use_gimp_po_files = \
	for po in $(GIMP_PO_ROOT)/po*/$(1).po; do \
		if test -f "$${po}"; then echo '--compendium'="$${po}"; fi; \
	done
else
use_gimp_po_files =
endif

########################################################################
####            Main targets                                        ####
########################################################################

# XXX: It looks like "automake" is unable to place the "all:" target
# at top of Makefile, so running "make" might create some random file
# (depending on which target is the first one in the Makefile).
# Use "make all" instead. (FIXME: and get rid of automake/autoconf!)



all-local: html-local index AUTHORS MAINTAINERS

# TODO?: check-local: validate

########################################################################
####            Help!!!                                             ####
########################################################################

make.help:
	@echo >&2 'ERROR: cannot find the help file "$@"!'
	@exit 66

help: make.help
	$(cmd) $(SED) \
	    -e '### skip comments ###' \
	    -e '/^#/d' \
	    -e '### print if no "make" variable found ###' \
	    -e '/%/!b' \
	    -e '### replace "make" variables ###' \
	    -e 's/%LANGUAGES%/%$(strip $(LANGUAGES))%/' \
	    -e 's/%LINGUAS%/%$(strip $(LINGUAS))%/' \
	    -e 's/%ALL_LINGUAS%/%$(strip $(ALL_LINGUAS))%/' \
	$<

.PHONY: help

########################################################################
####            Make AUTHORS and MAINTAINERS file                   ####
########################################################################

AUTHORS: $(AUTHORS_DATA_XML) $(AUTHORS_TEXT_STYLESHEETS)
	$(msg) "[DOC] $@"
	$(cmd) $(XSLTPROC) \
	  $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	  $(srcdir)/stylesheets/authors_text.xsl \
	  $< \
	  > $@

$(AUTHORS_DOCBOOK_XML): $(AUTHORS_DATA_XML) $(AUTHORS_DOCBOOK_STYLESHEETS)
	$(msg) "[SRC] $@"
	$(cmd) $(call make_target_dir,$@)
	$(cmd) $(XSLTPROC) \
	  $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	  $(srcdir)/stylesheets/authors_docbook.xsl \
	  $< \
	  > $@
	$(cmd) touch -c -r $< $@ || true

MAINTAINERS: gimp-help.doap $(DOAP_STYLESHEET)
	$(msg) "[DOC] $@"
	$(cmd) $(XSLTPROC) --output $@ $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	  $(DOAP_STYLESHEET) $<

########################################################################
####            Make pot files:  XML(en) --> POT                    ####
########################################################################

# src/path/to/file/*.xml --> pot/path/to/file.pot
POT_FILES  = $(patsubst src/%,pot/%.pot,$(filter-out src src/,$(SRC_DIRS)))
# Special case: src/*.xml --> pot/gimp.pot
POT_FILES += pot/gimp.pot

# XXX: Secondary Expansion of the following two rules is required because
# "pot/%.pot: $(srcdir)/src/%/*.xml" didn't work with make v3.82
# (cf. bug #637505).
.SECONDEXPANSION:
# General case
ifeq ($(filter pot/%.pot,$(MAKECMDGOALS)),)
pot/%.pot: $(srcdir)/src/$$*/*.xml $$(wildcard images/C/$$*/*.*)
else
pot/%.pot: $(srcdir)/src/$$*/*.xml FORCE
endif
	$(cmd) $(call make_target_dir,$@)
	$(msg) "[POT] $@"
	$(cmd) $(call xml2pot,$^,$@)
# Special case: rename pot file for toplevel xml files
ifeq ($(filter pot/%.pot,$(MAKECMDGOALS)),)
pot/gimp.pot: $(srcdir)/src/*.xml $(wildcard images/C/*.*)
else
pot/gimp.pot: $(srcdir)/src/*.xml FORCE
endif
	$(cmd) $(call make_target_dir,$@)
	$(msg) "[POT] $@"
	$(cmd) $(call xml2pot,$^,$@)
# Special case: pot file for the authors DocBook file
# requires an additional prerequisite
AUTHORS_POT = $(AUTHORS_DOCBOOK_XML:src/%/$(AUTHORS_DOCBOOK_FILENAME)=pot/%.pot)
ifeq ($(filter pot/%.pot,$(MAKECMDGOALS)),)
# TODO: add images to prerequisites if necessary
$(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml)
else
$(AUTHORS_POT): $(AUTHORS_DOCBOOK_XML) $(wildcard $(AUTHORS_DOCBOOK_DIRNAME)*.xml) FORCE
endif
	$(cmd) $(call make_target_dir,$@)
	$(msg) "[POT] $@"
	$(cmd) $(call xml2pot,$^,$@)

# Remove left over pot files
cleanup-pot:
	$(msg) "Cleaning up pot files ..."
	$(cmd) if [ "$(srcdir)" = "$(builddir)" ]; then \
		$(find_l) pot/ $(pot_file_predicates) | \
		while read potfile; do \
			potfile=$${potfile#pot/}; srcfile=src/$${potfile%.pot}.xml \
			test -e $${srcfile} || rm -f $${potfile}; \
		done; \
	fi

# Targets suitable for command line
pot: potfiles cleanup-pot ;
potfiles: $(POT_FILES) ;

.PHONY: pot potfiles cleanup-pot

########################################################################
####            Make po files:  POT --> PO                          ####
########################################################################
#
define MAKE_PO_RULES
$(1)_PO_FILES = $$(patsubst pot/%.pot, $(srcdir)/po/$(1)/%.po, $$(POT_FILES))
ifeq ($$(filter $(srcdir)/po/$(1)/%.po,$$(MAKECMDGOALS)),)
$$($(1)_PO_FILES): $(srcdir)/po/$(1)/%.po : pot/%.pot
else
$$($(1)_PO_FILES): $(srcdir)/po/$(1)/%.po : pot/%.pot FORCE
endif
	$$(cmd) $$(call make_target_dir,$$@)
	$$(msg) "[PO]  $$@"
	$$(cmd) if test -s $$<; then $$(call pot2po,$$<,$(1),$$@); else touch $$@; fi
po-$(1): $$($(1)_PO_FILES) cleanup-po-$(1)
	$$(cmd) if test -e messages.mo; then rm -f messages.mo; fi
cleanup-po-$(1):
ifeq ($$(srcdir),$$(builddir))
	$$(msg) "Cleaning up '$(1)' po files ..."
	$$(cmd) $(find_l) po/$(1)/ $$(po_file_predicates) | \
	while read pofile; do \
		potfile=pot/$$$${pofile#po/$(1)/}t; \
		test -e $$$${potfile} || rm -vf $$$${pofile}; \
	done
endif
endef

$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_PO_RULES,$(LANG))))

# Special case 'en': do nothing :-)
po-en: ;

# Print translation statistics

status-%: po-status-% ;
po-status-%: po-%
	$(cmd) perl $(srcdir)/tools/get_po_status.pl $(srcdir)/po/$*

status-all: po-status-all ;
po-status-all:
	$(cmd) for podir in $(srcdir)/po/*; do \
		perl $(srcdir)/tools/get_po_status.pl \
			--nofiles --nosummary $${podir} \
		|| break; \
	done

todo-%: po-todo-% ;
po-todo-%: po-%
	$(cmd) perl $(srcdir)/tools/get_po_status.pl --todo $(srcdir)/po/$*

# Main commandline target
po: $(foreach LANG,$(PO_LANGS),po-$(LANG)) ;

.PHONY: po po-% cleanup-po-% todo-% po-todo-% po-status-%
$(en_XML_FILES): xml/en/%.xml : src/%.xml
	$(msg) "[XML] $@ (copy)"
	$(cmd) $(call make_target_dir,$@)
	$(cmd) cp -f $< $@

xml/en: $(en_XML_FILES) | xml/en/images
	$(cmd) test -d $@ && touch $@ || $(MKDIR_P) $@

xml-en: xml/en cleanup-xml-en ;

# Images

ifeq ($(MAKE_IMAGES), lazy)
# fast and lazy: detect added or removed images, but may miss changed images
IMAGE_PREREQ = $(shell cd $(srcdir) && $(find_l) images/common images/C -type d)
else ifeq ($(MAKE_IMAGES), force)
# just in case: always update images
IMAGE_PREREQ = FORCE
else
# strict (default): detects added, removed, or changed images
IMAGE_PREREQ = $(shell cd $(srcdir) && $(find_l) images/common images/C)
endif

xml/%/images: $(IMAGE_PREREQ)
	$(cmd) if test -L $@; then rm -v $@; fi
	$(cmd) if test -L xml/$*; then rm -v xml/$*; fi
	$(cmd) if test -d $@; then rm -rf $@/*; fi
	$(cmd) test -d $@ || $(MKDIR_P) $@
	$(cmd) $(echo_n) "Copying images ($*) ..."
	$(cmd) perl $(MAKE_IMAGE_LINKS) $(MAKE_IMAGE_LINKS_FLAGS) \
	           $(srcdir)/images/common $(srcdir)/images/C $@
	$(cmd) touch $@

# Remove left over xml files
cleanup-xml-%:
	$(msg) "Cleaning up '$*' xml files ..."
	$(cmd) if [ "$(srcdir)" = "$(builddir)" ]; then \
		$(find_l) xml/$*/ $(xml_file_predicates) | \
		while read xmlfile; do \
			test -e src/$${xmlfile#xml/$*/} || rm -vf $${xmlfile}; \
		done; \
	fi

# Target suitable for command line
images-%: xml/%/images html/%/images ;

# Main commandline target
xml: $(foreach LANG,$(LANGUAGES),xml-$(LANG)) ;

.PRECIOUS: xml/%/images
.PHONY: xml xml-%

########################################################################
####            XML validation                                      ####
########################################################################

validate: validate-en ;
validate-%: xmllint-% ;
validate-all: $(foreach LANG,$(LANGUAGES),validate-$(LANG)) ;

xmllint: xmllint-en ;
xmllint-%: log/%-xmllint.log
	$(cmd) test -s $< && cat $<

define MAKE_XMLLINT_RULES
log/$(1)-xmllint.log: $$($(1)_XML_FILES)
	$$(cmd) $$(call make_target_dir,$$(@))
	$$(cmd) if type $$(XMLLINT) >/dev/null 2>&1; then \
		echo "*** Validating XML ($(1)) ... "; \
		$$(XMLLINT) $$(XMLLINTFLAGS) --xinclude xml/$(1)/gimp.xml \
		| $(SED) -e 's,xmlns:xi="http://www.w3.org/2001/XInclude",,' \
		| $$(XMLLINT) $$(XMLLINTFLAGS) --valid \
			--output log/$(1).xml - 2>$$(@); \
		if test -s $$(@); then \
			echo "(You will find log and xml files in log/.)"; \
		else \
			echo "$(1): no errors."; \
			rm -f  log/$(1).xml; \
		fi >> $$(@); \
	else \
		echo >&2 "*** Validating '$(1)' skipped: 'xmllint' not found."; \
	fi
endef
$(foreach LANG,$(LANGUAGES),$(eval $(call MAKE_XMLLINT_RULES,$(LANG))))

log:
	$(cmd) mkdir $@ && test -w $@

########################################################################
####            Make HTML files:  XML --> HTML                      ####
########################################################################

### Main commandline targets ###
html-%: xml-% html/%/index.html html/%/gimp-help.xml ;
# Note that automake already defines a target "html"
html-local: $(foreach lang,$(LANGUAGES),html-$(lang)) ;

# Making the main HTML file (side effect: make gimp-xrefs.xml)
html/%/index.html: xml/% $(HTML_STYLESHEETS) | html/%/images
	$(msg) "*** Making html for $* ... "
	$(cmd) rm -f html/$*/*.*

	$(cmd) $(XSLTPROC) \
	  $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	  --xinclude \
	  --stringparam l10n.gentext.default.language $* \
	  -o html/$*/ \
	  stylesheets/plainhtml.xsl \
	  xml/$*/gimp.xml

	$(msg) "Copying stylesheets ... "
	$(cmd) for file in $(srcdir)/stylesheets/*.css \
	                   $(srcdir)/stylesheets/$*/*.css; do \
		if [ -f $${file} ]; then cp -f $${file} html/$*; fi; \
	done

###  Cross references & context help ###
index: $(foreach lang,$(LANGUAGES),index-$(lang)) ;
index-%: html/%/gimp-help.xml ;

html/%/gimp-help.xml: html/%/gimp-xrefs.xml stylesheets/makeindex.xsl
	$(msg) "[XML] $@"
	$(cmd) $(XSLTPROC) \
	  $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	  $(srcdir)/stylesheets/makeindex.xsl \
	  $< \
	  > $@

# Making index includes creating sort keys
stylesheets/makeindex.xsl: stylesheets/getsortkey.xsl
	$(cmd) touch $@

# The xrefs file is a side effect of the HTML build
html/%/gimp-xrefs.xml: html/%/index.html
	$(cmd) touch $@

###  HTML images  ###
# Cygwin
#html/%/images: $(IMAGE_PREREQ)
#	$(cmd) if test -h $@; then rm -f $@; fi
#	$(cmd) test -d $@ && rm -rf $@/* || $(MKDIR_P) $@
#	$(cmd) $(echo_n) "Copying HTML images ($*) ..."
#	$(cmd) perl $(MAKE_IMAGE_LINKS) $(MAKE_IMAGE_LINKS_FLAGS) \
#	           $(srcdir)/images/common $(srcdir)/images/C $@
#	$(cmd) touch $@
# Default (non-Cygwin)
html/%/images: xml/%/images
	$(cmd) test -d html/$* || $(MKDIR_P) html/$*
	$(cmd) test -e $@ || $(LN_S) ../../$< $@

.PHONY: html-% index index-%

########################################################################
####            Make HTML draft (single page preview)               ####
########################################################################

preview-xml/%.xml: xml/%.xml stylesheets/drafthtml.xsl
	$(cmd) id=`$(SED) -e 's/.*id=.//' -e tmatch \
	                  -e d -e :match \
			  -e 's/["'"'"'].*//' \
			  -e q $<`; \
	test -n "$${id}" || id=noname; \
	lang=$(shell echo $< | $(SED) -e 's,^xml/,,; s,/.*,,'); \
	destdir=html/$${lang}; \
	test -d $${destdir}/images || $(RMAKE) $${destdir}/images; \
	cp -f $(srcdir)/stylesheets/*.css $(srcdir)/stylesheets/$${lang}/*.css\
	    $${destdir} 2>/dev/null; \
	destfile="$${destdir}/$${id}-draft.html"; \
	echo "Making $${destfile} (ignore any XSLT complaints) ..."; \
	$(XSLTPROC) \
	    $(XSLTFLAGS) $(XSLTEXTRAFLAGS) \
	    --xinclude \
	    --stringparam l10n.gentext.default.language $${lang} \
	    --output $${destfile} \
	    $(srcdir)/stylesheets/drafthtml.xsl \
	    $<

preview-src/%.xml: $(foreach lang,$(LANGUAGES),preview-xml/$(lang)/%.xml)
	$(msg) "(Remember that links won't work in a draft file.)"

preview-po/%.po:
	@echo >&2 "After merging pofiles this feature does not work any more."
	@echo >&2 "Use 'make ... preview-xml/$*.xml'."

# For backward compatibility:

xml/%.draft: preview-xml/%.xml
	$(msg) "(Remember that links won't work in a draft file.)"

src/%.draft: preview-src/%.xml ;

# Synonyms
draft-xml/%.xml: preview-xml/%.xml ;
draft-src/%.xml: preview-src/%.xml ;
draft-po/%.po:   preview-po/%.po   ;

########################################################################
####            Make PDF files:  XML --> PDF                        ####
########################################################################

#pdf-local: $(foreach lang,$(LANGUAGES),pdf-$(lang)) ;
#pdf-%: pdf/%/gimp.pdf ;

# TODO: check prerequisites, e.g. images (--fig-path option?)
#pdf/%/gimp.pdf: xml/% stylesheets/plainprint.xsl xml/%/images
#	$(cmd) if test -f pdf/%.pdf; then rm -f pdf/%.pdf; fi
#	$(cmd) test -d pdf/$* || $(MKDIR_P) pdf/$*
#	$(msg) "*** Making PDF ($*) ..."
#	$(cmd) $(DBLATEX) $(DBLATEXFLAGS) $(DBLATEXEXTRAFLAGS) \
#	    --xsl-user=$(srcdir)/stylesheets/plainprint.xsl \
#	    --output=$@ \
#	    xml/$*/gimp.xml

pdf-local $(foreach lang,$(LANGUAGES),pdf-$(lang)):
	@echo "*** Cannot build PDFs because dblatex(1) was not found ***"
	@exit 69

$(tarball_prefix)-%.tar: html/%/index.html html/%/gimp-help.xml \
		$(HTMLMETAFILES) make.d/Makefile.html-package
	$(msg) "Making $@ ..."
	$(cmd) test ! -d $(tarball_dir)
	$(cmd) $(MKDIR_P) $(tarball_dir)/html
	$(cmd) cd $(tarball_dir)/html && $(LN_S) ../../html/$* .
	$(cmd) cp $(HTMLMETAFILES) $(tarball_dir)/
	$(cmd) cp make.d/INSTALL.html-package $(tarball_dir)/INSTALL
	$(cmd) $(SED) -e '/LANGUAGE *=/s/en/$*/' \
		make.d/Makefile.html-package > $(tarball_dir)/Makefile
	$(cmd) tar -chf $@ $(tarball_dir)/
	$(cmd) rm -rf $(tarball_dir)

$(tarball_prefix)-%.tar.gz: $(tarball_prefix)-%.tar
	$(msg) "Making $@ ..."
	$(cmd) gzip -c9 $< > $@

$(tarball_prefix)-%.tar.bz2: $(tarball_prefix)-%.tar
	$(msg) "Making $@ ..."
	$(cmd) bzip2 -c9 $< > $@

$(tarball_prefix)-%.zip: $(tarball_prefix)-%.tar
	$(msg) "Making $@ ..."
	$(cmd) rm -rf $(tarball_dir)/html
	$(cmd) $(MKDIR_P) $(tarball_dir)/html
	$(cmd) cd $(tarball_dir)/html && $(LN_S) ../../html/$* .
	$(cmd) zip -9rq $@ $(tarball_dir)/html
	$(cmd) rm -rf $(tarball_dir)

html-dist: \
	$(foreach lang,$(LANGUAGES), \
		$(tarball_prefix)-$(lang).tar.gz \
		$(tarball_prefix)-$(lang).tar.bz2 \
		$(tarball_prefix)-$(lang).zip \
	)

########################################################################
####            Make a distribution tar file                        ####
########################################################################

dist-hook: dist-copy-images generate-changelog

dist-copy-images:
	$(cmd) test -d "$(top_srcdir)/images" && test -d "$(distdir)"
	@echo "Copying images into distdir $(distdir) ..."
	$(cmd)(cd $(top_srcdir) && tar -cf- --exclude=.git images) \
	| (cd $(distdir) && tar -xf-)
	$(cmd) test -d "$(distdir)/images" && test ! -d "$(distdir)/images/.git"

generate-changelog:
	@if test -d "$(srcdir)/.git"; \
	then \
		echo Creating ChangeLog && \
		( cd "$(top_srcdir)" && \
		  echo '# Generated by Makefile. Do not edit.'; echo; \
		  ./missing --run git log --stat -t $(LAST_RELEASE_TAG)..HEAD ) > ChangeLog.tmp \
		&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
		|| ( rm -f ChangeLog.tmp ; \
			echo Failed to generate ChangeLog >&2 ); \
	else \
		echo A git clone is required to generate a ChangeLog >&2; \
	fi

########################################################################
####            Installation                                        ####
########################################################################

install-data-local:
	$(cmd) $(MKDIR_P) $(DESTDIR)$(helpdir) || exit 77
	$(cmd) $(echo_n) "*** Installing HTML:"
	$(cmd) cd html && \
	for lang in $(LANGUAGES); do \
		$(echo_n) " $${lang}"; \
		tar -chf- $${lang} | \
		(cd $(DESTDIR)$(helpdir)/ && tar -xf-) || exit 70; \
	done; \
	echo .

uninstall-local:
	$(cmd) test -d $(DESTDIR)$(helpdir) || exit 70
	$(cmd) $(echo_n) "*** Uninstalling HTML:"
	$(cmd) for lang in $(LANGUAGES); do \
		$(echo_n) " $${lang}"; \
		rm -rf $(DESTDIR)$(helpdir)/$${lang}; \
	done; \
	echo .
	$(cmd) test -z "$(DESTDIR)" || cd $(DESTDIR) && \
	dir="$(helpdir)" && \
	while [ -d "$${dir}" ]; do \
		if [[ "$${dir}" == "${prefix}" ]]; then \
			break; \
		else \
			rmdir $${dir} 2>/dev/null \
			&& echo removed $(DESTDIR)$${dir} \
			&& dir=$${dir%/*} \
			|| break; \
		fi \
	done

########################################################################
####            Source file checks                                  ####
########################################################################

# Note that the default (autoconf) target name is "check".
checks: check-image-references ;
check-images: check-image-references ;

check-image-references:
	$(cmd) if cd $(srcdir) && test -e tools/validate_references.py && \
	type python >/dev/null 2>&1; then \
	    echo "*** Checking image references ... "; \
	    python tools/validate_references.py \
	        --verbose --broken --orphaned \
		$(IMAGE_LANGS); \
	else \
	    echo >&2 "*** Cannot check image references (no Python installed?) ***"; \
	fi

check-images-%: FORCE
	$(cmd) $(RMAKE) check-image-references IMAGE_LANGS="C $*"

check-image-resolutions-%:
	$(cmd) /bin/sh $(srcdir)/tools/check_image_resolutions.sh $(srcdir)/images/$*

# special case 'en':
check-images-en check-images-C: check-image-references ;
check-image-resolutions-en: check-image-resolutions-C ;

.PHONY: checks check-image-references check-image-resolutions-%

########################################################################
####            Build system development & debugging                ####
########################################################################

build-system.svg: make.d/build-system.dot
	$(cmd) $(DOT) -Tsvg -o $@ $< && \
	echo "$@ created."

dot: build-system.svg

########################################################################
####            Clean up                                            ####
########################################################################

# Delete all files that are normally created by building the program.
clean-local: mostlyclean-local
	$(cmd) rm -rf html
	$(cmd) rm -f AUTHORS MAINTAINERS

# Like `clean-local', but may refrain from deleting a few files that people
# normally don't want to recompile.
mostlyclean-local:
	$(cmd) rm -rf pdf
	$(cmd) rm -rf xml
	$(cmd) rm -rf pot
ifneq ($(srcdir),$(builddir))
	$(cmd) rm -rf src
	$(cmd) rm -rf po
else
	$(cmd) rm -f $(AUTHORS_DOCBOOK_XML)
endif
	$(cmd) rm -rf $(tarball_dir)
	$(cmd) rm -f $(tarball_prefix)-*
	$(cmd) rm -f build-system.*
	$(cmd) rm -f .xml2po.mo messages.mo

# Delete all files in the current directory (or created by this makefile) that
# are created by configuring or building the program.
distclean-local: clean-local
ifneq ($(srcdir),$(builddir))
		$(cmd) rm -rf stylesheets
endif

# Delete almost everything (not 'configure' or anything that needs to exist in
# order to run 'configure') that can be reconstructed with this Makefile.
maintainer-clean-local: distclean-local
	$(cmd) rm -rf log

# Override automake-generated targets
Makefile: $(srcdir)/Makefile.in $(srcdir)/Makefile.am $(srcdir)/configure.ac $(srcdir)/autogen.sh
	$(msg) "!!! Updating '$@' running 'autogen.sh' ($? changed) !!!"
	$(cmd) opt=`test -e $(builddir)/config.status && \
	     $(builddir)/config.status --version | \
	     sed -e 's/.*with options "//' \
	         -e tmatch -e d -e :match -e 's/".*//' \
		 -e "s/'\([^'=]*\)=\([^']*\)'/\1='\2'/"`; \
	test -n "$${opt}" && eval $(srcdir)/autogen.sh $${opt}
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/autogen.sh ;

$(top_builddir)/config.status: $(top_srcdir)/configure ;

$(top_srcdir)/configure: $(top_srcdir)/configure.ac ;

########################################################################
####            Special targets                                     ####
########################################################################

FORCE: ;

.PHONY: FORCE

# GNU Make, please don't delete these targets when a target that depends
# on them fails, 'kay?
#			TODO: check: seems that xml/%/gimp.xml can be removed
.PRECIOUS: \
	xml/%/gimp.xml \
	xml/%/images \
	pdf/%/gimp.pdf \
	html/%/index.html \
	html/%/gimp-xrefs.xml \
	html/%/gimp-help.xml \
	html/%/images

.DELETE_ON_ERROR:

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