VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk@ 88344

Last change on this file since 88344 was 88079, checked in by vboxsync, 4 years ago

VBoxManage: When setting the host interface for bridging or hostonly
attachments do a sanity check on it. Make sure IHost knows about it
and that the interface is of correct type. Warn the user if that's
not the case, but the warning is non-fatal. The API setters don't do
this, so provide at least some protection from typos and mistakes.
bugref:9966.

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette