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