1 | # $Id: Makefile.kmk 106061 2024-09-16 14:03:52Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VBox Python glue.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2004-2024 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 | #
|
---|
32 | # Make sure our Config.kmk is included.
|
---|
33 | #
|
---|
34 | ifndef VBOX_MAIN_GLUE_PYTHON_CONFIG_KMK_INCLUDED
|
---|
35 | include $(PATH_SUB_CURRENT)/Config.kmk
|
---|
36 | endif
|
---|
37 |
|
---|
38 | if defined(VBOX_WITH_PYTHON) && !defined(VBOX_ONLY_EXTPACKS)
|
---|
39 | VBOX_PATH_PYTHON_GLUE_SRC := $(PATH_SUB_CURRENT)
|
---|
40 |
|
---|
41 | INSTALLS += VBox-python-glue
|
---|
42 | VBox-python-glue_INST = $(INST_SDK)installer/python/vboxapi/
|
---|
43 | VBox-python-glue_MODE = a+r,u+w
|
---|
44 | VBox-python-glue_SOURCES = \
|
---|
45 | pyproject.toml
|
---|
46 | INSTALLS += VBox-python-vboxapi
|
---|
47 | VBox-python-vboxapi_INST = $(INST_SDK)installer/python/vboxapi/src/vboxapi/
|
---|
48 | VBox-python-vboxapi_MODE = a+r,u+w
|
---|
49 | VBox-python-vboxapi_SOURCES = \
|
---|
50 | vboxapi.py=>__init__.py \
|
---|
51 | $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants.py
|
---|
52 | VBox-python-vboxapi_CLEAN = \
|
---|
53 | $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants.py \
|
---|
54 | $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants_err_h_1.txt
|
---|
55 | $(call KB_FN_DO_PASS0_ON_TARGET,VBox-python-vboxapi)
|
---|
56 | $(call KB_FN_AUTO_CMD_DEPS,$(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants.py)
|
---|
57 | $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants.py \
|
---|
58 | + $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants_err_h_1.txt: \
|
---|
59 | $(VBOX_PATH_PYTHON_GLUE_SRC)/constants-python.xsl \
|
---|
60 | $(VBOX_PATH_PYTHON_GLUE_SRC)/vbox-err-consts.sed \
|
---|
61 | $(PATH_ROOT)/include/iprt/err.h \
|
---|
62 | $(PATH_ROOT)/include/VBox/err.h \
|
---|
63 | $(VBOX_XIDL_FILE) \
|
---|
64 | | $$(dir $$@)
|
---|
65 | $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
|
---|
66 | $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
|
---|
67 | $(SED) -f $(VBOX_PATH_PYTHON_GLUE_SRC)/vbox-err-consts.sed \
|
---|
68 | --output $(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants_err_h_1.txt \
|
---|
69 | $(PATH_ROOT)/include/iprt/err.h \
|
---|
70 | $(PATH_ROOT)/include/VBox/err.h
|
---|
71 | $(QUIET)$(VBOX_XSLTPROC) -o $@ \
|
---|
72 | --stringparam "g_sErrHFile" "$(VBox-python-vboxapi_0_OUTDIR)/VirtualBox_constants_err_h_1.txt" \
|
---|
73 | $(VBOX_PATH_PYTHON_GLUE_SRC)/constants-python.xsl $(VBOX_XIDL_FILE)
|
---|
74 |
|
---|
75 | #
|
---|
76 | # Automatically lint Main Python glue.
|
---|
77 | #
|
---|
78 | if defined(VBOX_WITH_PYLINT) && !defined(VBOX_WITHOUT_AUTO_PYLINT)
|
---|
79 | OTHERS += $(PATH_TARGET)/pylintMainPythonGlue.run
|
---|
80 | OTHER_CLEAN += $(PATH_TARGET)/pylintMainPythonGlue.run
|
---|
81 | $(PATH_TARGET)/pylintMainPythonGlue.run: $(PATH_SUB_CURRENT)/vboxapi.py
|
---|
82 | $(QUIET)$(APPEND) -t "$@"
|
---|
83 | endif
|
---|
84 |
|
---|
85 | VBOX_MAIN_GLUE_PYTHON_PYTHON_SOURCES := $(wildcard $(PATH_SUB_CURRENT)/*.py)
|
---|
86 |
|
---|
87 | $(evalcall def_vbox_main_glue_python_process_python_sources,FORCE)
|
---|
88 |
|
---|
89 | endif # VBOX_WITH_PYTHON && !VBOX_ONLY_EXTPACKS
|
---|
90 |
|
---|
91 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|