VirtualBox

source: vbox/trunk/Makefile.kmk@ 3282

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

XPCOM: Ported necessary bits of IPC/DConnect tp OS/2.

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