- Timestamp:
- Mar 18, 2023 2:52:03 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/Makefile.kmk
r99034 r99035 170 170 ## @todo r=bird: Explanations for all of this is required! 171 171 .NOTPARALLEL: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qch \ 172 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.qhc \172 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.qhc \ 173 173 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf \ 174 174 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip … … 189 189 190 190 ifdef VBOX_WITH_DOCS_ACCESSIBILITY 191 INSTALLS += VBox-docs-accessibility 192 INSTALLS += VBox-docs-accessibility-html 191 INSTALLS += \ 192 VBox-docs-accessibility 193 VBox-docs-accessibility-html 193 194 endif 194 195 … … 653 654 # - create dita/topic folder and copy all user manual dita files under that. 654 655 # - copy all images under dita/topics/images and UserManual.ditamap under dita folder 655 # - copy all man_V Box???.xml docbook files under dita/topic folder.656 # - flatten refsect1/refsect2 hierarchy in man_V Box???.xml docbook files by656 # - copy all man_V*.xml docbook files under dita/topic folder. 657 # - flatten refsect1/refsect2 hierarchy in man_V*.xml docbook files by 657 658 # using refsect2_to_refsect1.py. 658 # - convert man_V Box???.xml files into dita files659 # - mark external link in the man_V Box????.dita files659 # - convert man_V*.xml files into dita files 660 # - mark external link in the man_V*.dita files 660 661 # - correct all reference targets by calling correct_references.py. 661 662 # 662 ########################################################################################## 663 664 VBOX_USER_MANUAL_DITA_FILES = $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita) 665 VBOX_USER_MANUAL_DITA_IMAGES = $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*) 666 667 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap: 668 $(QUIET)$(MKDIR) -p $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images 669 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap "$(@D)" 670 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_USER_MANUAL_DITA_FILES) "$(@D)/topics" 671 $(QUIET)touch -- "$(@D)/topics/reference.dtd" 672 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_USER_MANUAL_DITA_IMAGES) "$(@D)/topics/images" 673 674 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml: 663 # Note! INSTALL_STAGING is likely to hardlink the files. 664 # 665 ########################################################################################## 666 667 BLDDIRS += \ 668 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita \ 669 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics \ 670 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images 671 672 VBOX_USER_MANUAL_DITA_FILES := $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita) 673 VBOX_USER_MANUAL_DITA_IMAGES := $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*) 674 675 VBOX_USER_MANUAL_STAGED_DITA_FILES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/,$(notdir $(VBOX_USER_MANUAL_DITA_FILES))) 676 VBOX_USER_MANUAL_STAGED_DITA_IMAGES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/,$(notdir $(VBOX_USER_MANUAL_DITA_IMAGES))) 677 678 679 ## @todo r=bird: This is still incredibly crude. 680 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd \ 681 +| $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \ 682 +| $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \ 683 +| $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES): \ 684 $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap \ 685 $(VBOX_USER_MANUAL_DITA_FILES) \ 686 $(VBOX_USER_MANUAL_DITA_IMAGES) \ 687 | \ 688 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/ \ 689 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/ \ 690 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/ 691 $(call MSG_L1, Staging dita and image files for en_US) 692 $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap "$(@D)/" 693 $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_USER_MANUAL_DITA_FILES) "$(@D)/topics/" 694 $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_USER_MANUAL_DITA_IMAGES) "$(@D)/topics/images/" 695 $(QUIET)$(TOUCH) -- "$(@D)/topics/reference.dtd" 696 697 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml: \ 698 $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml 675 699 $(QUIET)$(MKDIR) -p $(dir $@) 676 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_PATH_MANUAL_SRC)/en_US/$(notdir $@) "$(@D)" 677 700 $(QUIET)$(INSTALL_STAGING) -m0644 -- "$<" "$(@D)/" 701 702 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common: \ 703 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \ 704 $(VBOX_DITA_PATH) \ 705 $(VBOX_PATH_MANUAL_OUTBASE)/correct_reference_targets 706 $(call MSG_L1, Ran common dita steps) 707 $(QUIET)$(TOUCH) -- "$@" 708 709 710 ########################################################################################## 711 # 712 # Docbook to Dita conversion of our refentry files 713 # 714 ########################################################################################## 715 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES := $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita 716 717 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita: \ 718 $(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \ 719 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml | $$(dir $$@) 720 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \ 721 --maxdepth 6000 \ 722 --output "$@" \ 723 "$<" \ 724 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml 725 726 define def_vbox_refentry_to_dita 727 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES += $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(basename $(2)).dita 728 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(basename $(2)).dita \ 729 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2): \ 730 $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \ 731 $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2)) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2)) \ 732 $$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl \ 733 $$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml \ 734 $$(VBOX_XML_CATALOG) \ 735 $$(VBOX_XML_CATALOG_DOCBOOK) \ 736 $$(VBOX_XML_CATALOG_MANUAL) \ 737 $$(VBOX_XML_ENTITIES) \ 738 $$(VBOX_VERSION_STAMP) \ 739 | $$$$(dir $$$$@) 740 $$(call MSG_TOOL,xsltproc docbook2dita.xsl,,$$(firstword $$(filter %.xml,$$^)),$$@) 741 $$(QUIET)$$(RM) -f "$$@" 742 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/refsect2_to_refsect1.py \ 743 -i $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2)) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2)) \ 744 -o "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)" 745 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \ 746 "$$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl" \ 747 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)" 748 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \ 749 "$$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl" "$$@" 750 endef 751 $(foreach lang,$(VBOX_MANUAL_LANGUAGES) \ 752 ,$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount.xml man_VBoxHeadless.xml \ 753 ,$(evalcall2 def_vbox_refentry_to_dita,$(lang),$(file)))) 754 755 # Corrects all reference to include the #id as well as the topic filename. 756 ## @todo r=bird: This is a totally unmaintainable rule, because it doesn't specify 757 ## what it modifies as those already have individual rules above and are listed as 758 ## dependencies (VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES) here. Is there no 759 ## way to fix this at conversion time? This is _extremely_ ugly. 678 760 $(VBOX_PATH_MANUAL_OUTBASE)/correct_reference_targets: \ 679 $ $(VBOX_PATH_MANUAL_SRC)/correct_references.py \680 $ $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/\681 $ $(VBOX_REFENTRY_DITA_FILES)761 $(VBOX_PATH_MANUAL_SRC)/correct_references.py \ 762 $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \ 763 $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES) 682 764 $(call MSG_L1,correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics) 683 765 $(QUIET)$(VBOX_BLD_PYTHON) $(VBOX_PATH_MANUAL_SRC)/correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics 684 766 $(QUIET)$(TOUCH) -- "$@" 685 767 686 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common: \687 $$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \688 $$(VBOX_DITA_PATH) \689 $(VBOX_PATH_MANUAL_OUTBASE)/correct_reference_targets690 $(call MSG_L1, Running common dita steps)691 $(QUIET)$(TOUCH) -- "$@"692 693 694 ##########################################################################################695 #696 # Docbook to Dita conversion of our refentry files697 #698 ##########################################################################################699 define def_vbox_refentry_to_dita700 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(addsuffix .dita,$(basename $(2))): \701 $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \702 $(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \703 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml \704 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \705 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)706 707 $$(QUIET)$$(RM) -f "$$@"708 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/refsect2_to_refsect1.py -i $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) -o $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)709 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)710 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)711 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl $$@712 endef713 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount.xml man_VBoxHeadless.xml \714 , $(evalcall2 def_vbox_refentry_to_dita,$(lang),$(file))))715 716 VBOX_REFENTRY_DITA_FILES = $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file, $(basename $(VBOX_MANUAL_XML_REFENTRY_FILES)) \717 man_vboximg-mount man_VBoxHeadless user_isomakercmd-man \718 ,$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/dita/topics/$(file).dita))719 720 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita: \721 $(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \722 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml | $$(dir $$@)723 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $@ $(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml724 768 725 769 ########################################################################################## … … 730 774 ########################################################################################## 731 775 # Copy the dita library under out folder since at each use the library modifies some 732 # run-time configuation files. 776 # run-time configuation files and there seems to be no way to override this. 777 ## @todo r=bird: This is _incredibly_ crude. But then, the tool is the worst with its inane 778 ## desire to modify build.xml, catalog-dita.xml and lib/org.dita.dost.platform/plugin.properties 779 ## with a fresh plugin setup (the differences seems to be down to hashing/map 780 ## ordering difference). Wonder if we can get away with a single copy 781 ## as long as we do the plugin update right after duplicating it here... 782 ## Also, I would _really_ like to symlink/hardlink as much as possible 783 ## of it to save time and storage space. 733 784 $(VBOX_DITA_PATH): 734 785 $(MKDIR) -p $(VBOX_DITA_PATH) 735 cp -R$(VBOX_DITA_ORIGINAL_PATH)/* $(VBOX_DITA_PATH)/786 $(CP) -R -- $(VBOX_DITA_ORIGINAL_PATH)/* $(VBOX_DITA_PATH)/ 736 787 737 788 VBOX_DITA_PATH_LIB ?= $(VBOX_DITA_PATH)/lib … … 753 804 -- 754 805 806 # Note! The /tempdir is deleted, recreated, used and deleted again for each run. So, be careful where you point it. 807 # Note! This crappy utility may fail to find files (or fail to parse the 808 # command line) and still return a successfully (0) exit code. 755 809 define def_ditamap_to_pdf 756 ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf 757 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf: \ 810 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf \ 811 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log \ 812 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.list \ 813 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.xml.properties: \ 758 814 $$(VBOX_MANUAL_XML_FILES_COMMON) \ 759 815 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \ 760 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common 816 $$(VBOX_PATH_MANUAL_OUTBASE)/dita_common 817 $(QUIET)$(RM) -f -- "$$@" 761 818 $(QUIET)$(call VBOX_DITA_ENV_SETUP) $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar \ 762 819 /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \ … … 766 823 /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf 767 824 768 825 ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf 769 826 endef 770 827 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_pdf,$(lang))) … … 779 836 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \ 780 837 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \ 781 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \ 838 $(VBOX_XML_CATALOG) \ 839 $(VBOX_XML_CATALOG_DOCBOOK) \ 840 $(VBOX_XML_CATALOG_MANUAL) \ 782 841 $(VBOX_XML_ENTITIES) | $$(dir $$@) 783 842 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
Note:
See TracChangeset
for help on using the changeset viewer.