Commit e1b9f1b4 for tesseract

commit e1b9f1b446ceaef3825934596aa63981f6a69a12
Author: Stefan Weil <sw@weilnetz.de>
Date:   Mon Jan 11 21:58:45 2021 +0100

    automake: Flat build for doc

    Signed-off-by: Stefan Weil <sw@weilnetz.de>

diff --git a/Makefile.am b/Makefile.am
index 74cc0f81..4c0b82ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,9 +5,9 @@ V = 0

 ACLOCAL_AMFLAGS = -I m4

-.PHONY: doc install-langs ScrollView.jar install-jars training
+.PHONY: doc html install-langs ScrollView.jar install-jars pdf training

-SUBDIRS = . tessdata doc unittest
+SUBDIRS = . tessdata unittest

 EXTRA_DIST = README.md LICENSE
 EXTRA_DIST += aclocal.m4 config configure.ac autogen.sh
@@ -998,3 +998,56 @@ fuzzer-api: $(top_srcdir)/unittest/fuzzers/fuzzer-api.cpp
           $(libarchive_LIBS) \
           $(libcurl_LIBS) \
           -o $@
+
+if ASCIIDOC
+
+man_MANS = doc/combine_lang_model.1
+man_MANS += doc/combine_tessdata.1
+man_MANS += doc/dawg2wordlist.1
+man_MANS += doc/lstmeval.1
+man_MANS += doc/lstmtraining.1
+man_MANS += doc/merge_unicharsets.1
+man_MANS += doc/set_unicharset_properties.1
+man_MANS += doc/tesseract.1
+man_MANS += doc/text2image.1
+man_MANS += doc/unicharset.5
+man_MANS += doc/unicharset_extractor.1
+man_MANS += doc/wordlist2dawg.1
+
+if !DISABLED_LEGACY_ENGINE
+man_MANS += doc/ambiguous_words.1
+man_MANS += doc/classifier_tester.1
+man_MANS += doc/cntraining.1
+man_MANS += doc/mftraining.1
+man_MANS += doc/shapeclustering.1
+man_MANS += doc/unicharambigs.5
+endif
+
+man_xslt = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
+
+EXTRA_DIST += $(man_MANS) doc/Doxyfile
+
+html: ${man_MANS:%=%.html}
+pdf: ${man_MANS:%=%.pdf}
+
+SUFFIXES = .asc .html .pdf
+
+.asc:
+if HAVE_XML_CATALOG_FILES
+	asciidoc -b docbook -d manpage -o - $< | \
+	XML_CATALOG_FILES=$(XML_CATALOG_FILES) xsltproc --nonet $(man_xslt) -
+else
+	asciidoc -b docbook -d manpage -o - $< | \
+	xsltproc --nonet $(man_xslt) -
+endif
+
+.asc.html:
+	asciidoc -b html5 -o $@ $<
+
+.asc.pdf:
+	asciidoc -b docbook -d manpage -o $*.dbk $<
+	docbook2pdf -o doc $*.dbk
+
+MAINTAINERCLEANFILES = $(man_MANS) Doxyfile
+
+endif
diff --git a/configure.ac b/configure.ac
index d17f34fd..aa2becd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -532,7 +532,6 @@ AC_CONFIG_FILES([java/com/google/Makefile])
 AC_CONFIG_FILES([java/com/google/scrollview/Makefile])
 AC_CONFIG_FILES([java/com/google/scrollview/events/Makefile])
 AC_CONFIG_FILES([java/com/google/scrollview/ui/Makefile])
-AC_CONFIG_FILES([doc/Makefile])
 AC_OUTPUT

 # Final message
diff --git a/doc/Makefile.am b/doc/Makefile.am
deleted file mode 100644
index 5dfa20d1..00000000
--- a/doc/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-# doc/Makefile.am
-
-if ASCIIDOC
-
-man_MANS = \
-  combine_lang_model.1 \
-  combine_tessdata.1  \
-  dawg2wordlist.1 \
-  lstmeval.1 \
-  lstmtraining.1 \
-  merge_unicharsets.1 \
-  set_unicharset_properties.1 \
-  tesseract.1 \
-  text2image.1 \
-  unicharset.5 \
-  unicharset_extractor.1 \
-  wordlist2dawg.1
-
-if !DISABLED_LEGACY_ENGINE
-man_MANS += \
-  ambiguous_words.1 \
-  classifier_tester.1 \
-  cntraining.1 \
-  mftraining.1 \
-  shapeclustering.1 \
-  unicharambigs.5
-endif
-
-man_xslt = http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
-
-EXTRA_DIST = $(man_MANS) Doxyfile
-
-.PHONY: html
-
-html: ${man_MANS:%=%.html}
-pdf: ${man_MANS:%=%.pdf}
-
-SUFFIXES = .asc .html .pdf
-
-.asc:
-if HAVE_XML_CATALOG_FILES
-	asciidoc -b docbook -d manpage -o - $< | \
-	XML_CATALOG_FILES=$(XML_CATALOG_FILES) xsltproc --nonet $(man_xslt) -
-else
-	asciidoc -b docbook -d manpage -o - $< | \
-	xsltproc --nonet $(man_xslt) -
-endif
-
-.asc.html:
-	asciidoc -b html5 -o $@ $<
-
-.asc.pdf:
-	asciidoc -b docbook -d manpage -o $*.dbk $<
-	docbook2pdf $*.dbk
-
-MAINTAINERCLEANFILES = $(man_MANS) Doxyfile
-
-endif