1 | # $Id: Makefile.kmk 38082 2011-07-20 14:26:24Z 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 | $(eval $(subst |,$(NL),$(shell $(VBOX_BLD_PYTHON) $(PATH_SUB_CURRENT)/gen_python_deps.py $(KBUILD_TARGET) $(KBUILD_TARGET_ARCH) $(VBOX_MULTIPYTHON))))
|
---|
32 |
|
---|
33 | ifndef VBOX_ONLY_SDK
|
---|
34 |
|
---|
35 | #
|
---|
36 | # Base Python Client Module - the C++/XPCOM bits (not actually built).
|
---|
37 | #
|
---|
38 | VBoxPythonBase_TEMPLATE = XPCOM
|
---|
39 | VBoxPythonBase_CXXFLAGS = -Wno-write-strings
|
---|
40 | VBoxPythonBase_DLLSUFF.darwin = .so
|
---|
41 | VBoxPythonBase_DEFS = \
|
---|
42 | _IMPL_NS_COM \
|
---|
43 | _IMPL_NS_BASE \
|
---|
44 | EXPORT_XPTI_API \
|
---|
45 | EXPORT_XPT_API \
|
---|
46 | VBOX_PYXPCOM \
|
---|
47 | VBOX_WITH_XPCOM \
|
---|
48 | VBOX_PYXPCOM_VERSIONED
|
---|
49 | VBoxPythonBase_INCS = \
|
---|
50 | src
|
---|
51 | VBoxPythonBase_SOURCES = \
|
---|
52 | src/module/_xpcom.cpp \
|
---|
53 | src/dllmain.cpp \
|
---|
54 | src/ErrorUtils.cpp \
|
---|
55 | src/PyGBase.cpp \
|
---|
56 | src/PyGInputStream.cpp \
|
---|
57 | src/PyGModule.cpp \
|
---|
58 | src/PyGStub.cpp \
|
---|
59 | src/PyGWeakReference.cpp \
|
---|
60 | src/PyIClassInfo.cpp \
|
---|
61 | src/PyIComponentManager.cpp \
|
---|
62 | src/PyIComponentManagerObsolete.cpp \
|
---|
63 | src/PyIEnumerator.cpp \
|
---|
64 | src/PyIID.cpp \
|
---|
65 | src/PyIInputStream.cpp \
|
---|
66 | src/PyIInterfaceInfo.cpp \
|
---|
67 | src/PyIInterfaceInfoManager.cpp \
|
---|
68 | src/PyISimpleEnumerator.cpp \
|
---|
69 | src/PyISupports.cpp \
|
---|
70 | src/PyIVariant.cpp \
|
---|
71 | src/Pyxpt_info.cpp \
|
---|
72 | src/TypeObject.cpp \
|
---|
73 | src/VariantUtils.cpp
|
---|
74 | VBoxPythonBase_LIBS = \
|
---|
75 | $(PATH_STAGE_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
|
---|
76 | $(PATH_STAGE_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
77 |
|
---|
78 |
|
---|
79 | if defined(VBOX_PYTHON23_INC) \
|
---|
80 | && ("$(KBUILD_TARGET)" != "darwin" || ("$(KBUILD_TARGET_ARCH)" == "x86" && defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT) ))
|
---|
81 | #
|
---|
82 | # Python 2.3 version
|
---|
83 | #
|
---|
84 | DLLS += VBoxPython2_3
|
---|
85 | VBoxPython2_3_EXTENDS = VBoxPythonBase
|
---|
86 | VBoxPython2_3_EXTENDS_BY = appending
|
---|
87 | VBoxPython2_3_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX104,)
|
---|
88 | VBoxPython2_3_INCS = $(VBOX_PYTHON23_INC)
|
---|
89 | VBoxPython2_3_LIBS = $(VBOX_PYTHON23_LIB)
|
---|
90 | endif
|
---|
91 |
|
---|
92 | if defined(VBOX_PYTHON24_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
93 | #
|
---|
94 | # Python 2.4 version
|
---|
95 | #
|
---|
96 | DLLS += VBoxPython2_4
|
---|
97 | VBoxPython2_4_EXTENDS = VBoxPythonBase
|
---|
98 | VBoxPython2_4_EXTENDS_BY = appending
|
---|
99 | VBoxPython2_4_INCS = $(VBOX_PYTHON24_INC)
|
---|
100 | VBoxPython2_4_LIBS = $(VBOX_PYTHON24_LIB)
|
---|
101 | endif
|
---|
102 |
|
---|
103 | if defined(VBOX_PYTHON25_INC) \
|
---|
104 | && ("$(KBUILD_TARGET)" != "darwin" || ("$(KBUILD_TARGET_ARCH)" == "x86" && "$(VBOX_DEF_MACOSX_VERSION_MIN)" == "10.5"))
|
---|
105 | #
|
---|
106 | # Python 2.5 version
|
---|
107 | #
|
---|
108 | DLLS += VBoxPython2_5
|
---|
109 | VBoxPython2_5_EXTENDS = VBoxPythonBase
|
---|
110 | VBoxPython2_5_EXTENDS_BY = appending
|
---|
111 | VBoxPython2_5_TEMPLATE = XPCOM
|
---|
112 | VBoxPython2_5_INCS = $(VBOX_PYTHON25_INC)
|
---|
113 | VBoxPython2_5_LIBS = $(VBOX_PYTHON25_LIB)
|
---|
114 | endif
|
---|
115 |
|
---|
116 | if defined(VBOX_PYTHON26_INC) \
|
---|
117 | && ("$(KBUILD_TARGET)" != "darwin" || "$(VBOX_DEF_MACOSX_VERSION_MIN)" <= "10.6")
|
---|
118 | #
|
---|
119 | # Python 2.6 version
|
---|
120 | #
|
---|
121 | DLLS += VBoxPython2_6
|
---|
122 | VBoxPython2_6_EXTENDS = VBoxPythonBase
|
---|
123 | VBoxPython2_6_EXTENDS_BY = appending
|
---|
124 | VBoxPython2_6_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX106,)
|
---|
125 | VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
|
---|
126 | VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
|
---|
127 | endif
|
---|
128 |
|
---|
129 | if defined(VBOX_PYTHON27_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
130 | #
|
---|
131 | # Python 2.7 version
|
---|
132 | #
|
---|
133 | DLLS += VBoxPython2_7
|
---|
134 | VBoxPython2_7_EXTENDS = VBoxPythonBase
|
---|
135 | VBoxPython2_7_EXTENDS_BY = appending
|
---|
136 | VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
|
---|
137 | VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
|
---|
138 | endif
|
---|
139 |
|
---|
140 | if defined(VBOX_PYTHON28_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
141 | #
|
---|
142 | # Python 2.8 version
|
---|
143 | #
|
---|
144 | DLLS += VBoxPython2_8
|
---|
145 | VBoxPython2_8_EXTENDS = VBoxPythonBase
|
---|
146 | VBoxPython2_8_EXTENDS_BY = appending
|
---|
147 | VBoxPython2_8_INCS = $(VBOX_PYTHON28_INC)
|
---|
148 | VBoxPython2_8_LIBS = $(VBOX_PYTHON28_LIB)
|
---|
149 | endif
|
---|
150 |
|
---|
151 | if defined(VBOX_PYTHONDEF_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
152 | #
|
---|
153 | # Python without versioning
|
---|
154 | #
|
---|
155 | DLLS += VBoxPython
|
---|
156 | VBoxPython_EXTENDS = VBoxPythonBase
|
---|
157 | VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
|
---|
158 | VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
|
---|
159 | if "$(KBUILD_TARGET)" == "linux"
|
---|
160 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
|
---|
161 | else
|
---|
162 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
|
---|
163 | endif
|
---|
164 | endif
|
---|
165 |
|
---|
166 | endif # VBOX_ONLY_SDK
|
---|
167 |
|
---|
168 | #
|
---|
169 | # Install the python modules.
|
---|
170 | #
|
---|
171 | INSTALLS += VBoxPython-inst-py-xpcom
|
---|
172 | VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
|
---|
173 | VBoxPython-inst-py-xpcom_SOURCES = \
|
---|
174 | vboxxpcom.py \
|
---|
175 | components.py \
|
---|
176 | file.py \
|
---|
177 | __init__.py \
|
---|
178 | nsError.py \
|
---|
179 | primitives.py \
|
---|
180 | xpcom_consts.py \
|
---|
181 | xpt.py \
|
---|
182 | client/__init__.py=>client/__init__.py \
|
---|
183 | server/__init__.py=>server/__init__.py \
|
---|
184 | server/enumerator.py=>server/enumerator.py \
|
---|
185 | server/factory.py=>server/factory.py \
|
---|
186 | server/loader.py=>server/loader.py \
|
---|
187 | server/module.py=>server/module.py \
|
---|
188 | server/policy.py=>server/policy.py
|
---|
189 |
|
---|
190 |
|
---|
191 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
192 |
|
---|