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