1 | # $Id: Makefile.kmk 91432 2021-09-28 11:37:43Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for VBoxManage (the cli frontend).
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2020 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 $(VBOX_WITH_VMNET), VBOX_WITH_VMNET) \
|
---|
35 | $(if $(VBOX_WITH_CLOUD_NET), VBOX_WITH_CLOUD_NET) \
|
---|
36 | $(if $(VBOX_WITH_LIBCURL), VBOX_WITH_PROXY_INFO) \
|
---|
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_VMSVGA),VBOX_WITH_VMSVGA) \
|
---|
55 | $(if $(VBOX_WITH_MAIN_NLS),VBOX_WITH_MAIN_NLS) \
|
---|
56 | $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM)
|
---|
57 |
|
---|
58 |
|
---|
59 | ifdef VBOX_WITH_DOCS
|
---|
60 | PROGRAMS += VBoxManageHelp
|
---|
61 | endif
|
---|
62 | VBoxManageHelp_TEMPLATE = VBoxAdvBldProg
|
---|
63 | VBoxManageHelp_DEFS += \
|
---|
64 | VBOX_ONLY_DOCS \
|
---|
65 | $(VBOX_COMMON_VBOXMANAGE_DEFS)
|
---|
66 | VBoxManageHelp_SOURCES = \
|
---|
67 | VBoxManage.cpp \
|
---|
68 | VBoxManageHelp.cpp \
|
---|
69 | $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \
|
---|
70 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrl.cpp)
|
---|
71 |
|
---|
72 | ifndef VBOX_ONLY_DOCS
|
---|
73 | PROGRAMS += VBoxManage
|
---|
74 | VBoxManage_TEMPLATE = VBOXMAINCLIENTEXE
|
---|
75 | VBoxManage_DEFS += $(VBOX_COMMON_VBOXMANAGE_DEFS)
|
---|
76 | VBoxManage_DEFS.win = _WIN32_WINNT=0x0500
|
---|
77 | VBoxManage_INCS = \
|
---|
78 | $(VBoxManage_0_OUTDIR) \
|
---|
79 | ../Common
|
---|
80 | VBoxManage_INTERMEDIATES = \
|
---|
81 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h
|
---|
82 | VBoxManage_SOURCES = \
|
---|
83 | VBoxManage.cpp \
|
---|
84 | VBoxManageUtils.cpp \
|
---|
85 | VBoxInternalManage.cpp \
|
---|
86 | VBoxManageAppliance.cpp \
|
---|
87 | VBoxManageBandwidthControl.cpp \
|
---|
88 | VBoxManageControlVM.cpp \
|
---|
89 | VBoxManageDebugVM.cpp \
|
---|
90 | VBoxManageDHCPServer.cpp \
|
---|
91 | VBoxManageDisk.cpp \
|
---|
92 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrl.cpp) \
|
---|
93 | $(if $(VBOX_WITH_GUEST_CONTROL),VBoxManageGuestCtrlListener.cpp) \
|
---|
94 | $(if $(VBOX_WITH_GUEST_PROPS),VBoxManageGuestProp.cpp) \
|
---|
95 | VBoxManageHelp.cpp \
|
---|
96 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
|
---|
97 | VBoxManageHostonly.cpp \
|
---|
98 | VBoxManageInfo.cpp \
|
---|
99 | VBoxManageList.cpp \
|
---|
100 | VBoxManageMetrics.cpp \
|
---|
101 | VBoxManageMisc.cpp \
|
---|
102 | VBoxManageModifyVM.cpp \
|
---|
103 | VBoxManageModifyNvram.cpp \
|
---|
104 | VBoxManageSnapshot.cpp \
|
---|
105 | VBoxManageStorageController.cpp \
|
---|
106 | VBoxManageUpdateCheck.cpp \
|
---|
107 | VBoxManageUSB.cpp \
|
---|
108 | $(if $(VBOX_WITH_NAT_SERVICE),VBoxManageNATNetwork.cpp,) \
|
---|
109 | $(if $(VBOX_WITH_NAT_SERVICE),../../NetworkServices/NetLib/VBoxNetPortForwardString.cpp,) \
|
---|
110 | VBoxManageCloud.cpp \
|
---|
111 | VBoxManageCloudMachine.cpp \
|
---|
112 | ../Common/PasswordInput.cpp
|
---|
113 | VBoxManage_SOURCES.win = \
|
---|
114 | VBoxManage.rc
|
---|
115 | VBoxManage_LIBS += $(LIB_DDU)
|
---|
116 |
|
---|
117 | # VBoxNetPortForwardString.h
|
---|
118 | VBoxManageNATNetwork.cpp_INCS += ../../NetworkServices/NetLib/
|
---|
119 |
|
---|
120 | endif # VBOX_ONLY_DOCS
|
---|
121 |
|
---|
122 | ifneq ($(KBUILD_TARGET),win)
|
---|
123 | # Workaround for buggy gcc-4.3 compilers, see
|
---|
124 | #
|
---|
125 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36474
|
---|
126 | #
|
---|
127 | # Some later revisions of version 4.3.1 are known to work so we assume
|
---|
128 | # that version 4.3.2 or later has this bug definitely fixed.
|
---|
129 | VBoxManage_CXXFLAGS.release += \
|
---|
130 | $(if $(VBOX_GCC_VERSION_CXX),$(if-expr $(VBOX_GCC_VERSION_CXX) < 40300 || $(VBOX_GCC_VERSION_CXX) > 40301,,--param max-fields-for-field-sensitive=0),)
|
---|
131 | VBoxManageHelp_CXXFLAGS.release = $(VBoxManage_CXXFLAGS.release)
|
---|
132 | endif
|
---|
133 |
|
---|
134 |
|
---|
135 | #
|
---|
136 | # VBoxManage built-in help from XML refentry in doc/manual/en_US/.
|
---|
137 | #
|
---|
138 | $(call KB_FN_DO_PASS0_ON_TARGET,VBoxManage)
|
---|
139 |
|
---|
140 | ## @todo r=klaus the VBoxManage manpage handling currently cannot deal with
|
---|
141 | # man_VBoxManage.xml and that's not just removing the - in the patterns. The
|
---|
142 | # common options (and the included overview of the command) need to be handled
|
---|
143 | # specially to be useful in VBoxManage.
|
---|
144 |
|
---|
145 | VBoxManage_CLEAN += \
|
---|
146 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp \
|
---|
147 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
|
---|
148 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h \
|
---|
149 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
|
---|
150 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)))
|
---|
151 |
|
---|
152 |
|
---|
153 |
|
---|
154 | # Preprocess the xml files, applying remarks.
|
---|
155 | $(foreach file,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
156 | , $(evalcall2 def_vbox_refentry_preprocess_for_manpage,$(VBoxManage_0_OUTDIR),$(file),$(VBOX_PATH_MANUAL_SRC)/en_US/$(file),replace-xrefs))
|
---|
157 |
|
---|
158 |
|
---|
159 | # Generate the .cpp file.
|
---|
160 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp.ts \
|
---|
161 | +| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.cpp: \
|
---|
162 | $(VBOX_DOCBOOK_REFENTRY_TO_C_HELP) \
|
---|
163 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
164 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
|
---|
165 | $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
|
---|
166 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
167 | '/* Autogenerated by $<, do not edit! */' \
|
---|
168 | '' \
|
---|
169 | '#include "VBoxManageBuiltInHelp.h"' \
|
---|
170 | ''
|
---|
171 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
172 | ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") $< $(refentry))
|
---|
173 | $(QUIET)$(APPEND) -n "$@" \
|
---|
174 | '' \
|
---|
175 | 'PCRTMSGREFENTRY g_apHelpEntries[] =' \
|
---|
176 | '{'
|
---|
177 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
178 | ,$(NLTAB)$(QUIET)$(APPEND) -n "$@" \
|
---|
179 | ' &g_$(subst -,_,$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry)))))),')
|
---|
180 | $(QUIET)$(APPEND) -n "$@" \
|
---|
181 | '};' \
|
---|
182 | 'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
|
---|
183 | ''
|
---|
184 | $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
|
---|
185 | # The above APPEND stuff trigger some kind of problem on some boxes when not split up...
|
---|
186 | # update: Fixed in SVN (strcpy -> memmove in new_job(), job.c - r2591). Just need to rebuild all platforms.
|
---|
187 |
|
---|
188 |
|
---|
189 | $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h.ts \
|
---|
190 | +| $(VBoxManage_0_OUTDIR)/VBoxManageBuiltInHelp.h: \
|
---|
191 | $(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) \
|
---|
192 | $(addprefix $(VBoxManage_0_OUTDIR)/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
193 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
|
---|
194 | $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$(patsubst %.ts,%,$@))
|
---|
195 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
196 | '/* Autogenerated by $<, do not edit! */' \
|
---|
197 | '' \
|
---|
198 | '#ifndef ___VBoxManageBuiltInHelp_h___' \
|
---|
199 | '#define ___VBoxManageBuiltInHelp_h___' \
|
---|
200 | '' \
|
---|
201 | '#include <iprt/message.h>' \
|
---|
202 | '' \
|
---|
203 | 'RT_C_DECLS_BEGIN' \
|
---|
204 | '' \
|
---|
205 | 'typedef enum HELP_CMD_VBOXMANAGE' \
|
---|
206 | '{' \
|
---|
207 | ' HELP_CMD_VBOXMANAGE_INVALID = 0,'
|
---|
208 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
209 | ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
|
---|
210 | --stringparam 'g_sMode' 'cmd' $< $(refentry))
|
---|
211 | $(QUIET)$(APPEND) -n "$@" \
|
---|
212 | ' HELP_CMD_VBOXMANAGE_END' \
|
---|
213 | '} HELP_CMD_VBOXMANAGE;'
|
---|
214 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
215 | ,$(NLTAB)$(QUIET)$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$@") \
|
---|
216 | --stringparam 'g_sMode' 'subcmd' $< $(refentry))
|
---|
217 | $(QUIET)$(APPEND) -n "$@" \
|
---|
218 | '' \
|
---|
219 | 'extern PCRTMSGREFENTRY g_apHelpEntries[];' \
|
---|
220 | 'extern const uint32_t g_cHelpEntries;' \
|
---|
221 | '' \
|
---|
222 | 'RT_C_DECLS_END' \
|
---|
223 | '' \
|
---|
224 | '#endif' \
|
---|
225 | ''
|
---|
226 | $(QUIET)$(CP) --changed -- "$@" "$(patsubst %.ts,%,$@)"
|
---|
227 |
|
---|
228 |
|
---|
229 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
230 |
|
---|