VirtualBox

source: vbox/trunk/Makefile.kmk@ 5699

Last change on this file since 5699 was 5598, checked in by vboxsync, 17 years ago

*qt*.lib/dll.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.5 KB
Line 
1# $Id: Makefile.kmk 5598 2007-11-01 01:18:09Z vboxsync $
2## @file
3# Top level makefile.
4#
5
6#
7# Copyright (C) 2006-2007 innotek GmbH
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 as published by the Free Software Foundation,
13# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14# distribution. VirtualBox OSE is distributed in the hope that it will
15# be useful, but WITHOUT ANY WARRANTY of any kind.
16
17DEPTH = .
18include $(PATH_KBUILD)/header.kmk
19
20ifdef VBOX_WITH_DOCS
21 SUBDIRS = doc/manual
22endif
23SUBDIRS += src
24
25#
26# Install external binaries (mostly redistributable parts of tools we use).
27# This must be done *before* we build the manual.
28#
29# To avoid dragging in unnecessary tools and sdks here, we don't use the .win
30# and .linux property suffixes.
31#
32INSTALLS = bin
33
34bin_INST = $(INST_BIN)
35
36# The SDL DLLs
37ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
38 ifneq ($(VBOX_WITH_VBOXSDL)$(VBOX_WITH_VBOXBFE),)
39 include $(PATH_KBUILD)/sdks/LIBSDL.kmk
40 bin_SOURCES += \
41 $(DLL_SDK_LIBSDL_SDL)
42 ifdef VBOX_WITH_SECURELABEL
43 bin_SOURCES += \
44 $(DLL_SDK_LIBSDL_SDLTTF)
45 endif
46 ifeq ($(BUILD_TARGET),os2)
47 bin_SOURCES += \
48 $(DLL_SDK_LIBSDL_FSLIB)
49 endif
50 endif
51endif
52
53
54# The Qt DLLs.
55ifneq ($(VBOX_WITH_QTGUI),)
56 ifeq ($(BUILD_TARGET),win)
57 #include $(PATH_KBUILD)/sdks/QT3.kmk
58 #bin_SOURCES += \
59 # $(DLL_SDK_QT3_QT)
60 ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
61 VBOX_DLL_QT ?= $(VBOX_PATH_QT)/bin/qt-mt333.dll
62 else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
63 VBOX_DLL_QT ?= $(PATH_DEVTOOLS)/win.amd64/Qt/v3.3.8/lib/qt-mt338.dll=>qt-mt338.dll
64 endif
65 ifdef VBOX_DLL_QT
66 bin_SOURCES += \
67 $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
68 endif
69 else ifeq ($(BUILD_TARGET),os2)
70 VBOX_DLL_QT ?= $(lastword $(sort $(wildcard $(VBOX_PATH_QT)/bin/*qt*.dll)))
71 ifneq ($(strip $(VBOX_DLL_QT)),)
72 bin_SOURCES += \
73 $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
74 endif
75 else ifeq ($(VBOX_MUST_INSTALL_LIB_QT),1)
76 bin_SOURCES += \
77 $(LIB_QT)
78 endif
79endif
80
81
82# The compiler runtime DLLs.
83ifeq ($(BUILD_TARGET).$(VBOX_WITHOUT_COMPILER_REDIST),win.)
84 ifdef VBOX_USE_VCC80
85 include $(PATH_KBUILD)/tools/VCC80X86.kmk
86 include $(PATH_KBUILD)/tools/VCC80AMD64.kmk
87 bin_SOURCES.x86 += \
88 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
89 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcr80.dll=>Microsoft.VC80.CRT/msvcr80.dll \
90 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcp80.dll=>Microsoft.VC80.CRT/msvcp80.dll \
91 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>testcase/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
92 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcr80.dll=>testcase/Microsoft.VC80.CRT/msvcr80.dll \
93 $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcp80.dll=>testcase/Microsoft.VC80.CRT/msvcp80.dll
94 bin_SOURCES.amd64 += \
95 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
96 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcr80.dll=>Microsoft.VC80.CRT/msvcr80.dll \
97 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcp80.dll=>Microsoft.VC80.CRT/msvcp80.dll \
98 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>testcase/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
99 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcr80.dll=>testcase/Microsoft.VC80.CRT/msvcr80.dll \
100 $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcp80.dll=>testcase/Microsoft.VC80.CRT/msvcp80.dll
101 endif
102 ifndef VBOX_USE_VCC80
103 VBOX_INSTALL_VCC70_RT = 1
104 endif
105 ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
106 VBOX_INSTALL_VCC70_RT = 1
107 endif
108 ifdef VBOX_INSTALL_VCC70_RT
109 include $(PATH_KBUILD)/tools/VCC70.kmk
110 ## @todo Move these defines to VCC70.
111 DLL_TOOL_VCC70_MSVCR71 ?= $(PATH_TOOL_VCC70)/bin/msvcr71.dll
112 ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCR71)),)
113 bin_SOURCES += \
114 $(DLL_TOOL_VCC70_MSVCR71)=>msvcr71.dll \
115 $(DLL_TOOL_VCC70_MSVCR71)=>testcase/msvcr71.dll
116 endif
117 DLL_TOOL_VCC70_MSVCP71 ?= $(PATH_TOOL_VCC70)/bin/msvcp71.dll
118 ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCP71)),)
119 bin_SOURCES += \
120 $(DLL_TOOL_VCC70_MSVCP71)=>msvcp71.dll \
121 $(DLL_TOOL_VCC70_MSVCP71)=>testcase/msvcp71.dll
122 endif
123 DLL_TOOL_VCC70_MSVCRT ?= $(PATH_TOOL_VCC70)/bin/msvcrt.dll
124 ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCRT)),)
125 bin_SOURCES += \
126 $(DLL_TOOL_VCC70_MSVCRT)=>msvcrt.dll \
127 $(DLL_TOOL_VCC70_MSVCRT)=>testcase/msvcrt.dll
128 endif
129 endif
130endif
131
132# The Xerces DLL
133ifneq ($(DLL_SDK_VBOX_XERCES_XERCES),)
134 bin_SOURCES += $(DLL_SDK_VBOX_XERCES_XERCES)
135endif
136
137# The Xalan DLLs
138ifneq ($(DLL_SDK_VBOX_XALAN_XALAN),)
139 bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN)
140endif
141ifneq ($(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES),)
142 bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES)
143endif
144
145
146#
147# Install staged binaries on platforms where we can't cross
148# compile things.
149#
150ifneq ($(filter-out linux win l4, $(BUILD_TARGET)),)
151 VBOX_PATH_STAGED ?= .
152
153 # Additions.
154 ifndef VBOX_WITH_LINUX_ADDITIONS
155 ifndef VBOX_WITH_WIN32_ADDITIONS
156 ifneq ($(wildcard $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso),)
157 INSTALLS += staged-additions
158 staged-additions_INST = $(INST_ADDITIONS)
159 staged-additions_MODE = 0644
160 staged-additions_SOURCES = $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso
161 endif
162 endif
163 endif
164
165 # guesttool.exe
166 ifndef VBOX_WITH_WIN32_ADDITIONS
167 ifneq ($(wildcard $(VBOX_PATH_STAGED)/guesttool.exe),)
168 INSTALLS += staged-guesttool
169 staged-guesttool_INST = $(INST_BIN)
170 staged-guesttool_SOURCES = $(VBOX_PATH_STAGED)/guesttool.exe
171 endif
172 endif
173
174endif
175
176
177
178include $(PATH_KBUILD)/footer.kmk
179
180
181#
182# Generate documentation.
183# (This should be converted into a separate pass or merged with an existing one later.)
184#
185docs: docs.Core
186 $(MAKE) -C src/VBox/Main docs
187 $(MAKE) -C src/VBox/Runtime docs
188
189docs.Core: $(PATH_TARGET)/docs.Core
190
191
192#
193# The core (VMM+Runtime+Devices) documentation.
194#
195$(PATH_TARGET)/docs.Core: \
196 Doxyfile.Core \
197 | $(call DIRDEP, $(PATH_TARGET)) \
198 $(call DIRDEP, $(PATH_OUT)/docs/Core)
199 $(RM) -f $(wildcard $(PATH_OUT)/docs/Core/html/*)
200 PATH_OUT="$(PATH_OUT)" PATH_TARGET="$(PATH_TARGET)" doxygen Doxyfile.Core
201
202$(call DIRDEP, $(PATH_OUT)/docs/Core):
203 $(MKDIR) -p $@
204
205
206#
207# Generate x86.mac and err.mac.
208#
209incs:
210 $(SED) -f include/VBox/err.sed include/VBox/err.h > include/VBox/err.mac
211 echo '%include "iprt/err.mac"' >> include/VBox/err.mac
212 $(SED) -f include/VBox/err.sed include/iprt/err.h > include/iprt/err.mac
213 $(SED) -e '/__VBox_x86_h__/d' -e '/#define/!d' -e 's/#define/%define/' include/VBox/x86.h > include/VBox/x86.mac
214
215
216#
217# Generate Visual SlickEdit tagging #defines.
218#
219vslick.h: include/VBox/cdefs.h Makefile
220 echo '// autogenerated' > $@.tmp
221 #echo '#define __BEGIN_DECLS ' >> $@.tmp
222 #echo '#define __END_DECLS ' >> $@.tmp
223
224 echo '#define ATL_NO_VTABLE ' >> $@.tmp
225 echo '#define BEGIN_COM_MAP(a) ' >> $@.tmp
226 echo '#define END_COM_MAP(a) ' >> $@.tmp
227
228 echo '#define CHECKREADY if(!isReady()) return E_UNEXPECTED; ' >> $@.tmp
229 echo '#define COM_DECL_READONLY_ENUM_AND_COLLECTION(a) ' >> $@.tmp
230 echo '#define COM_INTERFACE_ENTRY(a) ' >> $@.tmp
231 echo '#define COMGETTER(n) Get##n ' >> $@.tmp
232 echo '#define COMSETTER(n) Set##n ' >> $@.tmp
233 echo '#define DECLARE_NOT_AGGREGATABLE(a) ' >> $@.tmp
234 echo '#define DECLARE_PROTECT_FINAL_CONSTRUCT(a) ' >> $@.tmp
235 echo '#define NS_DECL_ISUPPORTS ' >> $@.tmp
236 echo '#define NS_IMETHOD NS_IMETHOD_(nsresult) ' >> $@.tmp
237 echo '#define NS_IMETHOD_(type) type ' >> $@.tmp
238 echo '#define PARSERS_EXPORT ' >> $@.tmp
239 echo '#define SAX_EXPORT ' >> $@.tmp
240 echo '#define STDMETHOD(a) NS_IMETHOD a ' >> $@.tmp
241 echo '#define XERCES_CPP_NAMESPACE_BEGIN ' >> $@.tmp
242 echo '#define XERCES_CPP_NAMESPACE_END ' >> $@.tmp
243
244 echo '#define CTXAllSUFF(var) var##R3 ' >> $@.tmp
245 echo '#define CTXSUFF(var) var##HC ' >> $@.tmp
246 echo '#define OTHERCTXSUFF(var) var##GC ' >> $@.tmp
247 echo '#define CTXALLMID(first, last) first##R3##last ' >> $@.tmp
248 echo '#define CTXMID(first, last) first##HC##last ' >> $@.tmp
249 echo '#define OTHERCTXMID(first, last) first##GC##last ' >> $@.tmp
250 echo '#define CTXTYPE(GCType, R3Type, R0Type) R3Type ' >> $@.tmp
251 echo '#define GCPTRTYPE(GCType) GCType ' >> $@.tmp
252 echo '#define GCTYPE(GCType, HCType) GCType ' >> $@.tmp
253 echo '#define HCPTRTYPE(HCType) HCType ' >> $@.tmp
254 echo '#define R0PTRTYPE(R3Type) R3Type ' >> $@.tmp
255 echo '#define R3PTRTYPE(R0Type) R0Type ' >> $@.tmp
256 echo '#define RT_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> $@.tmp
257 echo '#define RT_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> $@.tmp
258 echo '#define RT_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> $@.tmp
259 echo '#define RTCALL' >> $@.tmp
260 echo '#define DECLINLINE(type) inline type ' >> $@.tmp
261
262 echo '#define PDM_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> $@.tmp
263 echo '#define PDM_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> $@.tmp
264 echo '#define PDM_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> $@.tmp
265 echo '#define PDMDEVINSINT_DECLARED 1' >> $@.tmp
266 echo '#define VBOXCALL' >> $@.tmp
267
268 $(SED) -e '/__cdecl/d' \
269 -e '/^ *# *define.*DECL/!d' \
270 -e '/DECLS/d' \
271 -e '/_SRC_POS_DECL/d' \
272 -e '/declspec/d' \
273 -e 's/# */#/g' \
274 -e 's/ */ /g' \
275 -e '/(type) DECLEXPORT/d' \
276 -e 's/ *VBOXCALL//' \
277 -e 's/ *RTCALL//' \
278 -e 's/(type) DECLIMPORT(type)/(type) type/' \
279 -e '/ DECLASM(type) type/d' \
280 -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
281 -e '/define *DECLINLINE(type)/d' \
282 \
283 include/iprt/cdefs.h \
284 include/VBox/cdefs.h \
285 >> $@.tmp
286 sort $@.tmp | sort | sed -e 's/$$/\n/' > $@.tmp2
287 $(MV) -f $@.tmp2 $@
288 $(RM) -f $@.tmp $@.tmp2 $@.tmp3
289
290
291## add tools fetching to the 'up' / 'update' target.
292up update::
293# this doesn't work of course if kmk is updated: svn$(HOSTSUFF_EXE) up $(PATH_KBUILD)
294ifndef VBOX_OSE
295 $(MAKE) -C tools fetch
296else
297 $(MAKE) -C tools -f Makefile-ose.kmk fetch
298endif
299
300#
301# Generate VirtualBox-OSE-x.x.x.tar.bz2 tarballs for distribution
302#
303# - includes kBuild
304# - must be executed on an OSE checkout
305#
306
307# the path where to store the tarball
308TARBALLPATH ?= $(shell cd $(PATH_ROOT)/..; pwd)
309#TARBALLPATH ?= $(abspath $(PATH_ROOT)/..) - this should also do the trick without spawning a shell.
310# the root directory inside the tarball
311TARBALLROOT ?= VirtualBox-$(VBOX_VERSION_STRING)
312# the name of the tarball file
313TARBALLNAME ?= VirtualBox-$(VBOX_VERSION_STRING).tar.bz2
314snapshot:
315 @$(call MSG_L1,Creating tarball $(TARBALLPATH)/$(TARBALLNAME))
316 @if [ -d "$(PATH_ROOT)/src/VBox/Devices/USB" ]; then echo; echo "Found USB stuff, refused to build OSE tarball!"; echo; exit 1; fi
317 $(QUIET)$(MKDIR) -p $(TARBALLPATH)
318 $(QUIET)$(RM) -f $(wildcard $(TARBALLPATH)/VirtualBox*)
319 $(QUIET)$(LN_SYMLINK) $(PATH_ROOT) $(TARBALLPATH)/$(TARBALLROOT)
320 $(QUIET)tar -cjh --owner 0 --group 0 --totals \
321 --exclude=.svn \
322 --exclude=$(TARBALLROOT)/out \
323 --exclude=$(TARBALLROOT)/env.sh \
324 --exclude=$(TARBALLROOT)/configure.log \
325 --exclude=$(TARBALLROOT)/AutoConfig.kmk \
326 --exclude=$(TARBALLROOT)/LocalConfig.kmk \
327 -C $(TARBALLPATH) \
328 -f $(TARBALLPATH)/$(TARBALLNAME) \
329 $(TARBALLROOT)
330 $(QUIET)$(RM) $(TARBALLPATH)/$(TARBALLROOT)
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