VirtualBox

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

Last change on this file since 91066 was 91006, checked in by vboxsync, 4 years ago

manual/VBoxManage: Don't emit trailing whitespaces to the generated C file.

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