.PHONY: docs docsclean checkref checkref_en checkref_es checkref_fr .PHONY: pdfdocs htmldocs install-doc install-doc-pdf install-doc-html DOC_DIR=../docs DOC_SRCDIR=../docs/src # oh man.. HL_DIR=/usr/share/source-highlight LANG_MAP=$(HL_DIR)/lang.map LOC_HL_DIR=../docs/src/source-highlight LOC_LANG_MAP=$(LOC_HL_DIR)/local/lang.map MAN_SRCS := $(sort \ $(patsubst %.in,%,$(wildcard $(DOC_DIR)/man/man1/*.1 $(DOC_DIR)/man/man1/*.1.in)) \ $(filter-out $(DOC_DIR)/man/man3/skeleton%, $(wildcard $(DOC_DIR)/man/man3/*.3rtapi $(DOC_DIR)/man/man3/*.3hal)) \ $(filter-out $(DOC_DIR)/man/man9/skeleton%, $(wildcard $(DOC_DIR)/man/man9/*.9)) \ $(COMP_MANPAGES) $(COMP_DRIVER_MANPAGES)) ifneq ($(MANDB),) default: $(DOC_DIR)/man/index.db $(DOC_DIR)/man/index.db: $(MAN_SRCS) @echo "Updating 'whatis' database" $(Q)$(MANDB) $(DOC_DIR)/man endif ifeq ($(BUILD_DOCS),yes) DOC_SRCS_EN := \ code/Code_Notes.txt \ code/Style_Guide.txt \ code/NML_Messages.txt \ code/Contributing-to-LinuxCNC.txt \ common/emc-history.txt \ common/Getting_LinuxCNC.txt \ common/Glossary.txt \ common/GPLD_Copyright.txt \ common/Integrator_Concepts.txt \ common/Linux_FAQ.txt \ common/overleaf.txt \ common/python-interface.txt \ common/starting-emc.txt \ common/Stepper_Diagnostics.txt \ common/System_Requirements.txt \ common/Updating_LinuxCNC.txt \ common/User_Concepts.txt \ common/userforeword.txt \ common/user_intro.txt \ config/copy_and_run.txt \ config/emc2hal.txt \ config/ini_config.txt \ config/ini_homing.txt \ config/lathe_config.txt \ config/pncconf.txt \ config/stepconf.txt \ config/stepper.txt \ drivers/AX5214H.txt \ drivers/VFS11.txt \ drivers/GM.txt \ drivers/GS2.txt \ drivers/hostmot2.txt \ drivers/motenc.txt \ drivers/opto22.txt \ drivers/pico_ppmc.txt \ drivers/pluto_p.txt \ drivers/servo_to_go.txt \ drivers/shuttlexpress.txt \ examples/gcode.txt \ examples/gs2_example.txt \ examples/mpg.txt \ examples/pci_parallel_port.txt \ examples/spindle.txt \ gcode/coordinates.txt \ gcode/gcode.txt \ gcode/machining_center.txt \ gcode/m-code.txt \ gcode/o-code.txt \ gcode/other-code.txt \ gcode/overview.txt \ gcode/rs274ngc.txt \ gcode/tool_compensation.txt \ gui/selector.txt \ gui/axis.txt \ gui/gladevcp.txt \ gui/halui.txt \ gui/image-to-gcode.txt \ gui/keystick.txt \ gui/mini.txt \ gui/ngcgui.txt \ gui/tklinuxcnc.txt \ gui/tooledit.txt \ gui/touchy.txt \ hal/basic_hal.txt \ hal/canonical-devices.txt \ hal/comp.txt \ hal/components.txt \ hal/general_ref.txt \ hal/hal-examples.txt \ hal/halmodule.txt \ hal/halshow.txt \ hal/haltcl.txt \ hal/halui_examples.txt \ hal/intro.txt \ hal/parallel_port.txt \ hal/pyvcp.txt \ hal/pyvcp_examples.txt \ hal/rtcomps.txt \ hal/tools.txt \ hal/tutorial.txt \ install/Latency_Test.txt \ ladder/classic_ladder.txt \ ladder/ladder_examples.txt \ ladder/ladder_intro.txt \ lathe/lathe-user.txt \ motion/kinematics.txt \ motion/pid_theory.txt \ motion/tweaking_steppers.txt \ quickstart/stepper_quickstart.txt \ remap/structure.txt \ Master_Getting_Started.txt \ Master_User.txt \ Master_HAL.txt \ Master_Integrator.txt \ Master_Developer.txt DOC_SRCS_FR := \ common/Getting_linuxcnc_fr.txt \ common/Glossary_fr.txt \ common/GPLD_Copyright_fr.txt \ common/Integrator_Concepts_fr.txt \ common/Linux_FAQ_fr.txt \ common/outdated-notice_fr.txt \ common/overleaf_fr.txt \ common/Stepper_Diagnostics_fr.txt \ common/System_Requirements_fr.txt \ common/Updating_linuxcnc_fr.txt \ common/User_Concepts_fr.txt \ common/userforeword_fr.txt \ common/user_intro_fr.txt \ config/linuxcnc2hal_fr.txt \ config/ini_config_fr.txt \ config/ini_homing_fr.txt \ config/lathe_config_fr.txt \ config/pncconf_fr.txt \ config/stepconf_fr.txt \ config/stepper_fr.txt \ drivers/AX5214H_fr.txt \ drivers/GS2_fr.txt \ drivers/hostmot2_fr.txt \ drivers/motenc_fr.txt \ drivers/opto22_fr.txt \ drivers/pico_ppmc_fr.txt \ drivers/pluto_p_fr.txt \ drivers/servo_to_go_fr.txt \ examples/gcode_fr.txt \ examples/gs2_example_fr.txt \ examples/misc_fr.txt \ examples/mpg_fr.txt \ examples/pci_parallel_port_fr.txt \ examples/spindle_fr.txt \ gcode/coordinates_fr.txt \ gcode/gcode_fr.txt \ gcode/machining_center_fr.txt \ gcode/m-code_fr.txt \ gcode/o-code_fr.txt \ gcode/other-code_fr.txt \ gcode/overview_fr.txt \ gcode/rs274ngc_fr.txt \ gcode/tool_compensation_fr.txt \ gui/axis_fr.txt \ gui/gladevcp_fr.txt \ gui/image-to-gcode_fr.txt \ gui/keystick_fr.txt \ gui/mini_fr.txt \ gui/ngcgui_fr.txt \ gui/tklinuxcnc_fr.txt \ gui/tooledit_fr.txt\ gui/touchy_fr.txt \ hal/basic_hal_fr.txt \ hal/comp_fr.txt \ hal/components_fr.txt \ hal/general_ref_fr.txt \ hal/hal-examples_fr.txt \ hal/halmodule_fr.txt \ hal/halshow_fr.txt \ hal/haltcl_fr.txt \ hal/halui_fr.txt \ hal/intro_fr.txt \ hal/parallel_port_fr.txt \ hal/pyvcp_fr.txt \ hal/pyvcp_examples_fr.txt \ hal/rtcomps_fr.txt \ hal/tutorial_fr.txt \ install/Latency_Test_fr.txt \ ladder/classic_ladder_fr.txt \ ladder/ladder_examples_fr.txt \ ladder/ladder_intro_fr.txt \ lathe/lathe-user_fr.txt \ motion/kinematics_fr.txt \ motion/pid_theory_fr.txt \ motion/tweaking_steppers_fr.txt \ quickstart/stepper_quickstart_fr.txt \ Master_Getting_Started_fr.txt \ Master_User_fr.txt \ Master_HAL_fr.txt \ Master_Integrator_fr.txt \ DOC_SRCS_ES := \ common/Getting_EMC_es.txt \ common/Glossary_es.txt \ common/Integrator_Concepts_es.txt \ common/Linux_FAQ_es.txt \ common/starting-emc_es.txt \ common/Stepper_Diagnostics_es.txt \ common/System_Requirements_es.txt \ common/translator-needed_es.txt \ common/Updating_EMC_es.txt \ common/User_Concepts_es.txt \ common/userforeword_es.txt \ common/user_intro_es.txt \ config/copy_and_run_es.txt \ config/emc2hal_es.txt \ config/ini_config_es.txt \ config/ini_homing_es.txt \ config/lathe_config_es.txt \ config/pncconf_es.txt \ config/stepconf_es.txt \ config/stepper_es.txt \ drivers/AX5214H_es.txt \ drivers/GS2_es.txt \ drivers/hostmot2_es.txt \ drivers/motenc_es.txt \ drivers/opto22_es.txt \ drivers/pico_ppmc_es.txt \ drivers/pluto_p_es.txt \ drivers/servo_to_go_es.txt \ drivers/shuttlexpress_es.txt \ examples/gcode_es.txt \ examples/gs2_example_es.txt \ examples/mpg_es.txt \ examples/pci_parallel_port_es.txt \ examples/spindle_es.txt \ gcode/coordinates_es.txt \ gcode/gcode_es.txt \ gcode/machining_center_es.txt \ gcode/m-code_es.txt \ gcode/o-code_es.txt \ gcode/other-code_es.txt \ gcode/overview_es.txt \ gcode/rs274ngc_es.txt \ gcode/tool_compensation_es.txt \ gui/axis_es.txt \ gui/gladevcp_es.txt \ gui/halui_es.txt \ gui/image-to-gcode_es.txt \ gui/keystick_es.txt \ gui/mini_es.txt \ gui/ngcgui_es.txt \ gui/tklinuxcnc_es.txt \ gui/touchy_es.txt \ hal/basic_hal_es.txt \ hal/canonical-devices_es.txt \ hal/comp_es.txt \ hal/components_es.txt \ hal/general_ref_es.txt \ hal/hal-examples_es.txt \ hal/halmodule_es.txt \ hal/halshow_es.txt \ hal/haltcl_es.txt \ hal/halui_examples_es.txt \ hal/intro_es.txt \ hal/parallel_port_es.txt \ hal/pyvcp_es.txt \ hal/pyvcp_examples_es.txt \ hal/rtcomps_es.txt \ hal/tools_es.txt \ hal/tutorial_es.txt \ install/Latency_Test_es.txt \ ladder/classic_ladder_es.txt \ ladder/ladder_examples_es.txt \ ladder/ladder_intro_es.txt \ lathe/lathe-user_es.txt \ motion/kinematics_es.txt \ motion/pid_theory_es.txt \ motion/tweaking_steppers_es.txt \ quickstart/stepper_quickstart_es.txt \ Master_Getting_Started_es.txt \ Master_User_es.txt \ Master_HAL_es.txt \ Master_Integrator_es.txt \ DOC_SRCS = $(DOC_SRCS_EN) $(DOC_SRCS_FR) $(DOC_SRCS_ES) DOC_SRCS_TXT := $(patsubst %.txt, %.txt, $(DOC_SRCS)) DOC_SRCS_ES_SMALL := $(filter-out Master_%,$(DOC_SRCS_ES)) DOC_SRCS_FR_SMALL := $(filter-out Master_%,$(DOC_SRCS_FR)) DOC_SRCS_EN_SMALL := $(filter-out Master_%,$(DOC_SRCS_EN)) DOC_SRCS_HTML := $(patsubst %.txt, %.html, $(filter-out Master_%, $(DOC_SRCS))) DOC_TARGETS_HTML := $(addprefix $(DOC_DIR)/html/,$(DOC_SRCS_HTML)) #$(subst /,_,$(DOC_SRCS_HTML))) DOC_TARGETS_XML := $(patsubst $(DOC_DIR)/html/%.html, objects/%.xml, $(DOC_TARGETS_HTML)) DOC_TARGETS_XML_ES := $(filter %_es.xml, $(DOC_TARGETS_XML)) DOC_TARGETS_XML_FR := $(filter %_fr.xml, $(DOC_TARGETS_XML)) DOC_TARGETS_XML_EN := $(filter-out $(DOC_TARGETS_XML_ES), $(filter-out $(DOC_TARGETS_XML_FR), $(DOC_TARGETS_XML)) ) DOC_TARGETS_HTML_ES := $(filter %_es.html, $(DOC_TARGETS_HTML)) DOC_TARGETS_HTML_FR := $(filter %_fr.html, $(DOC_TARGETS_HTML)) DOC_TARGETS_HTML_EN := $(filter-out $(DOC_TARGETS_HTML_ES), $(filter-out $(DOC_TARGETS_HTML_FR), $(DOC_TARGETS_HTML)) ) MAN_HTML_TARGETS := $(patsubst $(DOC_DIR)/man/%, $(DOC_DIR)/html/man/%.html, $(MAN_SRCS)) PDF_TARGETS_EN := $(addprefix $(DOC_DIR)/, \ LinuxCNC_Getting_Started.pdf \ LinuxCNC_User_Manual.pdf \ LinuxCNC_HAL_Manual.pdf \ LinuxCNC_Integrator_Manual.pdf \ LinuxCNC_Developer_Manual.pdf \ LinuxCNC_Manual_Pages.pdf \ ) PDF_TARGETS_FR := $(addprefix $(DOC_DIR)/, \ LinuxCNC_Getting_Started_fr.pdf \ LinuxCNC_User_Manual_fr.pdf \ LinuxCNC_HAL_Manual_fr.pdf \ LinuxCNC_Integrator_Manual_fr.pdf \ ) PDF_TARGETS_ES := $(addprefix $(DOC_DIR)/, \ LinuxCNC_Getting_Started_es.pdf \ LinuxCNC_User_Manual_es.pdf \ LinuxCNC_HAL_Manual_es.pdf \ LinuxCNC_Integrator_Manual_es.pdf \ ) PDF_TARGETS := $(PDF_TARGETS_EN) $(PDF_TARGETS_FR) $(PDF_TARGETS_ES) # It's better to keep the above on separate lines for troubleshooting by swapping HTML_TARGETS := \ $(DOC_TARGETS_HTML) \ $(MAN_HTML_TARGETS) \ $(DOC_DIR)/html/index.html \ $(DOC_DIR)/html/index_es.html \ $(DOC_DIR)/html/index_fr.html \ A2X = a2x --xsltproc-opts "--stringparam toc.section.depth 3 \ --stringparam toc.max.depth 2 \ --stringparam generate.section.toc.level 2 \ --stringparam generate.toc 'book toc,title chapter toc'" \ -a "scriptdir=$(DOC_SRCDIR)/" \ --asciidoc-opts "-f $(DOC_SRCDIR)/docbook.conf -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf" \ --dblatex-opts "-P doc.publisher.show=0 -P latex.output.revhistory=0 -s $(DOC_SRCDIR)/emc2.sty \ -P latex.hyperparam=colorlinks,linkcolor=blue,filecolor=blue,urlcolor=blue,citecolor=blue \ $(A2X_LATEX_ENCODING)" ifeq ($(TRIVIAL_BUILD),no) -include $(patsubst %.txt, depends/%.d, $(DOC_SRCS_TXT)) Makefile: $(patsubst %.txt, depends/%.d, $(DOC_SRCS_TXT)) endif docs: ../docs/man/man1/linuxcnc.1 ../docs/man/man1/linuxcnc.1: ../docs/src/man/man1/linuxcnc.1.in config.status ./config.status --file=$@:$< ifeq ($(BUILD_DOCS_PDF),yes) docs: pdfdocs install-doc: install-doc-pdf endif ifeq ($(BUILD_DOCS_HTML),yes) docs: htmldocs install-doc: install-doc-html endif pdfdocs: $(PDF_TARGETS) htmldocs: .htmldoc-stamp checkref .htmldoc-stamp: copy_asciidoc_files $(HTML_TARGETS) .html-images-stamp $(MAN_HTML_TARGETS) touch $@ .PHONY: copy_asciidoc_files copy_asciidoc_files: cp -f /etc/asciidoc/stylesheets/*.css $(DOC_DIR)/html cp -f /etc/asciidoc/javascripts/*.js $(DOC_DIR)/html checkref: checkref_en checkref_fr checkref_es checkref_en: $(DOC_TARGETS_HTML_EN) .htmldoc-stamp @$(DOC_SRCDIR)/checkref --warn-on-failure English $^ checkref_fr: $(DOC_TARGETS_HTML_FR) .htmldoc-stamp @$(DOC_SRCDIR)/checkref French $^ # the spanish docs are full of broken links, only warn on failure checkref_es: $(DOC_TARGETS_HTML_ES) .htmldoc-stamp @$(DOC_SRCDIR)/checkref --warn-on-failure Spanish $^ MAN_SRCS_NOSO := $(patsubst $(DOC_DIR)/man/%,%, \ $(shell grep -L '^\.so ' $(sort $(MAN_SRCS)))) PDF_MAN_ORDER := man1/linuxcnc.1 $(filter-out %/linuxcnc.1, $(filter man1/%, $(MAN_SRCS_NOSO))) \ man3/intro.3hal $(filter-out %/undocumented.3hal %/intro.3hal, $(filter man3/%.3hal, $(MAN_SRCS_NOSO))) \ man3/undocumented.3hal man3/intro.3rtapi $(filter-out %/undocumented.3rtapi %/intro.3rtapi, $(filter man3/%.3rtapi, $(MAN_SRCS_NOSO))) \ man3/undocumented.3rtapi $(filter man9/%, $(MAN_SRCS_NOSO)) $(DOC_DIR)/LinuxCNC_Manual_Pages.pdf: $(MAN_SRCS) objects/var-PDF_MAN_ORDER @echo Formatting manual pages as PDF (cd $(DOC_DIR)/man; groff -t -rC1 -rD1 -Tps -man $(PDF_MAN_ORDER)) \ | ps2pdf - $@ $(DOC_DIR)/LinuxCNC_Getting_Started.pdf: $(DOC_SRCDIR)/Master_Getting_Started.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Getting_Started_es.pdf: $(DOC_SRCDIR)/Master_Getting_Started_es.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Getting_Started_fr.pdf: $(DOC_SRCDIR)/Master_Getting_Started_fr.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_User_Manual.pdf: $(DOC_SRCDIR)/Master_User.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_User_Manual_es.pdf: $(DOC_SRCDIR)/Master_User_es.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_User_Manual_fr.pdf: $(DOC_SRCDIR)/Master_User_fr.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_HAL_Manual.pdf: $(DOC_SRCDIR)/Master_HAL.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_HAL_Manual_es.pdf: $(DOC_SRCDIR)/Master_HAL_es.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_HAL_Manual_fr.pdf: $(DOC_SRCDIR)/Master_HAL_fr.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Integrator_Manual.pdf: $(DOC_SRCDIR)/Master_Integrator.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Integrator_Manual_es.pdf: $(DOC_SRCDIR)/Master_Integrator_es.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Integrator_Manual_fr.pdf: $(DOC_SRCDIR)/Master_Integrator_fr.pdf @ln -f $< $@ $(DOC_DIR)/LinuxCNC_Developer_Manual.pdf: $(DOC_SRCDIR)/Master_Developer.pdf @ln -f $< $@ $(DOC_DIR)/html/man/%.html: $(DOC_DIR)/man/% @echo Formatting $(notdir $<) as HTML @mkdir -p $(dir $@) @(cd $(DOC_DIR)/man; groff -Thtml -man $(patsubst $(DOC_DIR)/man/%,%,$<)) > $@ ST := style=\" \ list-style-type: none; \ -moz-column-width: 25ex; \ -moz-column-gap: 4ex; \ -webkit-column-width: 25ex; \ -webkit-column-gap: 4ex; \ column-width: 25ex; \ column-gap: 4ex; \ \" objects/index.incl: objects/var-MAN_HTML_TARGETS $(DOC_SRCDIR)/Submakefile echo "
  • Commands and userspace components
    " >> $@.tmp echo "
  • Realtime components and kernel modules
    " >> $@.tmp echo "
  • HAL API calls
    " >> $@.tmp echo "
  • RTAPI calls
    " >> $@.tmp mv -f $@.tmp $@ $(DOC_DIR)/html/index_%.html: $(DOC_SRCDIR)/index_%.tmpl ../VERSION $(DOC_SRCDIR)/index.foot cat $(filter-out ../VERSION, $^) | \ sed "s/@VERSION@/`cat ../VERSION`/" > $@ $(DOC_DIR)/html/index.html: $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot ../VERSION $(DOC_SRCDIR)/Submakefile (cat $(DOC_SRCDIR)/index.tmpl objects/index.incl $(DOC_SRCDIR)/index.foot) | sed "s/@VERSION@/`cat ../VERSION`/" > $@ $(DOC_SRCDIR)/%.pdf: $(DOC_SRCDIR)/%.txt $(ECHO) Building $@ @rm -f $@ $(A2X) -L -d book -vf pdf $< || (X=$$?; rm $@; exit $$X) @test -f $@ depends/%.d: $(DOC_SRCDIR)/%.txt $(DOC_SRCDIR)/asciideps $(ECHO) Depending $< @mkdir -p $(dir $@) $(Q)$(DOC_SRCDIR)/asciideps $< > $@.tmp @mv $@.tmp $@ objects/xref_es.xml: $(DOC_TARGETS_XML_ES) $(DOC_SRCDIR)/xref.py (cd objects; ../../docs/src/xref.py $(filter %.xml, $(patsubst objects/%,%,$^))) > $@ objects/xref_fr.xml: $(DOC_TARGETS_XML_FR) $(DOC_SRCDIR)/xref.py (cd objects; ../../docs/src/xref.py $(filter %.xml, $(patsubst objects/%,%,$^))) > $@ objects/xref.xml: $(DOC_TARGETS_XML_EN) $(DOC_SRCDIR)/xref.py (cd objects; ../../docs/src/xref.py $(filter %.xml, $(patsubst objects/%,%,$^))) > $@ objects/%.links-stamp: $(DOC_SRCDIR)/%.txt @mkdir -p `dirname $@` asciidoc -f $(DOC_SRCDIR)/attribute-colon.conf -a "scriptdir=$(DOC_SRCDIR)/" -d book -o- -b docbook $< | xsltproc $(DOC_SRCDIR)/links.xslt - > $@.tmp || (X=$$?; rm $@; exit $$X) sh move-if-change $@.tmp $(patsubst %-stamp,%,$@) touch $@ objects/%.links: objects/%.links-stamp @: # Secondary is not working here. # See http://www.gnu.org/software/make/manual/make.html#Chained-Rules .PRECIOUS: objects/%.links-stamp objects/xref_en.links: $(patsubst %.txt,objects/%.links,$(DOC_SRCS_EN_SMALL)) $(PYTHON) $(DOC_SRCDIR)/links_db_gen.py objects/ $^ > $@ objects/xref_es.links: $(patsubst %.txt,objects/%.links,$(DOC_SRCS_ES_SMALL)) $(PYTHON) $(DOC_SRCDIR)/links_db_gen.py objects/ $^ > $@ objects/xref_fr.links: $(patsubst %.txt,objects/%.links,$(DOC_SRCS_FR_SMALL)) $(PYTHON) $(DOC_SRCDIR)/links_db_gen.py objects/ $^ > $@ $(DOC_TARGETS_HTML): $(DOC_DIR)/html/%.html: $(DOC_SRCDIR)/%.html @d=`dirname $*`; \ mkdir -p $(shell dirname $@) @cp $< $@ .html-images-stamp: $(DOC_TARGETS_HTML) for HTML_FILE in $^; do \ HTML_DIR=$$(basename $$(dirname $$HTML_FILE)); \ for IMAGE_FILE in $$(xsltproc --novalid --nonet $(DOC_SRCDIR)/html-images.xslt $$HTML_FILE); do \ IMAGE_DIR=$$(dirname $$IMAGE_FILE); \ mkdir -p $(DOC_DIR)/html/$$HTML_DIR/$$IMAGE_DIR; \ cp -f $(DOC_SRCDIR)/$$HTML_DIR/$$IMAGE_FILE $(DOC_DIR)/html/$$HTML_DIR/$$IMAGE_FILE; \ done; \ mkdir -p objects/image-cache; \ HTML_LATEX_CACHE=objects/image-cache $(DOC_SRCDIR)/html-latex-images $$HTML_FILE || (X=$$?; rm $$HTML_FILE; exit $$X); \ done touch $@ # rebuild source-highlight/local/lang.map if needed - note this will cause a major rebuild # unsure how to do this as Submakefile -mah $(LOC_LANG_MAP): $(wildcard $(LOC_HL_DIR)/*.lang) $(LANG_MAP) (cd $(LOC_HL_DIR); make all) # Define a target-specific variable called STYLES_SCRIPTS_DIR, which has # the relative path from this html target to the root of the generated # document tree (docs/html in the git repo). This is where the CSS files # and javascript files will be installed. $(DOC_SRCDIR)/%.html: STYLES_SCRIPTS_DIR=$(shell for i in $(shell dirname $* | tr '/' '\n' ); do echo -n "../"; done; echo) $(patsubst %.txt,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_EN_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.txt objects/xref_en.links $(LOC_LANG_MAP) asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \ -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \ -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \ -a "source_highlight_dir=$(LOC_HL_DIR)/local" \ -a linkcss \ -a "scriptsdir=$(STYLES_SCRIPTS_DIR)" \ -a "stylesdir=$(STYLES_SCRIPTS_DIR)" \ -a "scriptdir=$(DOC_SRCDIR)/" \ -a "relindir=$(shell dirname $*)" \ -a "linksfile=objects/xref_en.links" \ -a stylesheet=linuxcnc.css \ -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X) $(patsubst %.txt,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_FR_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.txt objects/xref_fr.links $(LOC_LANG_MAP) asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \ -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \ -f $(LOC_HL_DIR)/emc-langs-source-highlight.conf \ -a "source_highlight_dir=$(LOC_HL_DIR)/local" \ -a linkcss \ -a "scriptsdir=$(STYLES_SCRIPTS_DIR)" \ -a "stylesdir=$(STYLES_SCRIPTS_DIR)" \ -a "scriptdir=$(DOC_SRCDIR)/" \ -a "relindir=$(shell dirname $*)" \ -a "linksfile=objects/xref_fr.links" \ -a stylesheet=linuxcnc.css \ -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X) $(patsubst %.txt,$(DOC_SRCDIR)/%.html,$(DOC_SRCS_ES_SMALL)): $(DOC_SRCDIR)/%.html: $(DOC_SRCDIR)/%.txt objects/xref_es.links $(LOC_LANG_MAP) asciidoc -f $(DOC_SRCDIR)/xhtml11.conf \ -f $(DOC_SRCDIR)/asciidoc-dont-replace-arrows.conf \ -a linkcss \ -a "scriptsdir=$(STYLES_SCRIPTS_DIR)" \ -a "stylesdir=$(STYLES_SCRIPTS_DIR)" \ -a "scriptdir=$(DOC_SRCDIR)/" \ -a "relindir=$(shell dirname $*)" \ -a "linksfile=objects/xref_es.links" \ -a stylesheet=linuxcnc.css \ -d book -a toc -a numbered -b xhtml11 $< || (X=$$?; rm $@; exit $$X) default: docs $(DOC_DIR)/html/xref_fr.html: objects/xref_fr.xml $(DOC_SRCDIR)/xref.xsl $(DOC_SRCDIR)/docs.xml $(DOC_SRCDIR)/terms.xml $(ECHO) Converting $< to HTML @xsltproc --stringparam docname "xref_fr" --stringparam language french --path objects -o $@ $(DOC_SRCDIR)/xref.xsl $< $(DOC_DIR)/html/xref_es.html: objects/xref_es.xml $(DOC_SRCDIR)/xref.xsl $(DOC_SRCDIR)/docs.xml $(DOC_SRCDIR)/terms.xml $(ECHO) Converting $< to HTML @xsltproc --stringparam docname "xref_es" --stringparam language spanish --path objects -o $@ $(DOC_SRCDIR)/xref.xsl $< default: docs install-doc-pdf: $(DIR) $(DESTDIR)$(docsdir) $(FILE) $(PDF_TARGETS) $(DESTDIR)$(docsdir) install-doc-html: $(DIR) $(DESTDIR)$(docsdir) cp -a $(DOC_DIR)/html $(DESTDIR)$(docsdir) install-kernel-indep: install-doc else docs: $(error Cannot build documents, missing AsciiDoc or some other required program, or explicitly disabled in configure) endif docclean: -rm -f $(DOC_DIR)/LinuxCNC_Getting_Started.pdf -rm -f $(DOC_DIR)/LinuxCNC_Getting_Started_es.pdf -rm -f $(DOC_DIR)/LinuxCNC_Getting_Started_fr.pdf -rm -f $(DOC_DIR)/LinuxCNC_User_Manual.pdf -rm -f $(DOC_DIR)/LinuxCNC_User_Manual_es.pdf -rm -f $(DOC_DIR)/LinuxCNC_User_Manual_fr.pdf -rm -f $(DOC_DIR)/LinuxCNC_HAL_Manual.pdf -rm -f $(DOC_DIR)/LinuxCNC_HAL_Manual_es.pdf -rm -f $(DOC_DIR)/LinuxCNC_HAL_Manual_fr.pdf -rm -f $(DOC_DIR)/LinuxCNC_Integrator_Manual.pdf -rm -f $(DOC_DIR)/LinuxCNC_Integrator_Manual_es.pdf -rm -f $(DOC_DIR)/LinuxCNC_Integrator_Manual_fr.pdf -rm -f $(DOC_DIR)/LinuxCNC_Developer_Manual.pdf -rm -f $(DOC_DIR)/LinuxCNC_Manual_Pages.pdf -rm -f $(DOC_SRCDIR)/*.d -rm -f $(DOC_SRCDIR)/*.pdf -rm -f $(DOC_SRCDIR)/*/*.html -rm -f $(DOC_DIR)/html/*.png -rm -f $(DOC_DIR)/html/code/*.* -rm -f $(DOC_DIR)/html/common/images/*.* -rm -f $(DOC_DIR)/html/config/images/*.* -rm -f $(DOC_DIR)/html/drivers/images/*.* -rm -f $(DOC_DIR)/html/examples/*.* -rm -f $(DOC_DIR)/html/gcode/images/*.* -rm -f $(DOC_DIR)/html/gui/images/*.* -rm -f $(DOC_DIR)/html/hal/images/*.* -rm -f $(DOC_DIR)/html/install/images/*.* -rm -f $(DOC_DIR)/html/ladder/images/*.* -rm -f $(DOC_DIR)/html/lathe/images/*.* -rm -f $(DOC_DIR)/html/motion/*.* -rm -f $(DOC_DIR)/html/quickstart/*.* -rm -f $(DOC_DIR)/html/man/man1/*.* -rm -f $(DOC_DIR)/html/man/man3/*.* -rm -f $(DOC_DIR)/html/man/man9/*.* -rm -f $(DOC_TARGETS_HTML) $(DOC_DIR)/html/xref*.html $(DOC_DIR)/html/index*.html $(DOC_DIR)/*.png $(DOC_DIR)/man/*.png -rm -f .htmldoc-stamp -rm -f .html-images-stamp # unsure how to do this as Submakefile: -mah -(cd $(LOC_HL_DIR); make clean) ifeq ($(BUILD_DOCS),yes) MAN_DEPS := $(patsubst $(DOC_DIR)/man/%, depends/%.d, $(MAN_SRCS)) $(MAN_DEPS): depends/%.d: $(DOC_DIR)/man/% @echo Depending $(notdir $<) @mkdir -p $(dir $@) $(Q)echo -n "$(DOC_DIR)/html/man/$*.html: $<" > $@.tmp $(Q)grep '^\.so ' $< | awk '{printf " \\\n\t$(DOC_DIR)/man/%s", $$2}' >> $@.tmp $(Q)echo >> $@.tmp $(Q)mv -f $@.tmp $@ ifeq ($(TRIVIAL_BUILD),no) -include $(MAN_DEPS) Makefile: $(MAN_DEPS) endif %.png:; $(error Required image file $@ does not exist) %.jpg:; $(error Required image file $@ does not exist) %.svg:; $(error Required image file $@ does not exist) %.dxf:; $(error Required image file $@ does not exist) %.ps:; $(error Required image file $@ does not exist) %.eps:; $(error Required image file $@ does not exist) endif