Debian Codegraph @

config/makefiles/functions.mk

raw
1 #
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
6 #
7 # functions.mk
8 #
9 # Defines functions that are needed by various Makefiles throughout the build
10 # system, which are needed before config.mk can be included.
11 #
12
13 # Define an include-at-most-once flag
14 ifdef INCLUDED_FUNCTIONS_MK
15 $(error Do not include functions.mk twice!)
16 endif
17 INCLUDED_FUNCTIONS_MK = 1
18
19 core_abspath = $(error core_abspath is unsupported, use $$(abspath) instead)
20 core_realpath = $(error core_realpath is unsupported)
21
22 core_winabspath = $(error core_winabspath is unsupported)
23
24 # Run a named Python build action. The first argument is the name of the build
25 # action. The second argument are the arguments to pass to the action (space
26 # delimited arguments). e.g.
27 #
28 # libs::
29 # $(call py_action,purge_manifests,_build_manifests/purge/foo.manifest)
30 #
31 # The first argument can optionally contain the name of the file being created
32 # or processed. e.g.
33 # libs::
34 # $(call py_action,purge_manifests foo.manifest,_build_manifests/purge/foo.manifest)
35 # This optional name will be displayed in build profiles.
36 define py_action
37 $(call BUILDSTATUS,START_$(firstword $(1)) $(or $(word 2,$(1)),$(2)))
38 $(if $(3),cd $(3) && )$(PYTHON3) -m mozbuild.action.$(firstword $(1)) $(2)
39 $(call BUILDSTATUS,END_$(firstword $(1)) $(or $(word 2,$(1)),$(2)))
40
41 endef