1 | # $Id: Makefile.kmk 29118 2010-05-06 03:05:29Z 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_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
|
---|
76 | $(PATH_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) && "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" != "darwin.amd64"
|
---|
104 | #
|
---|
105 | # Python 2.5 version
|
---|
106 | #
|
---|
107 | DLLS += VBoxPython2_5
|
---|
108 | VBoxPython2_5_EXTENDS = VBoxPythonBase
|
---|
109 | VBoxPython2_5_EXTENDS_BY = appending
|
---|
110 | VBoxPython2_5_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX105,)
|
---|
111 | VBoxPython2_5_INCS = $(VBOX_PYTHON25_INC)
|
---|
112 | VBoxPython2_5_LIBS = $(VBOX_PYTHON25_LIB)
|
---|
113 | endif
|
---|
114 |
|
---|
115 | if defined(VBOX_PYTHON26_INC)
|
---|
116 | #
|
---|
117 | # Python 2.6 version
|
---|
118 | #
|
---|
119 | DLLS += VBoxPython2_6
|
---|
120 | VBoxPython2_6_EXTENDS = VBoxPythonBase
|
---|
121 | VBoxPython2_6_EXTENDS_BY = appending
|
---|
122 | VBoxPython2_6_TEMPLATE = XPCOM$(if-expr "$(KBUILD_TARGET)" == "darwin",OSX106,)
|
---|
123 | VBoxPython2_6_INCS = $(VBOX_PYTHON26_INC)
|
---|
124 | VBoxPython2_6_LIBS = $(VBOX_PYTHON26_LIB)
|
---|
125 | endif
|
---|
126 |
|
---|
127 | if defined(VBOX_PYTHON27_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
128 | #
|
---|
129 | # Python 2.7 version
|
---|
130 | #
|
---|
131 | DLLS += VBoxPython2_7
|
---|
132 | VBoxPython2_7_EXTENDS = VBoxPythonBase
|
---|
133 | VBoxPython2_7_EXTENDS_BY = appending
|
---|
134 | VBoxPython2_7_INCS = $(VBOX_PYTHON27_INC)
|
---|
135 | VBoxPython2_7_LIBS = $(VBOX_PYTHON27_LIB)
|
---|
136 | endif
|
---|
137 |
|
---|
138 | if defined(VBOX_PYTHON28_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
139 | #
|
---|
140 | # Python 2.8 version
|
---|
141 | #
|
---|
142 | DLLS += VBoxPython2_8
|
---|
143 | VBoxPython2_8_EXTENDS = VBoxPythonBase
|
---|
144 | VBoxPython2_8_EXTENDS_BY = appending
|
---|
145 | VBoxPython2_8_INCS = $(VBOX_PYTHON28_INC)
|
---|
146 | VBoxPython2_8_LIBS = $(VBOX_PYTHON28_LIB)
|
---|
147 | endif
|
---|
148 |
|
---|
149 | if defined(VBOX_PYTHONDEF_INC) && "$(KBUILD_TARGET)" != "darwin"
|
---|
150 | #
|
---|
151 | # Python without versioning
|
---|
152 | #
|
---|
153 | DLLS += VBoxPython
|
---|
154 | VBoxPython_EXTENDS = VBoxPythonBase
|
---|
155 | VBoxPython_DEFS = $(filter-out VBOX_PYXPCOM_VERSIONED,$(VBoxPythonBase_DEFS))
|
---|
156 | VBoxPython_INCS = $(VBoxPythonBase_INCS) $(VBOX_PYTHONDEF_INC)
|
---|
157 | if "$(KBUILD_TARGET)" == "linux"
|
---|
158 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS)
|
---|
159 | else
|
---|
160 | VBoxPython_LIBS = $(VBoxPythonBase_LIBS) $(VBOX_PYTHONDEF_LIB)
|
---|
161 | endif
|
---|
162 | endif
|
---|
163 |
|
---|
164 | endif # VBOX_ONLY_SDK
|
---|
165 |
|
---|
166 | #
|
---|
167 | # Install the python modules.
|
---|
168 | #
|
---|
169 | INSTALLS += VBoxPython-inst-py-xpcom
|
---|
170 | VBoxPython-inst-py-xpcom_INST = $(INST_SDK)bindings/xpcom/python/xpcom/
|
---|
171 | VBoxPython-inst-py-xpcom_SOURCES = \
|
---|
172 | vboxxpcom.py \
|
---|
173 | components.py \
|
---|
174 | file.py \
|
---|
175 | __init__.py \
|
---|
176 | nsError.py \
|
---|
177 | primitives.py \
|
---|
178 | xpcom_consts.py \
|
---|
179 | xpt.py \
|
---|
180 | client/__init__.py=>client/__init__.py \
|
---|
181 | server/__init__.py=>server/__init__.py \
|
---|
182 | server/enumerator.py=>server/enumerator.py \
|
---|
183 | server/factory.py=>server/factory.py \
|
---|
184 | server/loader.py=>server/loader.py \
|
---|
185 | server/module.py=>server/module.py \
|
---|
186 | server/policy.py=>server/policy.py
|
---|
187 |
|
---|
188 |
|
---|
189 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
190 |
|
---|