VirtualBox

Changeset 99038 in vbox


Ignore:
Timestamp:
Mar 18, 2023 5:03:58 AM (20 months ago)
Author:
vboxsync
Message:

manual: Got rid of the correct_reference_targets Makefile-file rule, the new tactic is to scan the checked in .dita-files and .xml-files, store the id->filename mappings in file, and apply them as part of the refentry->dita conversion recipe for each individual Docbook-file. Use pattern rules for copying files to the staging area. bugref:10302

Location:
trunk/doc/manual
Files:
2 added
1 deleted
1 edited

Legend:

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

    r99036 r99038  
    672672        $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images
    673673
    674  VBOX_USER_MANUAL_DITA_FILES  := $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita)
    675  VBOX_USER_MANUAL_DITA_IMAGES := $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*)
    676 
    677  VBOX_USER_MANUAL_STAGED_DITA_FILES  := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/,$(notdir $(VBOX_USER_MANUAL_DITA_FILES)))
    678  VBOX_USER_MANUAL_STAGED_DITA_IMAGES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/,$(notdir $(VBOX_USER_MANUAL_DITA_IMAGES)))
    679 
    680 
    681  ## @todo r=bird: This is still incredibly crude.
    682  $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd \
    683  +| $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \
    684  +| $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
    685  +| $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES): \
    686                 $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap \
    687                 $(VBOX_USER_MANUAL_DITA_FILES) \
    688                 $(VBOX_USER_MANUAL_DITA_IMAGES) \
    689                 | \
    690                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/ \
    691                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/ \
    692                 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/
    693         $(call MSG_L1, Staging dita and image files for en_US)
    694         $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap "$(@D)/"
    695         $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_USER_MANUAL_DITA_FILES)                        "$(@D)/topics/"
    696         $(QUIET)$(INSTALL_STAGING) -v -m0644 -- $(VBOX_USER_MANUAL_DITA_IMAGES)                       "$(@D)/topics/images/"
    697         $(QUIET)$(TOUCH) -- "$(@D)/topics/reference.dtd"
     674 VBOX_USER_MANUAL_STAGED_DITA_FILES  := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/, \
     675        $(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita)))
     676 VBOX_USER_MANUAL_STAGED_IMAGE_FILES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/, \
     677        $(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*)))
     678
     679 $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
     680 $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES) \
     681 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap: \
     682                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/% : \
     683                $(VBOX_PATH_MANUAL_SRC)/en_US/dita/% | $$(dir $$@)
     684        $(INSTALL_STAGING) -v -m 0644 -- "$<" "$(@D)/"
     685
     686 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd: | $$(dir $$@)
     687        $(QUIET)$(TOUCH) -- "$@"
    698688
    699689 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml: \
    700                 $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml
    701         $(QUIET)$(MKDIR) -p  $(dir $@)
    702         $(QUIET)$(INSTALL_STAGING) -m0644 -- "$<" "$(@D)/"
     690                $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml | $$(dir $$@)
     691        $(QUIET)$(INSTALL_STAGING) -m 0644 -- "$<" "$(@D)/"
    703692
    704693 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common: \
    705694                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \
    706                 $(VBOX_DITA_PATH) \
    707                 $(VBOX_PATH_MANUAL_OUTBASE)/correct_reference_targets
     695                $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd \
     696                $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
     697                $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES) \
     698                $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES) \
     699                $(VBOX_DITA_PATH)
    708700        $(call MSG_L1, Ran common dita steps)
    709701        $(QUIET)$(TOUCH) -- "$@"
     
    715707 #
    716708 ##########################################################################################
     709
     710 # Generate a ID to FILE mapping database that def_vbox_refentry_to_dita can apply below.
     711 VBOX_USER_MANUAL_ID_MAPPING_FILE := $(VBOX_PATH_MANUAL_OUTBASE)/en_US/id-mapping-file.db
     712 OTHER_CLEAN += $(VBOX_USER_MANUAL_ID_MAPPING_FILE)
     713 $(VBOX_USER_MANUAL_ID_MAPPING_FILE): \
     714                $(VBOX_PATH_MANUAL_SRC)/build_id_to_file_mapping.py \
     715                $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/*.xml $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*.dita) \
     716                | $(dir $@)
     717        $(call MSG_L1, $<)
     718        $(QUIET)$(VBOX_BLD_PYTHON) "$<" --output "$@" \
     719                "$(VBOX_PATH_MANUAL_SRC)/en_US/*.xml" \
     720                "$(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*.dita"
     721
     722 # Accumulated list of conversion output file names used by dita_common above.
    717723 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES := $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita
    718724
     
    733739                $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2)) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2)) \
    734740                $$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl \
     741                $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
     742                $$(VBOX_USER_MANUAL_ID_MAPPING_FILE) \
    735743                $$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml \
    736744                $$(VBOX_XML_CATALOG) \
     
    750758        $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \
    751759                "$$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl" "$$@"
     760        $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py -v \
     761                --mapping-file "$$(VBOX_USER_MANUAL_ID_MAPPING_FILE)" "$$@"
    752762 endef
    753763 $(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
    754764 ,$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount.xml man_VBoxHeadless.xml \
    755765 ,$(evalcall2 def_vbox_refentry_to_dita,$(lang),$(file))))
    756 
    757  # Corrects all reference to include the #id as well as the topic filename.
    758  ## @todo r=bird: This is a totally unmaintainable rule, because it doesn't specify
    759  ## what it modifies as those already have individual rules above and are listed as
    760  ## dependencies (VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES) here.  Is there no
    761  ## way to fix this at conversion time? This is _extremely_ ugly.
    762  $(VBOX_PATH_MANUAL_OUTBASE)/correct_reference_targets: \
    763                 $(VBOX_PATH_MANUAL_SRC)/correct_references.py \
    764                 $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
    765                 $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES)
    766         $(call MSG_L1,correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics)
    767         $(QUIET)$(VBOX_BLD_PYTHON) $(VBOX_PATH_MANUAL_SRC)/correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics
    768         $(QUIET)$(TOUCH) -- "$@"
    769766
    770767
     
    786783 $(VBOX_DITA_PATH):
    787784        $(MKDIR) -p $(VBOX_DITA_PATH)
    788         $(CP) -R -- $(VBOX_DITA_ORIGINAL_PATH)/* $(VBOX_DITA_PATH)/
     785        $(CP) -vR -- "$(VBOX_DITA_ORIGINAL_PATH)/" "$(VBOX_DITA_PATH)/"
    789786
    790787 VBOX_DITA_PATH_LIB ?= $(VBOX_DITA_PATH)/lib
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