@@ -15,11 +15,8 @@ GENERATED_MANPAGES += $(patsubst ../docs/src/man/%.adoc, ../docs/man/%, $(wildca
1515
1616MAN_SRCS = $(sort \
1717 $(wildcard $(DOC_DIR)/man/man1/*.1) \
18- $(wildcard $(DOC_DIR)/man/man3/*.3* ) \
18+ $(wildcard $(DOC_DIR)/man/man3/*.3) \
1919 $(wildcard $(DOC_DIR)/man/man9/*.9) \
20- $(wildcard $(DOC_DIR)/man/es/man1/*.1) \
21- $(wildcard $(DOC_DIR)/man/es/man3/*.3*) \
22- $(wildcard $(DOC_DIR)/man/es/man9/*.9) \
2320 $(GENERATED_MANPAGES))
2421
2522$(DOC_SRCDIR)/man/man1/linuxcnc.1.adoc: $(DOC_SRCDIR)/man/man1/linuxcnc.1.adoc.in config.status
@@ -171,7 +168,7 @@ DOC_SRCS_EN := \
171168 Master_Integrator.adoc \
172169 Master_Developer.adoc
173170
174- LANGUAGES := $(shell grep '\[po4a_langs\]' $(DOC_DIR)/po4a.cfg| cut -d" " -f2-)
171+ LANGUAGES := $(shell sed -e's/#.*//' < $(DOC_DIR)/po4a.cfg | grep '^\[po4a_langs\]' | cut -d" " -f2-)
175172LANGUAGES_MATCH := $(shell echo $(LANGUAGES) | tr " " "|")
176173
177174
@@ -190,13 +187,19 @@ ifneq (${TIME_CMD},)
190187 TIME_CMD := ${TIME_CMD} -v
191188endif
192189
190+ ifeq ($(BUILD_VERBOSE),1)
191+ PO4A_VERBOSE = -v
192+ else
193+ PO4A_VERBOSE =
194+ endif
195+
193196$(DOC_DIR)/po/documentation.pot: $(addprefix $(DOC_SRCDIR)/, $(DOC_SRCS_EN))
194- cd $(DOC_DIR); ${TIME_CMD} po4a -v --msgmerge-opt='-v' --no-translations po4a.cfg
197+ cd $(DOC_DIR); ${TIME_CMD} po4a $(PO4A_VERBOSE) --msgmerge-opt='-v' --no-translations po4a.cfg
195198pofiles: $(DOC_DIR)/po/documentation.pot
196199
197200ifeq ($(BUILD_DOCS_TRANSLATED),yes)
198201translateddocs: manpages $(DOC_DIR)/po/documentation.pot
199- cd $(DOC_DIR); ${TIME_CMD} po4a -v --msgmerge-opt='-v' --no-update po4a.cfg
202+ cd $(DOC_DIR); ${TIME_CMD} po4a $(PO4A_VERBOSE) --msgmerge-opt='-v' --no-update po4a.cfg
200203else
201204translateddocs:
202205endif
@@ -538,11 +541,41 @@ $(DOC_DIR)/LinuxCNC_Developer_zh_CN.pdf: $(DOC_SRCDIR)/zh_CN/Master_Developer.pd
538541$(DOC_DIR)/html/man/%.html: $(DOC_DIR)/man/%
539542 @echo Formatting $(notdir $<) as HTML
540543 @mkdir -p $(dir $@)
541- # Attention! This is a temporary fix until Groff 1.23 is released. Should be
542- # set back to "-m man" when 1.23 is available.
543- # This fixes the formatting of subsections and appearance in the toc.
544- # It uses the local an-old.tmac instead of the one which is shipped with Groff.
545- @(cd $(DOC_DIR)/man; groff -Thtml -m an-old-fixed -M . stylesheet.9 $(patsubst $(DOC_DIR)/man/%,%,$<)) > $@
544+ $(Q)if grep -q '^\.so' $<; then \
545+ ln -srf ../docs/html/man/$$(awk '{print $$2}' $<).html $@; \
546+ else \
547+ N="$$(basename "$<").adoc"; \
548+ D="$$(dirname "$<")"; \
549+ S="$$(basename "$$D")"; \
550+ if [ -r "$(DOC_SRCDIR)/man/$$S/$$N" ]; then \
551+ F="$(DOC_SRCDIR)/man/$$S/$$N"; \
552+ elif [ -r "objects/man/$$S/$$N" ]; then \
553+ F="objects/man/$$S/$$N"; \
554+ else \
555+ echo "Error: Cannot find manpage '$<' in adoc format"; \
556+ exit 1; \
557+ fi; \
558+ asciidoc \
559+ --doctype=manpage \
560+ --backend=html \
561+ -a mansource=LinuxCNC \
562+ -a manmanual='LinuxCNC Documentation' \
563+ -f $(DOC_SRCDIR)/xhtml11.conf \
564+ -f $(DOC_SRCDIR)/xhtml11-head-foot.conf \
565+ -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
566+ -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
567+ -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
568+ -a disable-javascript \
569+ -a autowidth-option \
570+ -a "footer-style=none" \
571+ -a linkcss \
572+ -a "scriptsdir=../.." \
573+ -a "stylesdir=../.." \
574+ -a stylesheet=linuxcnc.css \
575+ -o $@ \
576+ "$$F" \
577+ ; \
578+ fi;
546579
547580SA := <p><a onclick=\"return toggle('man_
548581SB := ')\"><img id=\"man_
@@ -581,13 +614,17 @@ objects/index.incl: $(GENERATED_MANPAGES) objects/var-MAN_HTML_TARGETS $(DOC_SRC
581614 $(call ADD_HTML_MANPAGES, rtapi, API: RTAPI, $(filter $(DOC_DIR)/html/man/man3/rtapi%.html, $(MAN_HTML_TARGETS))) \
582615 $(call ADD_HTML_MANPAGES, hm2, API: Hostmot2, $(filter $(DOC_DIR)/html/man/man3/hm2%.html, $(MAN_HTML_TARGETS))) \
583616 $(call ADD_HTML_MANPAGES, 3, API: General, $(filter-out $(DOC_DIR)/html/man/man3/hal%.html, $(filter-out $(DOC_DIR)/html/man/man3/rtapi%.html, $(filter-out $(DOC_DIR)/html/man/man3/hm2%.html, $(filter $(DOC_DIR)/html/man/man3/%.html, $(MAN_HTML_TARGETS)))))) \
584- # now make sure all manpages made it into the html index \
617+ # now make sure all manpages made it into the html index
585618 FAIL=0; \
586619 for F in $$(find $(DOC_DIR)/man/man* -type f); do \
587620 B=$$(basename $$F); \
588621 if ! grep -q $$B $@; then \
589- echo stray manpage not added to index: $$B; \
590622 FAIL=1; \
623+ if ! grep -q '^\.so' $$F; then \
624+ echo stray manpage not added to index: $$F; \
625+ else \
626+ echo manpage alias not added to index: $$F; \
627+ fi; \
591628 fi; \
592629 done; \
593630 if [ $$FAIL -ne 0 ]; then exit 1; fi
@@ -606,7 +643,7 @@ $(DOC_DIR)/html/index.html: $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SR
606643$(DOC_SRCDIR)/%.pdf: $(DOC_SRCDIR)/%.adoc svgs_made_from_dots .adoc-images-stamp
607644 $(ECHO) Building $@
608645 @rm -f $@
609- $(A2X) -L -d book -vf pdf $< || (X=$$?; rm -f $@; exit $$X)
646+ $(Q)$( A2X) -L -d book -vf pdf $< || (X=$$?; rm -f $@; exit $$X)
610647 @test -f $@
611648
612649depends/%.d: $(DOC_SRCDIR)/%.adoc $(DOC_SRCDIR)/asciideps .include-stamp
@@ -617,9 +654,9 @@ depends/%.d: $(DOC_SRCDIR)/%.adoc $(DOC_SRCDIR)/asciideps .include-stamp
617654
618655objects/%.links-stamp: $(DOC_SRCDIR)/%.adoc $(DOC_SRCDIR)/links.xslt
619656 @mkdir -p `dirname $@`
620- asciidoc -f $(DOC_SRCDIR)/attribute-colon.conf -a "scriptdir=$(DOC_SRCDIR)/" -d book -o- -b docbook $< | xsltproc $(DOC_SRCDIR)/links.xslt - > $@.tmp || (X=$$?; rm -f $@; exit $$X)
621- sh move-if-change $@.tmp $(patsubst %-stamp,%,$@)
622- touch $@
657+ $(Q) asciidoc -f $(DOC_SRCDIR)/attribute-colon.conf -a "scriptdir=$(DOC_SRCDIR)/" -d book -o- -b docbook $< | xsltproc $(DOC_SRCDIR)/links.xslt - > $@.tmp || (X=$$?; rm -f $@; exit $$X)
658+ $(Q) sh move-if-change $@.tmp $(patsubst %-stamp,%,$@)
659+ $(Q) touch $@
623660
624661objects/%.links: objects/%.links-stamp
625662 @:
@@ -734,7 +771,8 @@ $(DOC_SRCDIR)/%.html: STYLES_SCRIPTS=$(shell \
734771)
735772
736773$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_EN_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_en.links $(LOC_LANG_MAP)
737- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
774+ $(ECHO) "Building 'en' adoc to html: " $<
775+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
738776 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
739777 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
740778 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -747,7 +785,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_EN_SMALL)): $(DOC_SRCDIR)/%.ht
747785 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
748786
749787$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_AR_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_ar.links $(LOC_LANG_MAP)
750- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
788+ $(ECHO) "Building 'ar' adoc to html: " $<
789+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
751790 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
752791 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
753792 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -760,7 +799,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_AR_SMALL)): $(DOC_SRCDIR)/%.ht
760799 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
761800
762801$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_DE_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_de.links $(LOC_LANG_MAP)
763- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
802+ $(ECHO) "Building 'de' adoc to html: " $<
803+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
764804 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
765805 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
766806 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -773,7 +813,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_DE_SMALL)): $(DOC_SRCDIR)/%.ht
773813 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
774814
775815$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_ES_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_es.links $(LOC_LANG_MAP)
776- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
816+ $(ECHO) "Building 'es' adoc to html: " $<
817+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
777818 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
778819 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
779820 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -786,7 +827,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_ES_SMALL)): $(DOC_SRCDIR)/%.ht
786827 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
787828
788829$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_FR_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_fr.links $(LOC_LANG_MAP)
789- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
830+ $(ECHO) "Building 'fr' adoc to html: " $<
831+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
790832 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
791833 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
792834 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -799,7 +841,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_FR_SMALL)): $(DOC_SRCDIR)/%.ht
799841 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
800842
801843$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_NB_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_nb.links $(LOC_LANG_MAP)
802- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
844+ $(ECHO) "Building 'nb' adoc to html: " $<
845+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
803846 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
804847 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
805848 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -812,7 +855,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_NB_SMALL)): $(DOC_SRCDIR)/%.ht
812855 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
813856
814857$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_RU_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_ru.links $(LOC_LANG_MAP)
815- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
858+ $(ECHO) "Building 'ru' adoc to html: " $<
859+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
816860 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
817861 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
818862 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -825,7 +869,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_RU_SMALL)): $(DOC_SRCDIR)/%.ht
825869 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
826870
827871$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_SV_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_sv.links $(LOC_LANG_MAP)
828- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
872+ $(ECHO) "Building 'sv' adoc to html: " $<
873+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
829874 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
830875 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
831876 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -838,7 +883,8 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_SV_SMALL)): $(DOC_SRCDIR)/%.ht
838883 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
839884
840885$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_TR_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_tr.links $(LOC_LANG_MAP)
841- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
886+ $(ECHO) "Building 'tr' adoc to html: " $<
887+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
842888 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
843889 -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
844890 -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
@@ -851,9 +897,12 @@ $(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_TR_SMALL)): $(DOC_SRCDIR)/%.ht
851897 -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm -f $@; exit $$X)
852898
853899$(patsubst %.adoc,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_ZH_CN_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.adoc objects/xref_zh_CN.links $(LOC_LANG_MAP)
854- asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
900+ $(ECHO) "Building 'zh_CN' adoc to html: " $<
901+ $(Q)asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \
855902 -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \
856903 -a linkcss \
904+ -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \
905+ -a "source_highlight_dir=$(LOC_HL_DIR)/local" \
857906 $(STYLES_SCRIPTS) \
858907 -a "scriptdir=$(DOC_SRCDIR)/" \
859908 -a "relindir=$(shell dirname $*)" \
0 commit comments