VirtualBox

Changeset 99035 in vbox for trunk


Ignore:
Timestamp:
Mar 18, 2023 2:52:03 AM (21 months ago)
Author:
vboxsync
Message:

manual/Makefile.kmk: Missing dita-copying dependencies, cleanups and other fun. bugref:10302

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Makefile.kmk

    r99034 r99035  
    170170 ## @todo r=bird: Explanations for all of this is required!
    171171 .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 \
    173173                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf \
    174174                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
     
    189189
    190190 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
    193194 endif
    194195
     
    653654 #      - create dita/topic folder and copy all user manual dita files under that.
    654655 #  - copy all images under dita/topics/images and UserManual.ditamap under dita folder
    655  #  - copy all man_VBox???.xml docbook files under dita/topic folder.
    656  #  - flatten refsect1/refsect2 hierarchy in man_VBox???.xml docbook files by
     656 #  - copy all man_V*.xml docbook files under dita/topic folder.
     657 #  - flatten refsect1/refsect2 hierarchy in man_V*.xml docbook files by
    657658 #    using refsect2_to_refsect1.py.
    658  #  - convert man_VBox???.xml files into dita files
    659  #  - mark external link in the man_VBox????.dita files
     659 #  - convert man_V*.xml files into dita files
     660 #  - mark external link in the man_V*.dita files
    660661 #  - correct all reference targets by calling correct_references.py.
    661662 #
    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
    675699        $(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.
    678760 $(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)
    682764        $(call MSG_L1,correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics)
    683765        $(QUIET)$(VBOX_BLD_PYTHON) $(VBOX_PATH_MANUAL_SRC)/correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics
    684766        $(QUIET)$(TOUCH) -- "$@"
    685767
    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_targets
    690         $(call MSG_L1, Running common dita steps)
    691         $(QUIET)$(TOUCH) -- "$@"
    692 
    693 
    694  ##########################################################################################
    695  #
    696  #  Docbook to Dita conversion of our refentry files
    697  #
    698  ##########################################################################################
    699  define def_vbox_refentry_to_dita
    700   $$(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  endef
    713  $(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.xml
    724768
    725769 ##########################################################################################
     
    730774 ##########################################################################################
    731775 # 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.
    733784 $(VBOX_DITA_PATH):
    734785        $(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)/
    736787
    737788 VBOX_DITA_PATH_LIB ?= $(VBOX_DITA_PATH)/lib
     
    753804        --
    754805
     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.
    755809 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: \
    758814                $$(VBOX_MANUAL_XML_FILES_COMMON) \
    759815                $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
    760                 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common
     816                $$(VBOX_PATH_MANUAL_OUTBASE)/dita_common
     817        $(QUIET)$(RM) -f -- "$$@"
    761818        $(QUIET)$(call VBOX_DITA_ENV_SETUP) $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar \
    762819                /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
     
    766823                /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf
    767824
    768 
     825  ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf
    769826 endef
    770827 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_pdf,$(lang)))
     
    779836                $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
    780837                $(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) \
    782841                $(VBOX_XML_ENTITIES) | $$(dir $$@)
    783842        $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette