VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/Makefile@ 924

Last change on this file since 924 was 924, checked in by vboxsync, 18 years ago

1758: Implement Shared Folders UI

  1. Shared Folders (VM Settings Page) implemented.
  2. Current Shared Folders list displays all the shared folders available for the current VM, it shows the name and the path to the related host folder.
  3. Add-box Dialog used for adding new shared folder from the existing host one.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.5 KB
Line 
1#
2# Makefile for the VirtualBox Qt GUI.
3#
4
5#
6# Copyright (C) 2006 InnoTek Systemberatung GmbH
7#
8# This file is part of VirtualBox Open Source Edition (OSE), as
9# available from http://www.virtualbox.org. This file is free software;
10# you can redistribute it and/or modify it under the terms of the GNU
11# General Public License as published by the Free Software Foundation,
12# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
13# distribution. VirtualBox OSE is distributed in the hope that it will
14# be useful, but WITHOUT ANY WARRANTY of any kind.
15#
16# If you received this file as part of a commercial VirtualBox
17# distribution, then only the terms of your commercial VirtualBox
18# license agreement apply instead of the previous paragraph.
19#
20
21# include qmake project file
22include VBoxUI.pro
23
24# QDesigner UI sources
25VirtualBox_QT_UISRCS := $(FORMS)
26
27# reset things to avoid possible conflicts with kBuild
28TEMPLATE :=
29LANGUAGE :=
30FORMS :=
31
32
33DEPTH = ../../../..
34include $(PATH_KBUILD)/header.kmk
35
36PROGRAMS = VirtualBox
37
38VirtualBox_TEMPLATE = VBOXQTGUIEXE
39VirtualBox_SDKS.win = WINPSDK DXSDK
40VirtualBox_SDKS.linux = LIBSDL
41
42
43# bird:
44# this is a sketch which later can be moved into kBuild core stuff perhaps.
45# I might not have got the logic in what causes what to be generated right
46# feel free to help.
47
48# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
49
50# Headers containing definitions of classes that use the Q_OBJECT macro
51VirtualBox_QT_MOCHDRS = \
52 include/QIWidgetValidator.h \
53 include/QIHotKeyEdit.h \
54 include/QIStatusBar.h \
55 include/QIStateIndicator.h \
56 include/QIMessageBox.h \
57 include/QIRichLabel.h \
58 include/VMGlobalSettings.h \
59 include/VBoxGlobal.h \
60 include/VBoxMediaComboBox.h \
61 include/VBoxSelectorWnd.h \
62 include/VBoxConsoleWnd.h \
63 include/VBoxConsoleView.h \
64 include/VBoxProblemReporter.h
65
66# Sources containing local definitions of classes that use the Q_OBJECT macro
67ifeq ($(BUILD_TARGET),linux)
68VirtualBox_QT_MOCSRCS = src/COMDefs.cpp
69endif
70
71# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
72VirtualBox_QT_MOCUIHDRS = \
73 ui/VBoxVMSettingsDlg.ui.h \
74 ui/VBoxSharedFoldersSettings.ui.h
75
76VirtualBox_GENSRCS = \
77 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
78 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
79 $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
80
81VirtualBox_GENHDRS = \
82 $(foreach mocui,$(basename $(VirtualBox_QT_MOCUIHDRS)), $(PATH_VirtualBox)/moc/$(mocui).moc) \
83 $(foreach moc,$(basename $(VirtualBox_QT_MOCSRCS)), $(PATH_VirtualBox)/moc/$(moc).moc) \
84 $(foreach ui,$(basename $(VirtualBox_QT_UISRCS)), $(PATH_VirtualBox)/$(ui).h)
85
86
87VirtualBox_SOURCES = \
88 $(VirtualBox_GENSRCS) \
89 src/main.cpp \
90 src/COMDefs.cpp \
91 src/QIWidgetValidator.cpp \
92 src/QIHotKeyEdit.cpp \
93 src/QIStateIndicator.cpp \
94 src/QIStatusBar.cpp \
95 src/QIMessageBox.cpp \
96 src/QIRichLabel.cpp \
97 src/VMGlobalSettings.cpp \
98 src/VBoxGlobal.cpp \
99 src/VBoxMediaComboBox.cpp \
100 src/VBoxProblemReporter.cpp \
101 src/VBoxSelectorWnd.cpp \
102 src/VBoxConsoleView.cpp \
103 src/VBoxConsoleWnd.cpp \
104 src/VBoxVMListBox.cpp \
105 src/VBoxFrameBuffer.cpp
106
107VirtualBox_SOURCES.win += \
108 src/win32/VirtualBox.rc
109
110VirtualBox_SOURCES.win += \
111 src/VBoxFBDDRAW.cpp
112
113VirtualBox_SOURCES.linux = \
114 src/linux/XKeyboard.cpp \
115 src/linux/keyboard.c
116
117VirtualBox_CXXFLAGS.win = \
118 -nologo -Zm200 -W3 -MD -EHsc -DUNICODE -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG
119VirtualBox_CXXFLAGS.linux = \
120 -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -D_REENTRANT
121
122VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
123VirtualBox_DEFS += VBOX_GUI_SEPARATE_VM_PROCESS
124
125ifeq ($(BUILD_TYPE),release)
126VirtualBox_DEFS.win += VBOX_GUI_USE_QIMAGE
127VirtualBox_DEFS.linux += VBOX_GUI_USE_SDL
128else
129VirtualBox_DEFS += VBOX_WITH_DEBUGGER_GUI_MENU
130VirtualBox_DEFS.win += \
131 VBOX_GUI_USE_REFRESH_TIMER \
132 VBOX_GUI_USE_QIMAGE \
133 VBOX_GUI_USE_DDRAW
134VirtualBox_DEFS.linux += \
135 VBOX_GUI_USE_REFRESH_TIMER \
136 VBOX_GUI_USE_QIMAGE \
137 VBOX_GUI_USE_SDL
138endif
139
140ifdef VBOX_OSE
141 VirtualBox_DEFS += VBOX_OSE
142endif
143ifdef VBOX_WITH_ALSA
144 VirtualBox_DEFS += VBOX_WITH_ALSA
145endif
146
147VirtualBox_INCS = \
148 ./include \
149 $(PATH_VirtualBox)/ui \
150 $(PATH_VirtualBox)/moc \
151 $(PATH_VirtualBox)/include \
152
153
154ifeq ($(BUILD_TYPE),release)
155 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
156else
157 VirtualBox_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
158 ifeq ($(USERNAME),dmik)
159 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
160 else
161 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
162 endif
163endif
164VirtualBox_LIBS.win = \
165 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
166 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
167 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
168
169VirtualBox_LIBS.linux = \
170 $(LIB_QT) Xext X11 m $(LIB_PTHREAD) \
171 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
172 $(LIB_RUNTIME) \
173 $(PATH_BIN)/VBoxXML.so \
174 $(LIB_REM) \
175 $(LIB_VMM) \
176 $(PATH_BIN)/VBoxXPCOM.so \
177 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
178
179ifdef VBOX_WITH_DEBUGGER_GUI
180VirtualBox_LIBS.win += $(PATH_LIB)/VBoxDbg.lib
181VirtualBox_LIBS.linux += $(PATH_DLL)/VBoxDbg.so
182endif
183
184WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
185WRAPPERSINCFILE = include/COMDefs.h
186WRAPPERSTEMPLATE = include/COMWrappers.xsl
187XIDLFILE = ../../Main/idl/VirtualBox.xidl
188
189
190# generated files we need to clean manually
191OTHER_CLEAN = \
192 $(VirtualBox_GENSRCS) \
193 $(VirtualBox_GENHDRS) \
194 $(PATH_VirtualBox)/ui/vbox_image_collection.txt \
195 $(WRAPPERSFILE)
196
197
198include $(PATH_KBUILD)/footer.kmk
199
200
201#
202# Source file generation rules
203#
204
205## Generate a rule to create a MOC source file from a header containing
206# classes that use the Q_OBJECT macro.
207# @param $mochdr the header file with Q_OBJECT
208define def_qt_gen_src_moc
209$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
210$$(mocsrc): $(mochdr)
211 $$(call MSG_L1,moc $(mochdr),=> $$@)
212 $$(QUIET)$(MKDIR) -p $$(@D)
213 $$(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
214
215endef
216
217## Generate a rule to create a MOC include file from a source containing
218# local classes that use the Q_OBJECT macro. This include is then included
219# by that source, so it must be generated before the source gets compiled.
220# @param $mocsrc the source file with Q_OBJECT
221define def_qt_gen_inc_moc
222$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(SUFF_OBJ))
223$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
224
225$$(mocobj): $(mocinc)
226
227.NOTPARALLEL: $$(mocinc)
228$$(mocinc): $(mocsrc)
229 $$(call MSG_L1,moc $(mocsrc),=> $$@)
230 $$(QUIET)$(MKDIR) -p $$(@D)
231 $$(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
232
233endef
234
235## Generate a rule to create a MOC include file from a UI header (ui.h) containing
236# local classes that use the Q_OBJECT macro. This include is then included
237# by that header, so it must be generated before the UI source gets compiled.
238# @param $mocuihdr the UI header file with Q_OBJECT
239define def_qt_gen_inc_mocuihdr
240$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
241$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(SUFF_OBJ))
242$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
243
244.NOTPARALLEL: $$(mocuiinc)
245$$(uisrc): $(mocuiinc)
246$$(mocuiinc): $(mocuihdr)
247 $$(call MSG_L1,moc $(mocuihdr),=> $$@)
248 $$(QUIET)$(MKDIR) -p $$(@D)
249 $$(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
250
251endef
252
253define def_qt_gen_src_ui
254$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
255$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
256$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
257
258.NOTPARALLEL: $$(uihdr)
259$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
260 $$(call MSG_L1,uic $(uifile),=> $$@)
261 $$(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
262
263$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
264 $$(call MSG_L1,uic $(uifile),=> $$@)
265 $$(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
266
267$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
268 $$(call MSG_L1,moc $(uihdr),=> $$@)
269 $$(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
270
271endef
272
273## Generate rules for generating the Qt source for a target.
274# @param $target Target name.
275define def_qt_gen_src
276# moc srcs from hdrs with Q_OBJECT
277$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
278# moc includes from srcs with Q_OBJECT
279$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
280# moc includes from UI headers with Q_OBJECT
281$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
282# ui
283$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
284# dirs
285$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
286 $$(call MSG_L2,Creating directory $$@)
287 $$(QUIET)$(MKDIR) -p $$@
288
289endef
290
291# Generate Qt sources.
292$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
293
294
295# Generate COM Wrappers
296.NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
297
298$(WRAPPERSINCFILE): $(WRAPPERSFILE)
299
300$(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
301 $(call MSG_L1,xsltproc $<,=> $@)
302 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
303
304$(call DIRDEP,$(PATH_VirtualBox)/include/):
305 $(call MSG_L2,Creating directory $@)
306 $(QUIET)$(MKDIR) -p $@
307
308# this is actually necessary only for Win32 target with disabled dependencies
309define def_wrapper_deps
310$(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
311endef
312
313$(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
314
315# static images are imported from VBoxUI.pro as IMAGES
316
317$(PATH_VirtualBox)/ui/vbox_image_collection.txt: Makefile VBoxUI.pro $(IMAGES)
318 @echo " \
319 $(IMAGES) \
320 " > $@
321
322$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
323 $(call MSG_L1,uic $<,=> $@)
324 $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $<
325
326
327#
328# Translation stuff
329#
330
331VirtualBox_TRANSLATIONS = \
332 nls/VirtualBox_de.ts
333
334updatenls:
335 $(VBOX_LUPDATE) $(VirtualBox_SOURCES) $(VirtualBox_QT_MOCHDRS) $(VirtualBox_GENHDRS) -ts $(VirtualBox_TRANSLATIONS)
336
337
338#
339# Hand made dependencies go here
340#
341$(PATH_VirtualBox)/gen/ui/VBoxNewVMWzd$(SUFF_OBJ): $(PATH_VirtualBox)/ui/VBoxNewVMWzd.h $(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.h
342$(PATH_VirtualBox)/gen/ui/VBoxDiskImageManagerDlg$(SUFF_OBJ): ui/VBoxDiskImageManagerDlg.ui $(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
343$(PATH_VirtualBox)/gen/ui/VBoxCloseVMDlg$(SUFF_OBJ): $(PATH_VirtualBox)/ui/VBoxCloseVMDlg.h
344
345
346test:
347 echo $(VirtualBox_GENSRCS) | sed -e "s/ /\n/g"
348
349testwrappers: $(WRAPPERSFILE)
350
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