VirtualBox

source: vbox/trunk/src/VBox/Frontends/VBoxShell/Config.kmk@ 102913

Last change on this file since 102913 was 102913, checked in by vboxsync, 4 months ago

Frontends/VBoxShell: Added linting support to the Makefile.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 KB
Line 
1# $Id: Config.kmk 102913 2024-01-17 10:35:52Z vboxsync $
2## @file
3# kBuild Configuration file for VBoxShell.
4#
5
6#
7# Copyright (C) 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# The contents of this file may alternatively be used under the terms
26# of the Common Development and Distribution License Version 1.0
27# (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28# in the VirtualBox distribution, in which case the provisions of the
29# CDDL are applicable instead of those of the GPL.
30#
31# You may elect to license modified versions of this file under the
32# terms and conditions of either the GPL or the CDDL or both.
33#
34# SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35#
36
37VBOX_VBOXSHELL_CONFIG_KMK_INCLUDED = 1
38
39# Include the top-level configure file.
40ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
41 include $(PATH_ROOT)/Config.kmk
42endif
43
44#
45# Globals
46#
47VBOX_PATH_VBOXSHELL_SRC := $(PATH_ROOT)/src/VBox/Frontends/VBoxShell
48
49#
50# List of python sources that should be linted.
51#
52VBOX_VBOXSHELL_PYTHON_SOURCES :=
53VBOX_VBOXSHELL_PYLINT_TARGETS :=
54
55ifdef VBOX_WITH_PYLINT
56 TESTING +=
57endif
58
59#
60# Process python sources.
61#
62if1of ($(KBUILD_TARGET), win os2)
63 VBOX_PYTHONPATH_VBOXSHELL = $(PYTHONPATH);$(VBOX_PATH_VBOXSHELL_SRC)
64else
65 VBOX_PYTHONPATH_VBOXSHELL = $(PYTHONPATH):$(VBOX_PATH_VBOXSHELL_SRC)
66endif
67BLDDIRS += $(PATH_TARGET)/pylint
68
69define def_vbox_vboxshell_py_check
70 $(eval name:=$(basename $(notdir $(py))))
71
72 pylint: $(name)-py-phony.o
73 $(name).o: $(name)-py-phony.o
74 $(PATH_TARGET)/pylint/$(name).o $(name)-py-phony.o:: $(py) | $(PATH_TARGET)/pylint/
75 ifdef VBOX_WITH_PYLINT
76 $(QUIET2)$(call MSG_L1,Subjecting $(py) to pylint...)
77 $(QUIET)$(REDIRECT) -C "$(dir $(py))" -E LC_ALL=C -E PYTHONPATH="$(VBOX_PYTHONPATH_VBOXSHELL)" -- \
78 $(VBOX_PYLINT) --rcfile=$(VBOX_PATH_VBOXSHELL_SRC)/pylintrc $$(VBOX_PYLINT_FLAGS) $$($(py)_VBOX_PYLINT_FLAGS) ./$(notdir $(py))
79 endif
80 $(QUIET)$(APPEND) -t "$(PATH_TARGET)/pylint/$(name).o"
81 TESTING += $(name)-py-phony.o
82 VBOX_VBOXSHELL_PYLINT_TARGETS += $(PATH_TARGET)/pylint/$(name).o
83endef # def_vbox_vboxshell_py_check
84
85
86define def_vbox_vboxshell_process_python_sources
87 if $(words $(_SUB_MAKEFILE_STACK)) <= 0 || "$1" == "FORCE"
88 $(foreach py, $(VBOX_VBOXSHELL_PYTHON_SOURCES), $(eval $(def_vbox_vboxshell_py_check)))
89 endif
90endef
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use