## Process this file with automake to produce Makefile.in STAMP_DIR = stamps IMAGE_DIRS = \ . \ callouts \ dialogs \ dialogs/examples\ filters \ filters/examples\ glossary \ math \ menus \ preferences \ tool-options \ toolbox \ using IMAGE_FILES = \ $(wildcard $(top_srcdir)/images/*.png) \ $(wildcard $(top_srcdir)/images/*.jpg) \ $(wildcard $(top_srcdir)/images/*/*.png) \ $(wildcard $(top_srcdir)/images/*/*.jpg) \ $(wildcard $(top_srcdir)/images/*/*/*.png) \ $(wildcard $(top_srcdir)/images/*/*/*.jpg) XML_FILES = \ $(wildcard $(top_srcdir)/src/*.xml) \ $(wildcard $(top_srcdir)/src/*/*.xml) \ $(wildcard $(top_srcdir)/src/*/*/*.xml) \ $(wildcard $(top_srcdir)/src/*/*/*/*.xml) DTD_FILES = \ $(top_srcdir)/src/linkset.dtd CSS_DIRS = \ $(top_srcdir)/stylesheets CSS_FILES = \ $(top_srcdir)/stylesheets/gimp-help-plain.css \ $(top_srcdir)/stylesheets/gimp-help-screen.css XSL_FILES = \ $(top_srcdir)/stylesheets/plainprint.xsl \ $(top_srcdir)/stylesheets/profile.xsl MAKEINDEX = $(top_srcdir)/stylesheets/makeindex.xsl HELP_STAMPS = \ $(STAMP_DIR)/css.stamp \ $(STAMP_DIR)/pdf.stamp \ $(STAMP_DIR)/html.stamp \ $(STAMP_DIR)/images.stamp \ $(STAMP_DIR)/index.stamp \ $(STAMP_DIR)/mkdirs.stamp \ $(STAMP_DIR)/profile.stamp \ $(STAMP_DIR)/validate.stamp FORMATS = html pdf EXTRA_DIST = \ HACKING \ INSTALL \ TERMINOLOGY \ stylesheets/plainhtml.xsl.in \ stylesheets/zh_CN/gimp-help-custom.css \ $(XSL_FILES) \ $(MAKEINDEX) \ $(IMAGE_FILES) \ $(DTD_FILES) \ $(XML_FILES) \ $(CSS_FILES) $(STAMP_DIR)/clean.stamp: Makefile @echo '*** Creating fresh stamps directory ***' @rm -rf $(STAMP_DIR); $(mkinstalldirs) $(STAMP_DIR) @echo '*** Removing the built help files ***' @rm -rf html @rm -rf pdf @rm -rf xml @echo '*** Removing temporary files ***' @rm -rf `find . -name "*~"` @rm -rf `find . -name "*.orig"` @rm -rf `find . -name "*.bak"` @rm -rf `find . -name "*.rej"` @touch $@ $(STAMP_DIR)/mkdirs.stamp: $(patsubst %,$(STAMP_DIR)/mkdirs.%.stamp,$(ALL_LINGUAS)) @echo '*** Creating directories ***' # we care only for HTML here # I suppose IMAGE_DIRS to be updated each time whenever you add new image directory # and it should not list empty directories @echo 'Creating base image dirrectories.'; \ for dir in $(IMAGE_DIRS); do \ $(mkinstalldirs) html/images/$$dir; \ done @for lang in $(ALL_LINGUAS); do \ echo 'Creating image dirrectories for language: '$$lang; \ for file in `find images/ -name "*.png" -o -name "*.jpg" | grep "/$$lang/"`; do \ $(mkinstalldirs) `dirname html/$$file`; \ done; \ done; @touch $@ $(patsubst %,$(STAMP_DIR)/mkdirs.%.stamp,$(ALL_LINGUAS)) : $(STAMP_DIR)/mkdirs.%.stamp : @$(mkinstalldirs) $(STAMP_DIR) @for format in $(FORMATS); do \ $(mkinstalldirs) $$format/$*; \ done; @touch $@ mkdirs: $(STAMP_DIR)/mkdirs.stamp $(STAMP_DIR)/css.stamp : $(patsubst %,$(STAMP_DIR)/css.%.stamp,$(ALL_LINGUAS)) @echo '*** Copying stylesheets ***' @touch $@ $(patsubst %,$(STAMP_DIR)/css.%.stamp,$(ALL_LINGUAS)) : $(STAMP_DIR)/css.%.stamp : $(STAMP_DIR)/mkdirs.%.stamp $(CSS_FILES) @cp $(CSS_FILES) $(srcdir)/html/$*; \ if test $* = "zh_CN"; then \ cp $(CSS_DIRS)/$*/gimp-help-custom.css $(srcdir)/html/$*; \ fi @touch $@ css: $(STAMP_DIR)/css.stamp $(STAMP_DIR)/images.stamp : $(STAMP_DIR)/mkdirs.stamp $(IMAGE_FILES) @echo '*** Copying images ***' # copy the image files to html directory @echo 'Copying common images.'; \ for dir in $(IMAGE_DIRS); do \ for file in `echo $(top_srcdir)/images/$$dir/*.png` `echo $(top_srcdir)/images/$$dir/*.jpg`; do \ if test -f $$file ; then \ cp $$file html/$$file || exit $$?; \ fi; \ done; \ done; @for lang in $(ALL_LINGUAS); do \ echo 'Copying images for '$$lang ; \ for file in `find images/ -name "*.png" -o -name "*.jpg" | grep "/$$lang/"`; do \ cp $$file html/$$file || exit $$?; \ done; \ done; @touch $@ images: $(STAMP_DIR)/images.stamp $(STAMP_DIR)/profile.stamp: $(patsubst %,$(STAMP_DIR)/profile.%.stamp,$(ALL_LINGUAS)) @echo '*** Profiling XML files ***' @touch $@ $(patsubst %,$(STAMP_DIR)/profile.%.stamp,$(ALL_LINGUAS)): $(STAMP_DIR)/profile.%.stamp : $(STAMP_DIR)/mkdirs.%.stamp $(XML_FILES) @cd $(top_srcdir) && \ $(mkinstalldirs) xml && cd xml && \ echo '-- Profiling XML for '$*;\ $(XSLTPROC) $(XSLTFLAGS) --xinclude \ --stringparam profile.lang $* \ ../stylesheets/profile.xsl \ ../src/gimp.xml | \ sed -e "s/xmlns[:a-z]*\=\"[^\"]*\" //" | \ sed -e "s/lang=[\"'][A-Za-z_;]*[\"']/lang=\"$*\"/" | \ sed -e "/^[ \t]*$$/d" >$*.xml @touch $@ profile: $(STAMP_DIR)/profile.stamp $(STAMP_DIR)/pdf.stamp: $(STAMP_DIR)/mkdirs.stamp $(STAMP_DIR)/profile.stamp @echo '*** Building PDF files ***' @for lang in $(ALL_LINGUAS); do \ echo '-- Building PDF for '$$lang; \ (dblatex -p stylesheets/plainprint.xsl xml/$$lang.xml -o pdf/$$lang.pdf); \ done @touch $@ pdf: $(STAMP_DIR)/pdf.stamp $(STAMP_DIR)/html.stamp: $(patsubst %,$(STAMP_DIR)/html.%.stamp,$(ALL_LINGUAS)) @echo '*** Building HTML ***' @touch $@ $(patsubst %,$(STAMP_DIR)/html.%.stamp,$(ALL_LINGUAS)): $(STAMP_DIR)/html.%.stamp : $(STAMP_DIR)/profile.%.stamp $(STAMP_DIR)/css.%.stamp $(STAMP_DIR)/images.stamp @echo '-- Building HTML for '$*;\ (cd $(top_srcdir)/html/$* && \ $(XSLTPROC) $(XSLTFLAGS) --xinclude \ --stringparam l10n.gentext.default.language $* \ @abs_top_builddir@/stylesheets/plainhtml.xsl ../../xml/$*.xml); @touch $@ html: $(STAMP_DIR)/html.stamp $(STAMP_DIR)/index.stamp: $(patsubst %,$(STAMP_DIR)/index.%.stamp,$(ALL_LINGUAS)) @echo '*** Generating index files ***'; @touch $@ $(patsubst %,$(STAMP_DIR)/index.%.stamp,$(ALL_LINGUAS)): $(STAMP_DIR)/index.%.stamp : $(STAMP_DIR)/html.%.stamp echo '-- Generating index for '$*; \ $(XSLTPROC) $(XSLTFLAGS) \ $(MAKEINDEX) \ $(top_srcdir)/html/$*/gimp-xrefs.xml > html/$*/gimp-help.xml; @touch $@ index: $(STAMP_DIR)/index.stamp $(STAMP_DIR)/validate.stamp: $(patsubst %,$(STAMP_DIR)/validate.%.stamp,$(ALL_LINGUAS)) @if test "x$(XMLLINT)" != "x"; then \ echo '*** Validating profiled XML ***'; \ echo 'Log files of the validation process have been generated in the xml directory.'; \ echo 'Please correct any errors before writing new content.'; \ else \ echo '*** xmllint is missing, skipping the validation step ***'; \ fi @touch $@ $(patsubst %,$(STAMP_DIR)/validate.%.stamp,$(ALL_LINGUAS)): $(STAMP_DIR)/validate.%.stamp : $(STAMP_DIR)/profile.%.stamp @echo -n '-- Validating XML for '$*; \ $(XMLLINT) --noout --valid xml/$*.xml >/dev/null 2>xml/$*-validity-errors.log; \ echo -n ' number of errors: '; \ grep "validity error" xml/$*-validity-errors.log | wc -l @touch $@ validate: $(STAMP_DIR)/validate.stamp lint: $(STAMP_DIR)/profile.stamp @if test "x$(XMLLINT)" != "x"; then \ echo '*** Checking XML for well-formed-ness ***'; \ for xml in $(XML_FILES); do \ $(XMLLINT) --noout $$xml || exit; \ done \ fi if GIMP_HELP_BUILD dist-check-build: all-local: mkdirs validate images css html index clean: $(STAMP_DIR)/clean.stamp CLEANFILES = $(HELP_STAMPS) else dist-check-build: @echo "*** --enable-build must be specified in order to make dist" @false all-local: mkdirs images css endif MAINTAINERCLEANFILES = $(HELP_STAMPS) install-data-local: $(mkinstalldirs) $(DESTDIR)$(GIMP_DATADIR)/help -cp -r html/* $(DESTDIR)$(GIMP_DATADIR)/help maintainer-clean-local: rm -rf html dist-hook: rmdir $(distdir)/images/\*/\* rmdir $(distdir)/images/\* rmdir $(distdir)/src/\*/\*/\* rmdir $(distdir)/src/\*/\* rmdir $(distdir)/src/\*