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