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