VirtualBox

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

Last change on this file since 83487 was 83169, checked in by vboxsync, 5 years ago

OCI: (bugref:9469) cloud network integration multiple targets and configuration support (enabled in Config.kmk).

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

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