[2478] | 1 | # $Id: Makefile.kmk 103621 2024-02-29 20:52:55Z vboxsync $
|
---|
| 2 | ## @file
|
---|
[93814] | 3 | # Sub-Makefile for VBoxManage (the CLI frontend).
|
---|
[1] | 4 | #
|
---|
| 5 |
|
---|
| 6 | #
|
---|
[98103] | 7 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[5999] | 8 | #
|
---|
[96407] | 9 | # This file is part of VirtualBox base platform packages, as
|
---|
| 10 | # available from https://www.virtualbox.org.
|
---|
[5999] | 11 | #
|
---|
[96407] | 12 | # This program is free software; you can redistribute it and/or
|
---|
| 13 | # modify it under the terms of the GNU General Public License
|
---|
| 14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
| 15 | # License.
|
---|
| 16 | #
|
---|
| 17 | # This program is distributed in the hope that it will be useful, but
|
---|
| 18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 20 | # General Public License for more details.
|
---|
| 21 | #
|
---|
| 22 | # You should have received a copy of the GNU General Public License
|
---|
| 23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 24 | #
|
---|
| 25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
| 26 | #
|
---|
[1] | 27 |
|
---|
[10058] | 28 | SUB_DEPTH = ../../../..
|
---|
[8760] | 29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
[1] | 30 |
|
---|
[68860] | 31 | include $(PATH_ROOT)/doc/manual/Config.kmk
|
---|
| 32 |
|
---|
| 33 |
|
---|
[94643] | 34 | ## @todo r=andy Sort this stuff alphabetically!
|
---|
[56465] | 35 | VBOX_COMMON_VBOXMANAGE_DEFS = \
|
---|
[98412] | 36 | $(if $(VBOX_WITH_AHCI), VBOX_WITH_AHCI) \
|
---|
| 37 | $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST) \
|
---|
| 38 | $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000) \
|
---|
| 39 | $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL) \
|
---|
| 40 | $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS) \
|
---|
| 41 | $(if $(VBOX_WITH_HEADLESS), VBOX_WITH_HEADLESS) \
|
---|
| 42 | $(if $(VBOX_WITH_HGCM), VBOX_WITH_HGCM) \
|
---|
| 43 | $(if $(VBOX_WITH_HOSTNETIF_API), VBOX_WITH_HOSTNETIF_API) \
|
---|
| 44 | $(if $(VBOX_WITH_NETFLT), VBOX_WITH_NETFLT) \
|
---|
| 45 | $(if-expr defined(VBOX_WITH_VMNET) && "$(KBUILD_TARGET)"=="darwin",VBOX_WITH_VMNET,) \
|
---|
| 46 | $(if $(VBOX_WITH_CLOUD_NET), VBOX_WITH_CLOUD_NET) \
|
---|
[62585] | 47 | $(if $(VBOX_WITH_AUDIO_OSS), VBOX_WITH_AUDIO_OSS) \
|
---|
| 48 | $(if $(VBOX_WITH_AUDIO_ALSA), VBOX_WITH_AUDIO_ALSA) \
|
---|
[98412] | 49 | $(if $(VBOX_WITH_AUDIO_PULSE),VBOX_WITH_AUDIO_PULSE) \
|
---|
| 50 | $(if $(VBOX_WITH_SCSI), VBOX_WITH_SCSI) \
|
---|
| 51 | $(if $(VBOX_WITH_VBOXSDL), VBOX_WITH_VBOXSDL) \
|
---|
| 52 | $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL) \
|
---|
| 53 | $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO) \
|
---|
[84383] | 54 | $(if $(VBOX_WITH_VIRTIO_NET_1_0),VBOX_WITH_VIRTIO_NET_1_0) \
|
---|
[98412] | 55 | $(if $(VBOX_WITH_USB_CARDREADER),VBOX_WITH_USB_CARDREADER) \
|
---|
| 56 | $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH) \
|
---|
| 57 | $(if $(VBOX_WITH_RECORDING),VBOX_WITH_RECORDING) \
|
---|
[75345] | 58 | $(if $(VBOX_WITH_AUDIO_RECORDING),VBOX_WITH_AUDIO_RECORDING) \
|
---|
[98412] | 59 | $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE) \
|
---|
| 60 | $(if $(VBOX_WITH_SHARED_CLIPBOARD),VBOX_WITH_SHARED_CLIPBOARD) \
|
---|
| 61 | $(if $(VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS),VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS) \
|
---|
| 62 | $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD) \
|
---|
| 63 | $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL) \
|
---|
[94643] | 64 | $(if $(VBOX_WITH_UPDATE_AGENT), VBOX_WITH_UPDATE_AGENT) \
|
---|
[98412] | 65 | $(if $(VBOX_WITH_VMSVGA),VBOX_WITH_VMSVGA) \
|
---|
[91213] | 66 | $(if $(VBOX_WITH_MAIN_NLS),VBOX_WITH_MAIN_NLS) \
|
---|
[98412] | 67 | $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM) \
|
---|
| 68 | $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION)
|
---|
[56465] | 69 |
|
---|
| 70 |
|
---|
[38416] | 71 | ifndef VBOX_ONLY_DOCS
|
---|
| 72 | PROGRAMS += VBoxManage
|
---|
[98187] | 73 | VBoxManage_TEMPLATE = VBoxMainClientExe
|
---|
[56465] | 74 | VBoxManage_DEFS += $(VBOX_COMMON_VBOXMANAGE_DEFS)
|
---|
[56344] | 75 | VBoxManage_DEFS.win = _WIN32_WINNT=0x0500
|
---|
[68860] | 76 | VBoxManage_INCS = \
|
---|
[80569] | 77 | $(VBoxManage_0_OUTDIR) \
|
---|
| 78 | ../Common
|
---|
[68860] | 79 | VBoxManage_INTERMEDIATES = \
|
---|
| 80 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h
|
---|
[56344] | 81 | VBoxManage_SOURCES = \
|
---|
| 82 | VBoxManage.cpp \
|
---|
[98412] | 83 | VBoxManageUtils.cpp \
|
---|
[56344] | 84 | VBoxInternalManage.cpp \
|
---|
| 85 | VBoxManageAppliance.cpp \
|
---|
| 86 | VBoxManageBandwidthControl.cpp \
|
---|
| 87 | VBoxManageControlVM.cpp \
|
---|
| 88 | VBoxManageDebugVM.cpp \
|
---|
| 89 | VBoxManageDHCPServer.cpp \
|
---|
| 90 | VBoxManageDisk.cpp \
|
---|
| 91 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrl.cpp) \
|
---|
| 92 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrlListener.cpp) \
|
---|
| 93 | $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \
|
---|
| 94 | VBoxManageHelp.cpp \
|
---|
[98412] | 95 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
|
---|
| 96 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_en_US.cpp \
|
---|
[56344] | 97 | VBoxManageHostonly.cpp \
|
---|
| 98 | VBoxManageInfo.cpp \
|
---|
| 99 | VBoxManageList.cpp \
|
---|
| 100 | VBoxManageMetrics.cpp \
|
---|
| 101 | VBoxManageMisc.cpp \
|
---|
| 102 | VBoxManageModifyVM.cpp \
|
---|
[91432] | 103 | VBoxManageModifyNvram.cpp \
|
---|
[56344] | 104 | VBoxManageSnapshot.cpp \
|
---|
| 105 | VBoxManageStorageController.cpp \
|
---|
[98412] | 106 | $(if $(VBOX_WITH_UPDATE_AGENT),VBoxManageUpdateCheck.cpp) \
|
---|
[56344] | 107 | VBoxManageUSB.cpp \
|
---|
| 108 | $(if $(VBOX_WITH_NAT_SERVICE),VBoxManageNATNetwork.cpp,) \
|
---|
[77883] | 109 | $(if $(VBOX_WITH_NAT_SERVICE),../../NetworkServices/NetLib/VBoxNetPortForwardString.cpp,) \
|
---|
[80569] | 110 | VBoxManageCloud.cpp \
|
---|
[90214] | 111 | VBoxManageCloudMachine.cpp \
|
---|
[80569] | 112 | ../Common/PasswordInput.cpp
|
---|
[56344] | 113 | VBoxManage_SOURCES.win = \
|
---|
| 114 | VBoxManage.rc
|
---|
| 115 | VBoxManage_LIBS += $(LIB_DDU)
|
---|
[32712] | 116 |
|
---|
[98412] | 117 | ifdef VBOX_WITH_VBOXMANAGE_NLS
|
---|
| 118 | VBOX_PATH_VBOXMANAGE_SRC := $(PATH_SUB_CURRENT)
|
---|
| 119 | include $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
|
---|
[92824] | 120 |
|
---|
[98412] | 121 | VBoxManage_DEFS += VBOX_WITH_VBOXMANAGE_NLS
|
---|
| 122 | VBoxManage_INCS += \
|
---|
| 123 | $(PATH_ROOT)/src/VBox/Main/include
|
---|
| 124 | VBoxManage_SOURCES += \
|
---|
| 125 | $(PATH_ROOT)/src/VBox/Main/src-all/VirtualBoxTranslator.cpp \
|
---|
| 126 | $(PATH_ROOT)/src/VBox/Main/src-all/QMTranslatorImpl.cpp \
|
---|
| 127 | $(PATH_ROOT)/src/VBox/Main/src-all/GlobalStatusConversion.cpp
|
---|
[92372] | 128 |
|
---|
[98412] | 129 | # $(addsuffix /VBoxManageBuiltInHelp.cpp,$(addprefix $(VBoxManage_0_OUTDIR)/,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES)))
|
---|
| 130 | #VBoxManage_INTERMEDIATES += \
|
---|
| 131 | # $(addsuffix /VBoxManageBuiltInHelp.h,$(addprefix $(VBoxManage_0_OUTDIR)/,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES)))
|
---|
[92824] | 132 |
|
---|
[101556] | 133 | # define qt6 tools for translation
|
---|
| 134 | USES += qt6
|
---|
[92372] | 135 |
|
---|
[98412] | 136 | PROGRAMS += VBoxManageNls
|
---|
| 137 | VBoxManageNls_TEMPLATE = VBoxNLS
|
---|
| 138 | VBoxManageNls_QT_TRANSLATIONS = $(addsuffix .ts,$(addprefix $(VBOX_PATH_VBOXMANAGE_SRC)/nls/VBoxManageNls_,$(VBOX_APPROVED_VBOXMANAGE_LANGUAGES)))
|
---|
| 139 | VBoxManageNls_VBOX_ALL_NLS_SOURCES = $(wildcard \
|
---|
[99040] | 140 | $(VBOX_PATH_VBOXMANAGE_SRC)/*.h \
|
---|
| 141 | $(VBOX_PATH_VBOXMANAGE_SRC)/*.cpp )
|
---|
[92403] | 142 |
|
---|
[98412] | 143 | updatenls:: makeallnls $(VBOX_PATH_VBOXMANAGE_SRC)/nls/VBoxManageNls_en.ts
|
---|
[92403] | 144 |
|
---|
[98412] | 145 | makeallnls:: $(VBoxManageNls_VBOX_ALL_NLS_SOURCES)
|
---|
[92403] | 146 | $(call MSG_L1,lupdate all languages (nls/*.ts))
|
---|
| 147 | $(QUIET)$(TOOL_QT5_LUPDATE) \
|
---|
| 148 | $^ \
|
---|
| 149 | -ts \
|
---|
| 150 | $(filter-out nls/VBoxManageNls_en.ts, $(VBoxManageNls_QT_TRANSLATIONS)) \
|
---|
| 151 | $(VBOX_PATH_VBOXMANAGE_SRC)/nls/VBoxManageNls_xx_YY.ts
|
---|
| 152 |
|
---|
[98412] | 153 | # fake-main-nls:
|
---|
| 154 | # $(foreach file, $(VBoxManageNls_QT_TRANSLATIONS) \
|
---|
| 155 | # ,$(NLTAB)$(SED) -i \
|
---|
| 156 | # -e '/<source>.*<\/source>/h' \
|
---|
| 157 | # -e '/<source>.*<\/source>/p' \
|
---|
| 158 | # -e '/<translation type="unfinished"><\/translation>/{' \
|
---|
| 159 | # -e 'x' \
|
---|
| 160 | # -e 's/<source>\(.*\)<\/source>/<translation type="unfinished">$(notdir $(file)): \1<\/translation>/' \
|
---|
| 161 | # -e '}' \
|
---|
| 162 | # $(file) )
|
---|
[92403] | 163 |
|
---|
| 164 |
|
---|
[98412] | 165 | # Create the English translation file. This is something special cause it will
|
---|
| 166 | # contain the plural forms only.
|
---|
| 167 | $(VBOX_PATH_VBOXMANAGE_SRC)/nls/VBoxManageNls_en.ts: $(VBoxManageNls_VBOX_ALL_NLS_SOURCES)
|
---|
[92403] | 168 | $(call MSG_L1,lupdate $@)
|
---|
| 169 | $(QUIET)$(TOOL_QT5_LUPDATE) \
|
---|
| 170 | $^ \
|
---|
| 171 | -ts \
|
---|
| 172 | "$@"
|
---|
| 173 | $(QUIET)$(SED) -n -i \
|
---|
| 174 | -e '/<context>/,/<\/context>/!p' \
|
---|
| 175 | -e '/<context>/h' \
|
---|
| 176 | -e '/<name>/H' \
|
---|
| 177 | -e '/<message numerus="yes">/,/<\/message>/H' \
|
---|
| 178 | -e '/<\/context>/{H;x;/<message/p}' \
|
---|
| 179 | "$@"
|
---|
| 180 |
|
---|
[98412] | 181 | endif # VBOX_WITH_VBOXMANAGE_NLS
|
---|
[92403] | 182 |
|
---|
| 183 |
|
---|
[56344] | 184 | # VBoxNetPortForwardString.h
|
---|
| 185 | VBoxManageNATNetwork.cpp_INCS += ../../NetworkServices/NetLib/
|
---|
[45559] | 186 |
|
---|
[56344] | 187 | endif # VBOX_ONLY_DOCS
|
---|
| 188 |
|
---|
[11345] | 189 | ifneq ($(KBUILD_TARGET),win)
|
---|
| 190 | # Workaround for buggy gcc-4.3 compilers, see
|
---|
| 191 | #
|
---|
| 192 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36474
|
---|
| 193 | #
|
---|
| 194 | # Some later revisions of version 4.3.1 are known to work so we assume
|
---|
| 195 | # that version 4.3.2 or later has this bug definitely fixed.
|
---|
| 196 | VBoxManage_CXXFLAGS.release += \
|
---|
[98412] | 197 | $(if $(VBOX_GCC_VERSION_CXX),$(if-expr $(VBOX_GCC_VERSION_CXX) < 40300 || $(VBOX_GCC_VERSION_CXX) > 40301,,--param max-fields-for-field-sensitive=0),)
|
---|
[38416] | 198 | VBoxManageHelp_CXXFLAGS.release = $(VBoxManage_CXXFLAGS.release)
|
---|
[11345] | 199 | endif
|
---|
[1] | 200 |
|
---|
[68860] | 201 |
|
---|
| 202 | #
|
---|
| 203 | # VBoxManage built-in help from XML refentry in doc/manual/en_US/.
|
---|
| 204 | #
|
---|
| 205 | $(call KB_FN_DO_PASS0_ON_TARGET,VBoxManage)
|
---|
| 206 |
|
---|
| 207 | VBoxManage_CLEAN += \
|
---|
[93814] | 208 | $(VBOX_XML_CATALOG) \
|
---|
| 209 | $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
| 210 | $(VBOX_XML_CATALOG_MANUAL) \
|
---|
| 211 | $(VBOX_XML_ENTITIES) \
|
---|
| 212 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, $(VBOX_XML_XREF_TO_TEXT) $(VBOX_XML_XREF_TO_TEXT).cat) \
|
---|
[92824] | 213 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_en_US.cpp \
|
---|
| 214 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_en_US.cpp.ts \
|
---|
[68860] | 215 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
|
---|
| 216 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
|
---|
| 217 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h \
|
---|
| 218 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
|
---|
[93814] | 219 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)))
|
---|
[68860] | 220 |
|
---|
| 221 | # Preprocess the xml files, applying remarks.
|
---|
| 222 | $(foreach file,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
[92824] | 223 | , $(evalcall2 def_vbox_refentry_preprocess_for_manpage,$(VBoxManage_0_OUTDIR),$(file), \
|
---|
[93811] | 224 | $(VBOX_PATH_MANUAL_SRC)/en_US/$(file),replace-xrefs,en_US))
|
---|
[68860] | 225 |
|
---|
| 226 |
|
---|
[92824] | 227 | ##
|
---|
| 228 | # Emits rules for generating cpp files from man pages.
|
---|
| 229 | #
|
---|
| 230 | # $(evalcall2 def_vbox_man_generate_cpp_help)
|
---|
| 231 | # @param 1 Folder with preprocessed man_VBoxManage_* files
|
---|
| 232 | # @param 2 language code.
|
---|
| 233 | define def_vbox_man_generate_cpp_help
|
---|
[98412] | 234 | ifneq ($(2),en_US)
|
---|
| 235 | VBOX_DOCBOOK_REFENTRY_TO_C_HELP_$(2) = $(VBOX_PATH_MANUAL_SRC)/$(2)/docbook-refentry-to-C-help.xsl
|
---|
| 236 | else
|
---|
| 237 | VBOX_DOCBOOK_REFENTRY_TO_C_HELP_$(2) = $(VBOX_DOCBOOK_REFENTRY_TO_C_HELP)
|
---|
| 238 | endif
|
---|
| 239 | $$(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_$(2).cpp.ts \
|
---|
| 240 | +| $$(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_$(2).cpp: \
|
---|
| 241 | $$(VBOX_DOCBOOK_REFENTRY_TO_C_HELP_$(2)) \
|
---|
| 242 | $$(VBOX_DOCBOOK_REFENTRY_TO_C_HELP) \
|
---|
| 243 | $$(addprefix $(1)/,$$(filter man_VBoxManage-%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
| 244 | $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(MAKEFILE) | $$$$(dir $$$$@)
|
---|
[92824] | 245 | $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(filter %.xml,$$^),$$(patsubst %.ts,%,$$@))
|
---|
| 246 | $$(QUIET)$$(APPEND) -tn "$$@" \
|
---|
| 247 | '/* Autogenerated by $$<, do not edit! */' \
|
---|
| 248 | '' \
|
---|
| 249 | '#include "VBoxManageBuiltInHelp.h"' \
|
---|
| 250 | '' \
|
---|
| 251 | 'RT_C_DECLS_BEGIN' \
|
---|
| 252 | '/* make next variables visible outside the module */' \
|
---|
| 253 | 'extern PCRTMSGREFENTRY g_apHelpEntries_$(2)[];' \
|
---|
| 254 | 'extern const uint32_t g_cHelpEntries_$(2);' \
|
---|
| 255 | 'RT_C_DECLS_END' \
|
---|
| 256 | '' \
|
---|
| 257 | $$(foreach refentry,$$(filter %.xml,$$^) \
|
---|
| 258 | ,$$(NLTAB)$$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$$@") \
|
---|
| 259 | --path '$(VBOX_PATH_MANUAL_SRC)/$(2) $(VBOX_PATH_MANUAL_SRC)/en_US' $$< $$(refentry))
|
---|
| 260 | $$(QUIET)$$(APPEND) -n "$$@" \
|
---|
| 261 | '' \
|
---|
| 262 | 'PCRTMSGREFENTRY g_apHelpEntries_$(2)[] =' \
|
---|
| 263 | '{'
|
---|
| 264 | $$(foreach refentry,$$(filter %.xml,$$^) \
|
---|
| 265 | ,$$(NLTAB)$$(QUIET)$$(APPEND) -n "$$@" \
|
---|
| 266 | ' &g_$$(subst -,_,$$(tolower $$(patsubst man_%,%,$$(notdir $$(basename $$(refentry)))))),')
|
---|
| 267 | $$(QUIET)$$(APPEND) -n "$$@" \
|
---|
| 268 | '};' \
|
---|
| 269 | '' \
|
---|
| 270 | 'const uint32_t g_cHelpEntries_$(2) = RT_ELEMENTS(g_apHelpEntries_$(2));' \
|
---|
| 271 | ''
|
---|
| 272 | $$(QUIET)$$(CP) --changed -- "$$@" "$$(patsubst %.ts,%,$$@)"
|
---|
| 273 | endef
|
---|
| 274 | # The above APPEND stuff trigger some kind of problem on some boxes when not split up...
|
---|
| 275 | # update: Fixed in SVN (strcpy -> memmove in new_job(), job.c - r2591). Just need to rebuild all platforms.
|
---|
| 276 |
|
---|
[68860] | 277 | # Generate the .cpp file.
|
---|
[92824] | 278 | $(evalcall2 def_vbox_man_generate_cpp_help, $(VBoxManage_0_OUTDIR),en_US)
|
---|
| 279 |
|
---|
| 280 |
|
---|
[93814] | 281 | # Generate built-in help for all languages (English is implicit).
|
---|
[68860] | 282 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
|
---|
| 283 | +| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp: \
|
---|
[92824] | 284 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_en_US.cpp \
|
---|
| 285 | $(foreach lang,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES), $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_$(lang).cpp ) \
|
---|
| 286 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h
|
---|
[68860] | 287 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
[92824] | 288 | '/* Autogenerated, do not edit! */' \
|
---|
[68860] | 289 | '' \
|
---|
| 290 | '#include "VBoxManageBuiltInHelp.h"' \
|
---|
[92824] | 291 | '' \
|
---|
| 292 | 'RT_C_DECLS_BEGIN' \
|
---|
| 293 | '' \
|
---|
| 294 | 'extern PCRTMSGREFENTRY g_apHelpEntries_en_US[];' \
|
---|
| 295 | 'extern const uint32_t g_cHelpEntries_en_US;'
|
---|
| 296 | ifdef VBOX_WITH_VBOXMANAGE_NLS
|
---|
| 297 | $(foreach lang,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
| 298 | ,$(NLTAB)$(QUIET)$(APPEND) -n "$@" \
|
---|
| 299 | '' \
|
---|
| 300 | 'extern PCRTMSGREFENTRY g_apHelpEntries_$(lang)[];' \
|
---|
| 301 | 'extern const uint32_t g_cHelpEntries_$(lang);')
|
---|
| 302 | endif
|
---|
[68860] | 303 | $(QUIET)$(APPEND) -n "$@" \
|
---|
[92824] | 304 | '' \
|
---|
| 305 | 'RT_C_DECLS_END' \
|
---|
| 306 | '' \
|
---|
[92937] | 307 | 'HELP_LANG_ENTRY_T const g_aHelpLangEntries[] = ' \
|
---|
[92824] | 308 | '{' \
|
---|
[92937] | 309 | ' { "en_US", 5, &g_apHelpEntries_en_US[0], &g_cHelpEntries_en_US },'
|
---|
[92824] | 310 | ifdef VBOX_WITH_VBOXMANAGE_NLS
|
---|
| 311 | $(foreach lang,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
[92937] | 312 | ,$(NLTAB)$(QUIET)$(APPEND) "$@" ' { "$(lang)", $(length $(lang)), &g_apHelpEntries_$(lang)[0], &g_cHelpEntries_$(lang) },' )
|
---|
[92824] | 313 | endif
|
---|
[68860] | 314 | $(QUIET)$(APPEND) -n "$@" \
|
---|
| 315 | '};' \
|
---|
[92824] | 316 | '' \
|
---|
[92937] | 317 | 'uint32_t const g_cHelpLangEntries = RT_ELEMENTS(g_aHelpLangEntries);' \
|
---|
[92824] | 318 | '' \
|
---|
[92937] | 319 | 'PCHELP_LANG_ENTRY_T volatile g_pHelpLangEntry = &g_aHelpLangEntries[0];'\
|
---|
[92824] | 320 | ''
|
---|
[68860] | 321 | $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
|
---|
| 322 |
|
---|
| 323 |
|
---|
| 324 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
|
---|
| 325 | +| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h: \
|
---|
| 326 | $(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) \
|
---|
| 327 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
| 328 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
|
---|
| 329 | $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
|
---|
| 330 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
| 331 | '/* Autogenerated by $<, do not edit! */' \
|
---|
[92824] | 332 | '' \
|
---|
| 333 | '#ifndef ___VBoxManageBuiltInHelp_h___' \
|
---|
| 334 | '#define ___VBoxManageBuiltInHelp_h___' \
|
---|
| 335 | '' \
|
---|
| 336 | '#include <iprt/message.h>' \
|
---|
[93708] | 337 | '#include <iprt/assertcompile.h>' \
|
---|
[92824] | 338 | '' \
|
---|
| 339 | 'RT_C_DECLS_BEGIN' \
|
---|
| 340 | '' \
|
---|
| 341 | 'typedef enum HELP_CMD_VBOXMANAGE' \
|
---|
| 342 | '{' \
|
---|
| 343 | ' HELP_CMD_VBOXMANAGE_INVALID = 0,'
|
---|
[68860] | 344 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
| 345 | ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
|
---|
| 346 | --stringparam 'g_sMode' 'cmd' $< $(refentry))
|
---|
| 347 | $(QUIET)$(APPEND) -n "$@" \
|
---|
| 348 | ' HELP_CMD_VBOXMANAGE_END' \
|
---|
| 349 | '} HELP_CMD_VBOXMANAGE;'
|
---|
| 350 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
| 351 | ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
|
---|
| 352 | --stringparam 'g_sMode' 'subcmd' $< $(refentry))
|
---|
| 353 | $(QUIET)$(APPEND) -n "$@" \
|
---|
| 354 | '' \
|
---|
[92937] | 355 | 'typedef struct HELP_LANG_ENTRY_T' \
|
---|
[92824] | 356 | '{' \
|
---|
| 357 | ' const char *pszLang;' \
|
---|
[92937] | 358 | ' size_t cchLang;' \
|
---|
[92824] | 359 | ' PCRTMSGREFENTRY *papHelpEntries;' \
|
---|
[92937] | 360 | ' uint32_t const *pcHelpEntries;' \
|
---|
| 361 | '} HELP_LANG_ENTRY_T;' \
|
---|
| 362 | 'typedef HELP_LANG_ENTRY_T const *PCHELP_LANG_ENTRY_T;' \
|
---|
[68860] | 363 | '' \
|
---|
[92937] | 364 | 'extern HELP_LANG_ENTRY_T const g_aHelpLangEntries[];' \
|
---|
| 365 | 'extern const uint32_t g_cHelpLangEntries;' \
|
---|
[68860] | 366 | '' \
|
---|
[92937] | 367 | 'extern PCHELP_LANG_ENTRY_T volatile g_pHelpLangEntry;' \
|
---|
[92824] | 368 | '' \
|
---|
| 369 | 'RT_C_DECLS_END' \
|
---|
| 370 | '' \
|
---|
[68860] | 371 | '#endif' \
|
---|
[92824] | 372 | ''
|
---|
[68860] | 373 | $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
|
---|
| 374 |
|
---|
[92824] | 375 | ifdef VBOX_WITH_VBOXMANAGE_NLS
|
---|
| 376 | VBoxManage_BLDDIRS += \
|
---|
[98412] | 377 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES))
|
---|
[68860] | 378 |
|
---|
[92824] | 379 | VBoxManage_SOURCES += \
|
---|
| 380 | $(foreach lang, $(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
[99040] | 381 | , $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_$(lang).cpp)
|
---|
[92824] | 382 |
|
---|
| 383 | VBoxManage_CLEAN += \
|
---|
[98412] | 384 | $(foreach lang,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES), \
|
---|
[99040] | 385 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
|
---|
| 386 | $(VBOX_XML_XREF_TO_TEXT) \
|
---|
| 387 | $(VBOX_XML_XREF_TO_TEXT).cat \
|
---|
| 388 | )) \
|
---|
[98412] | 389 | $(addsuffix .cpp,$(addprefix $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES))) \
|
---|
| 390 | $(addsuffix .cpp.ts,$(addprefix $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp_,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES))) \
|
---|
| 391 | $(foreach file, $(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
[99040] | 392 | , $(addsuffix /$(file),$(addprefix $(VBoxManage_0_OUTDIR)/,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES))))
|
---|
[92824] | 393 |
|
---|
| 394 | # Preprocess the xml files, applying remarks.
|
---|
| 395 | $(foreach lang, $(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
| 396 | , $(foreach file,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
| 397 | , $(evalcall2 def_vbox_refentry_preprocess_for_manpage,$(VBoxManage_0_OUTDIR)/$(lang),$(file) \
|
---|
[103621] | 398 | ,$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file),replace-xrefs \
|
---|
| 399 | ,$(if $(filter $(lang),$(VBOX_MANUAL_LANGUAGES)),$(lang),en_US))))
|
---|
[92824] | 400 |
|
---|
| 401 | # Generate the .cpp file.
|
---|
| 402 | $(foreach lang, $(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
| 403 | , $(evalcall2 def_vbox_man_generate_cpp_help,$(VBoxManage_0_OUTDIR)/$(lang),$(lang)))
|
---|
| 404 |
|
---|
| 405 | # Ensure $(lang) subfolder in the $(VBOX_PATH_MANUAL_OUTBASE) is created (for section names file)
|
---|
| 406 | BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/,$(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES))
|
---|
| 407 |
|
---|
| 408 | # Generate sections names file for $(lang)
|
---|
| 409 | $(foreach lang, $(VBOX_APPROVED_VBOXMANAGE_DOCBOOK_LANGUAGES) \
|
---|
| 410 | , $(evalcall2 def_vbox_xref_to_text,$(lang)))
|
---|
| 411 |
|
---|
| 412 | endif
|
---|
| 413 |
|
---|
[41477] | 414 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|