VirtualBox

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

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

Network Interfaces Settings rework:

  1. Network Interfaces List with Add/Remove interface buttons is currently accessible in any “attached to” adapter state (not only in Attached to Host Interface case).
  2. Add/Remove keys changed to auto-raise tool-buttons. These keys are currently situated at the right vertical tool-bar near the interface’s list.
  3. Add Interface functionality is done through additional modal “Add Host Interface” Dialog.
  4. Remove Interface functionality has additional message-box with Ok/Cancel question about removing selected interface.
  5. Synchronization between all the adaptors interface’s lists done for add/remove functionality.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.4 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
21ifeq ($(BUILD_TARGET),linux)
22XKEYBOARD_NEW := 1
23endif
24
25# include qmake project file
26include VBoxUI.pro
27
28# QDesigner UI sources
29VirtualBox_QT_UISRCS := $(FORMS)
30
31# reset things to avoid possible conflicts with kBuild
32TEMPLATE :=
33LANGUAGE :=
34FORMS :=
35
36
37DEPTH = ../../../..
38include $(PATH_KBUILD)/header.kmk
39
40PROGRAMS = VirtualBox
41
42INSTALLS.darwin = VirtualBox.app
43
44
45VirtualBox_TEMPLATE = VBOXQTGUIEXE
46VirtualBox_SDKS.win = WINPSDK DXSDK
47VirtualBox_SDKS.linux = LIBSDL
48
49
50# bird:
51# this is a sketch which later can be moved into kBuild core stuff perhaps.
52# I might not have got the logic in what causes what to be generated right
53# feel free to help.
54
55# QDesigner UI sources are imported from VBoxUI.pro as VirtualBox_QT_UISRC
56
57# Headers containing definitions of classes that use the Q_OBJECT macro
58VirtualBox_QT_MOCHDRS = \
59 include/QIWidgetValidator.h \
60 include/QIHotKeyEdit.h \
61 include/QIStatusBar.h \
62 include/QIStateIndicator.h \
63 include/QIMessageBox.h \
64 include/QIRichLabel.h \
65 include/VMGlobalSettings.h \
66 include/VBoxGlobal.h \
67 include/VBoxMediaComboBox.h \
68 include/VBoxSelectorWnd.h \
69 include/VBoxConsoleWnd.h \
70 include/VBoxConsoleView.h \
71 include/VBoxProblemReporter.h
72
73# Sources containing local definitions of classes that use the Q_OBJECT macro
74VirtualBox_QT_MOCSRCS = src/VBoxSelectorWnd.cpp
75ifneq ($(BUILD_TARGET),win)
76VirtualBox_QT_MOCSRCS += src/COMDefs.cpp
77endif
78
79# UI headers (ui.h) containing local definitions of classes that use the Q_OBJECT macro
80VirtualBox_QT_MOCUIHDRS = \
81 ui/VBoxVMSettingsDlg.ui.h \
82 ui/VBoxSharedFoldersSettings.ui.h
83ifeq ($(BUILD_TARGET),win)
84VirtualBox_QT_MOCUIHDRS += ui/VBoxVMNetworkSettings.ui.h
85endif
86
87VirtualBox_GENSRCS = \
88 $(foreach moc,$(notdir $(basename $(VirtualBox_QT_MOCHDRS))), $(PATH_VirtualBox)/moc/moc_$(moc).cpp) \
89 $(foreach ui,$(notdir $(basename $(VirtualBox_QT_UISRCS))), $(PATH_VirtualBox)/ui/$(ui).cpp $(PATH_VirtualBox)/moc/moc_$(ui).cpp) \
90 $(PATH_VirtualBox)/ui/vbox_image_collection.cpp
91
92VirtualBox_GENHDRS = \
93 $(foreach mocui,$(basename $(VirtualBox_QT_MOCUIHDRS)), $(PATH_VirtualBox)/moc/$(mocui).moc) \
94 $(foreach moc,$(basename $(VirtualBox_QT_MOCSRCS)), $(PATH_VirtualBox)/moc/$(moc).moc) \
95 $(foreach ui,$(basename $(VirtualBox_QT_UISRCS)), $(PATH_VirtualBox)/$(ui).h)
96
97
98VirtualBox_SOURCES = \
99 $(VirtualBox_GENSRCS) \
100 src/main.cpp \
101 src/COMDefs.cpp \
102 src/QIWidgetValidator.cpp \
103 src/QIHotKeyEdit.cpp \
104 src/QIStateIndicator.cpp \
105 src/QIStatusBar.cpp \
106 src/QIMessageBox.cpp \
107 src/QIRichLabel.cpp \
108 src/VMGlobalSettings.cpp \
109 src/VBoxGlobal.cpp \
110 src/VBoxMediaComboBox.cpp \
111 src/VBoxProblemReporter.cpp \
112 src/VBoxSelectorWnd.cpp \
113 src/VBoxConsoleView.cpp \
114 src/VBoxConsoleWnd.cpp \
115 src/VBoxVMListBox.cpp \
116 src/VBoxFrameBuffer.cpp
117
118VirtualBox_SOURCES.win += \
119 src/win32/VirtualBox.rc
120
121VirtualBox_SOURCES.win += \
122 src/VBoxFBDDRAW.cpp
123
124ifdef XKEYBOARD_NEW
125VirtualBox_SOURCES.linux = \
126 src/linux/XKeyboardNew.cpp
127else
128VirtualBox_SOURCES.linux = \
129 src/linux/XKeyboard.cpp \
130 src/linux/keyboard.c
131endif
132
133VirtualBox_SOURCES.darwin = \
134 src/darwin/DarwinKeyboard.cpp \
135 src/darwin/DarwinCursor.cpp
136
137VirtualBox_DEFS = VBOX_GUI_SEPARATE_VM_PROCESS
138VirtualBox_DEFS.debug = VBOX_GUI_DEBUG VBOX_CHECK_STATE # QT_FATAL_ASSERT
139VirtualBox_DEFS.darwin = VBOX_GUI_USE_QIMAGE
140VirtualBox_DEFS.linux = VBOX_GUI_USE_SDL
141VirtualBox_DEFS.win = VBOX_GUI_USE_QIMAGE UNICODE QT_DLL
142#ifndef VBOX_OSE
143 VirtualBox_DEFS.darwin += VBOX_WITH_HACKED_QT
144#endif
145ifneq ($(BUILD_TYPE),release)
146 # non-release builds has some extra features.
147 VirtualBox_DEFS += VBOX_GUI_USE_REFRESH_TIMER VBOX_WITH_DEBUGGER_GUI_MENU
148 VirtualBox_DEFS.win += VBOX_GUI_USE_DDRAW
149 VirtualBox_DEFS.linux += VBOX_GUI_USE_QIMAGE
150endif
151ifdef VBOX_WITH_ALSA
152 VirtualBox_DEFS += VBOX_WITH_ALSA
153endif
154ifdef VBOX_OSE
155 VirtualBox_DEFS += VBOX_OSE
156endif
157
158VirtualBox_INCS = \
159 ./include \
160 $(PATH_VirtualBox)/ui \
161 $(PATH_VirtualBox)/moc \
162 $(PATH_VirtualBox)/include \
163
164
165ifeq ($(BUILD_TYPE),release)
166 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
167else
168 VirtualBox_LDFLAGS.linux+= -rdynamic # for backtrace_symbols()
169 ifeq ($(USERNAME),dmik)
170 VirtualBox_LDFLAGS.win += /SUBSYSTEM:windows
171 else
172 VirtualBox_LDFLAGS.win += /SUBSYSTEM:console
173 endif
174endif
175VirtualBox_LDFLAGS.darwin = -framework IOKit
176VirtualBox_LIBS.win = \
177 $(PATH_SDK_WINPSDK_LIB)/Htmlhelp.Lib \
178 $(PATH_SDK_DXSDK_LIB)/ddraw.lib \
179 $(PATH_SDK_DXSDK_LIB)/dxguid.lib
180
181ifdef VBOX_WITH_DEBUGGER_GUI
182 ifeq ($(BUILD_TARGET),win)
183 VirtualBox_LIBS += $(PATH_LIB)/VBoxDbg$(VBOX_SUFF_LIB)
184 else
185 VirtualBox_LIBS += $(PATH_DLL)/VBoxDbg$(VBOX_SUFF_DLL)
186 endif
187endif
188
189WRAPPERSFILE = $(PATH_VirtualBox)/include/COMWrappers.h
190WRAPPERSINCFILE = include/COMDefs.h
191WRAPPERSTEMPLATE = include/COMWrappers.xsl
192XIDLFILE = ../../Main/idl/VirtualBox.xidl
193
194
195# generated files we need to clean manually
196OTHER_CLEAN = \
197 $(VirtualBox_GENSRCS) \
198 $(VirtualBox_GENHDRS) \
199 $(PATH_VirtualBox)/ui/vbox_image_collection.txt \
200 $(WRAPPERSFILE)
201
202
203#
204# On Mac OS X (darwin) we need to install icon resources and compusory bundle contents.
205#
206VirtualBox.app_INST = $(INST_VIRTUALBOX)Contents/
207VirtualBox.app_MODE = 644
208VirtualBox.app_SOURCES = \
209 src/darwin/PkgInfo \
210 $(PATH_TARGET)/Info.plist \
211 images/VirtualBox.icns=>Resources/virtualbox.icns
212
213$(PATH_TARGET)/Info.plist: src/darwin/Info.plist $(VBOX_VERSION_MK) | $(call DIRDEP,$(PATH_TARGET))
214 $(call MSG_L1,Generating $@)
215 $(xQUIET)$(RM) -f $@
216 $(xQUIET)$(SED) \
217 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
218 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
219 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
220 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
221 $< > $@
222
223
224include $(PATH_KBUILD)/footer.kmk
225
226
227#
228# Source file generation rules
229#
230
231## Generate a rule to create a MOC source file from a header containing
232# classes that use the Q_OBJECT macro.
233# @param $mochdr the header file with Q_OBJECT
234define def_qt_gen_src_moc
235$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(mochdr))).cpp)
236$$(mocsrc): $(mochdr)
237 $$(call MSG_L1,moc $(mochdr),=> $$@)
238 $$(QUIET)$(MKDIR) -p $$(@D)
239 $$(QUIET)$(VBOX_MOC) $(mochdr) -o $(mocsrc)
240
241endef
242
243## Generate a rule to create a MOC include file from a source containing
244# local classes that use the Q_OBJECT macro. This include is then included
245# by that source, so it must be generated before the source gets compiled.
246# @param $mocsrc the source file with Q_OBJECT
247define def_qt_gen_inc_moc
248$(eval mocobj := $(PATH_$(target)_$(mocsrc))/$(notdir $(basename $(mocsrc)))$(SUFF_OBJ))
249$(eval mocinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocsrc))).moc)
250
251$$(mocobj): $(mocinc)
252
253.NOTPARALLEL: $$(mocinc)
254$$(mocinc): $(mocsrc)
255 $$(call MSG_L1,moc $(mocsrc),=> $$@)
256 $$(QUIET)$(MKDIR) -p $$(@D)
257 $$(QUIET)$(VBOX_MOC) -i $(mocsrc) -o $(mocinc)
258
259endef
260
261## Generate a rule to create a MOC include file from a UI header (ui.h) containing
262# local classes that use the Q_OBJECT macro. This include is then included
263# by that header, so it must be generated before the UI source gets compiled.
264# @param $mocuihdr the UI header file with Q_OBJECT
265define def_qt_gen_inc_mocuihdr
266$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(basename $(mocuihdr)))).cpp)
267$(eval uiobj := $(PATH_$(target)_$(uisrc))/$(notdir $(basename $(uisrc)))$(SUFF_OBJ))
268$(eval mocuiinc := $(PATH_$(target))/moc/$(notdir $(basename $(mocuihdr))).moc)
269
270.NOTPARALLEL: $$(mocuiinc)
271$$(uisrc): $(mocuiinc)
272$$(mocuiinc): $(mocuihdr)
273 $$(call MSG_L1,moc $(mocuihdr),=> $$@)
274 $$(QUIET)$(MKDIR) -p $$(@D)
275 $$(QUIET)$(VBOX_MOC) -i $(mocuihdr) -o $(mocuiinc)
276
277endef
278
279define def_qt_gen_src_ui
280$(eval uisrc := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).cpp)
281$(eval uihdr := $(PATH_$(target))/ui/$(notdir $(basename $(uifile))).h)
282$(eval mocsrc := $(PATH_$(target))/moc/moc_$(notdir $(basename $(uifile))).cpp)
283
284.NOTPARALLEL: $$(uihdr)
285$$(uihdr): $(uifile) | $(call DIRDEP,$(dir $(uihdr)))
286 $$(call MSG_L1,uic $(uifile),=> $$@)
287 $$(QUIET)$(VBOX_UIC) $(uifile) -o $(uihdr)
288
289$$(uisrc): $(uihdr) $(uifile) $(wildcard $(uifile).h) | $(call DIRDEP,$(dir $(uisrc)))
290 $$(call MSG_L1,uic $(uifile),=> $$@)
291 $$(QUIET)$(VBOX_UIC) $(uifile) -i $(uihdr) -o $(uisrc)
292
293$$(mocsrc): $(uihdr) | $(call DIRDEP,$(dir $(mocsrc)))
294 $$(call MSG_L1,moc $(uihdr),=> $$@)
295 $$(QUIET)$(VBOX_MOC) $(uihdr) -o $(mocsrc)
296
297endef
298
299## Generate rules for generating the Qt source for a target.
300# @param $target Target name.
301define def_qt_gen_src
302# moc srcs from hdrs with Q_OBJECT
303$(foreach mochdr,$($(target)_QT_MOCHDRS),$(eval $(def_qt_gen_src_moc)))
304# moc includes from srcs with Q_OBJECT
305$(foreach mocsrc,$($(target)_QT_MOCSRCS),$(eval $(def_qt_gen_inc_moc)))
306# moc includes from UI headers with Q_OBJECT
307$(foreach mocuihdr,$($(target)_QT_MOCUIHDRS),$(eval $(def_qt_gen_inc_mocuihdr)))
308# ui
309$(foreach uifile,$($(target)_QT_UISRCS) ,$(eval $(def_qt_gen_src_ui)))
310# dirs
311$(call DIRDEP,$(PATH_$(target))/ui/) $(call DIRDEP,$(PATH_$(target))/moc/):
312 $$(call MSG_L2,Creating directory $$@)
313 $$(QUIET)$(MKDIR) -p $$@
314
315endef
316
317# Generate Qt sources.
318$(foreach target,VirtualBox,$(eval $(def_qt_gen_src)))
319
320
321# Generate COM Wrappers
322.NOTPARALLEL: $(WRAPPERSFILE) $(WRAPPERSINCFILE)
323
324$(WRAPPERSINCFILE): $(WRAPPERSFILE)
325
326$(WRAPPERSFILE): $(XIDLFILE) $(WRAPPERSTEMPLATE) | $(call DIRDEP,$(PATH_VirtualBox)/include/)
327 $(call MSG_L1,xsltproc $<,=> $@)
328 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(WRAPPERSTEMPLATE) $<
329
330$(call DIRDEP,$(PATH_VirtualBox)/include/):
331 $(call MSG_L2,Creating directory $@)
332 $(QUIET)$(MKDIR) -p $@
333
334# this is actually necessary only for Win32 target with disabled dependencies
335define def_wrapper_deps
336$(src): $(WRAPPERSFILE) $(WRAPPERSINCFILE)
337endef
338
339$(foreach src,$(VirtualBox_SOURCES),$(eval $(def_wrapper_deps)))
340
341# static images are imported from VBoxUI.pro as IMAGES
342
343$(PATH_VirtualBox)/ui/vbox_image_collection.txt: Makefile VBoxUI.pro $(IMAGES)
344 @echo " \
345 $(IMAGES) \
346 " > $@
347
348$(PATH_VirtualBox)/ui/vbox_image_collection.cpp: $(PATH_VirtualBox)/ui/vbox_image_collection.txt
349 $(call MSG_L1,uic $<,=> $@)
350 $(QUIET)$(VBOX_UIC) -o $@ -embed VBoxGUI -f $<
351
352
353#
354# Translation stuff
355#
356
357VirtualBox_TRANSLATIONS = \
358 nls/VirtualBox_de.ts
359
360updatenls:
361 $(VBOX_LUPDATE) $(VirtualBox_SOURCES) $(VirtualBox_QT_MOCHDRS) $(VirtualBox_GENHDRS) -ts $(VirtualBox_TRANSLATIONS)
362
363
364#
365# Hand made dependencies go here
366#
367$(PATH_VirtualBox)/gen/ui/VBoxNewVMWzd$(SUFF_OBJ): $(PATH_VirtualBox)/ui/VBoxNewVMWzd.h $(PATH_VirtualBox)/ui/VBoxDiskImageManagerDlg.h
368$(PATH_VirtualBox)/gen/ui/VBoxDiskImageManagerDlg$(SUFF_OBJ): ui/VBoxDiskImageManagerDlg.ui $(PATH_VirtualBox)/ui/VBoxNewHDWzd.h
369$(PATH_VirtualBox)/gen/ui/VBoxCloseVMDlg$(SUFF_OBJ): $(PATH_VirtualBox)/ui/VBoxCloseVMDlg.h
370
371
372test:
373 echo $(VirtualBox_GENSRCS) | sed -e "s/ /\n/g"
374
375testwrappers: $(WRAPPERSFILE)
376
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