1 | # $Id: Makefile.kmk 39535 2011-12-05 15:42:26Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for Python bindings
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2010 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 | ifdef VBOX_WITH_MULTIVERSION_PYTHON
|
---|
22 | VBOX_MULTIPYTHON = 1
|
---|
23 | else
|
---|
24 | VBOX_MULTIPYTHON = 0
|
---|
25 | endif
|
---|
26 |
|
---|
27 | #
|
---|
28 | # List of supported Python versions, defining a number of
|
---|
29 | # VBOX_PYTHON[25|26|27|28|DEF]_[INC|LIB] variables which get picked up below.
|
---|
30 | #
|
---|
31 | ifeq ($(KBUILD_TARGET),darwin) # Relatively predictable, don't script.
|
---|
32 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
33 | VBOX_PYTHON25_INC = $(VBOX_PATH_MACOSX_SDK)/usr/include/python2.5
|
---|
34 | VBOX_PYTHON25_LIB = $(VBOX_PATH_MACOSX_SDK)/usr/lib/libpython2.5.dylib
|
---|
35 | endif
|
---|
36 | if !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) \
|
---|
37 | && ( !defined(VBOX_OSE) \
|
---|
38 | || "$(wildcard $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib)" != "")
|
---|
39 | VBOX_PYTHON26_INC = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/include/python2.6
|
---|
40 | VBOX_PYTHON26_LIB = $(VBOX_PATH_MACOSX_SDK_10_6)/usr/lib/libpython2.6.dylib
|
---|
41 | endif
|
---|
42 | if !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7) \
|
---|
43 | && ( defined(VBOX_NOT_OSE_LATER_SOMETIME) \
|
---|
44 | || "$(wildcard $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib)" != "")
|
---|
45 | VBOX_PYTHON27_INC = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/include/python2.7
|
---|
46 | VBOX_PYTHON27_LIB = $(VBOX_PATH_MACOSX_SDK_10_7)/usr/lib/libpython2.7.dylib
|
---|
47 | endif
|
---|
48 |
|
---|
49 | else
|
---|
50 | # Use the script.
|
---|
51 | $(eval $(subst |,$(NL),$(shell $(VBOX_BLD_PYTHON) \
|
---|
52 | $(PATH_SUB_CURRENT)/gen_python_deps.py \
|
---|
53 | $(KBUILD_TARGET) \
|
---|
54 | $(KBUILD_TARGET_ARCH) \
|
---|
55 | $(VBOX_MULTIPYTHON) )))
|
---|
56 | endif
|
---|
57 |
|
---|
58 | ifndef VBOX_ONLY_SDK
|
---|
59 |
|
---|
60 | #
|
---|
61 | # Base Python Client Module - the C++/XPCOM bits (not actually built).
|
---|
62 | #
|
---|
63 | VBoxPythonBase_TEMPLATE = XPCOM
|
---|
64 | VBoxPythonBase_CXXFLAGS = -Wno-write-strings
|
---|
65 | VBoxPythonBase_DLLSUFF.darwin = .so
|
---|
66 | VBoxPythonBase_DEFS = \
|
---|
67 | _IMPL_NS_COM \
|
---|
68 | _IMPL_NS_BASE \
|
---|
69 | EXPORT_XPTI_API \
|
---|
70 | EXPORT_XPT_API \
|
---|
71 | VBOX_PYXPCOM \
|
---|
72 | VBOX_WITH_XPCOM \
|
---|
73 | VBOX_PYXPCOM_VERSIONED
|
---|
74 | VBoxPythonBase_DEFS.debug = \
|
---|
75 | VBOX_DEBUG_LIFETIMES
|
---|
76 | VBoxPythonBase_INCS = \
|
---|
77 | src
|
---|
78 | VBoxPythonBase_SOURCES = \
|
---|
79 | src/module/_xpcom.cpp \
|
---|
80 | src/dllmain.cpp \
|
---|
81 | src/ErrorUtils.cpp \
|
---|
82 | src/PyGBase.cpp \
|
---|
83 | src/PyGInputStream.cpp \
|
---|
84 | src/PyGModule.cpp \
|
---|
85 | src/PyGStub.cpp \
|
---|
86 | src/PyGWeakReference.cpp \
|
---|
87 | src/PyIClassInfo.cpp \
|
---|
88 | src/PyIComponentManager.cpp \
|
---|
89 | src/PyIComponentManagerObsolete.cpp \
|
---|
90 | src/PyIEnumerator.cpp \
|
---|
91 | src/PyIID.cpp \
|
---|
92 | src/PyIInputStream.cpp \
|
---|
93 | src/PyIInterfaceInfo.cpp \
|
---|
94 | src/PyIInterfaceInfoManager.cpp \
|
---|
95 | src/PyISimpleEnumerator.cpp \
|
---|
96 | src/PyISupports.cpp \
|
---|
97 | src/PyIVariant.cpp \
|
---|
98 | src/Pyxpt_info.cpp \
|
---|
99 | src/TypeObject.cpp \
|
---|
100 | src/VariantUtils.cpp
|
---|
101 | VBoxPythonBase_LIBS = \
|
---|
102 | $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
|
---|
103 | $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
104 |
|
---|
105 |
|
---|
106 | ifdef VBOX_PYTHON23_INC
|
---|
107 | #
|
---|
108 | # Python 2.3 version
|
---|
109 | #
|
---|
110 | DLLS += VBoxPython2_3
|
---|
111 | VBoxPython2_3_EXTENDS = VBoxPythonBase
|
---|
112 | VBoxPython2_3_EXTENDS_BY = appending
|
---|
113 | VBoxPython2_3_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX104,)
|
---|
114 | VBoxPython2_3_INCS = $(VBOX_PYTHON23_INC)
|
---|
115 | VBoxPython2_3_LIBS = $(VBOX_PYTHON23_LIB)
|
---|
116 | endif
|
---|
117 |
|
---|
118 | ifdef VBOX_PYTHON24_INC
|
---|
119 | #
|
---|
120 | # Python 2.4 version
|
---|
121 | #
|
---|
122 | DLLS += VBoxPython2_4
|
---|
123 | VBoxPython2_4_EXTENDS = VBoxPythonBase
|
---|
124 | VBoxPython2_4_EXTENDS_BY = appending
|
---|
125 | VBoxPython2_4_INCS = $(VBOX_PYTHON24_INC)
|
---|
126 | VBoxPython2_4_LIBS = $(VBOX_PYTHON24_LIB)
|
---|
127 | endif
|
---|
128 |
|
---|
129 | ifdef VBOX_PYTHON25_INC
|
---|
130 | #
|
---|
131 | # Python 2.5 version
|
---|
132 | #
|
---|
133 | DLLS += VBoxPython2_5
|
---|
134 | VBoxPython2_5_EXTENDS = VBoxPythonBase
|
---|
135 | VBoxPython2_5_EXTENDS_BY = appending
|
---|
136 | VBoxPython2_5_TEMPLATE = XPCOM
|
---|
137 | VBoxPython2_5_INCS = $(VBOX_PYTHON25_INC)
|
---|
138 | VBoxPython2_5_LIBS = $(VBOX_PYTHON25_LIB)
|
---|
139 | endif
|
---|
140 |
|
---|
141 | ifdef VBOX_PYTHON26_INC
|
---|
142 | #
|
---|
143 | # Python 2.6 version
|
---|
144 | #
|
---|
145 | DLLS += VBoxPython2_6
|
---|
146 | VBoxPython2_6_EXTENDS = VBoxPythonBase
|
---|
147 | VBoxPython2_6_EXTENDS_BY = appending
|
---|
148 | VBoxPython2_6_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX106,)
|
---|
149 | VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
|
---|
150 | VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
|
---|
151 | endif
|
---|
152 |
|
---|
153 | ifdef VBOX_PYTHON27_INC
|
---|
154 | #
|
---|
155 | # Python 2.7 version
|
---|
156 | #
|
---|
157 | DLLS += VBoxPython2_7
|
---|
158 | VBoxPython2_7_EXTENDS = VBoxPythonBase
|
---|
159 | VBoxPython2_7_EXTENDS_BY = appending
|
---|
160 | VBoxPython2_7_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX107,)
|
---|
161 | VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
|
---|
162 | VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
|
---|
163 | endif
|
---|
164 |
|
---|
165 | ifdef VBOX_PYTHON28_INC
|
---|
166 | #
|
---|
167 | # Python 2.8 version
|
---|
168 | #
|
---|
169 | DLLS += VBoxPython2_8
|
---|
170 | VBoxPython2_8_EXTENDS = VBoxPythonBase
|
---|
171 | VBoxPython2_8_EXTENDS_BY = appending
|
---|
172 | VBoxPython2_8_INCS = $(VBOX_PYTHON28_INC)
|
---|
173 | VBoxPython2_8_LIBS = $(VBOX_PYTHON28_LIB)
|
---|
174 | endif
|
---|
175 |
|
---|
176 | ifdef VBOX_PYTHONDEF_INC
|
---|
177 | #
|
---|
178 | # Python without versioning
|
---|
179 | #
|
---|
180 | DLLS += VBoxPython
|
---|
181 | VBoxPython_EXTENDS = VBoxPythonBase
|
---|
182 | VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
|
---|
183 | VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
|
---|
184 | if "$(KBUILD_TARGET)" == "linux"
|
---|
185 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
|
---|
186 | else
|
---|
187 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
|
---|
188 | endif
|
---|
189 | endif
|
---|
190 |
|
---|
191 | endif # VBOX_ONLY_SDK
|
---|
192 |
|
---|
193 | #
|
---|
194 | # Install the python modules.
|
---|
195 | #
|
---|
196 | INSTALLS += VBoxPython-inst-py-xpcom
|
---|
197 | VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
|
---|
198 | VBoxPython-inst-py-xpcom_MODE = a+r,u+w
|
---|
199 | VBoxPython-inst-py-xpcom_SOURCES = \
|
---|
200 | vboxxpcom.py \
|
---|
201 | components.py \
|
---|
202 | file.py \
|
---|
203 | __init__.py \
|
---|
204 | nsError.py \
|
---|
205 | primitives.py \
|
---|
206 | xpcom_consts.py \
|
---|
207 | xpt.py \
|
---|
208 | client/__init__.py=>client/__init__.py \
|
---|
209 | server/__init__.py=>server/__init__.py \
|
---|
210 | server/enumerator.py=>server/enumerator.py \
|
---|
211 | server/factory.py=>server/factory.py \
|
---|
212 | server/loader.py=>server/loader.py \
|
---|
213 | server/module.py=>server/module.py \
|
---|
214 | server/policy.py=>server/policy.py
|
---|
215 |
|
---|
216 |
|
---|
217 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
218 |
|
---|