blob: 7d505c01d93feb254c5aea61730b5cf8fb2193a6 [file] [log] [blame]
Dan Willemsen7ddc50a2018-10-18 16:11:40 -07001#
2# Copyright (C) 2018 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Only use ANDROID_BUILD_SHELL to wrap around bash.
18# DO NOT use other shells such as zsh.
19ifdef ANDROID_BUILD_SHELL
20SHELL := $(ANDROID_BUILD_SHELL)
21else
22# Use bash, not whatever shell somebody has installed as /bin/sh
23# This is repeated from main.mk, since envsetup.sh runs this file
24# directly.
25SHELL := /bin/bash
26endif
27
28# Utility variables.
29empty :=
30space := $(empty) $(empty)
31comma := ,
32# Note that make will eat the newline just before endef.
33define newline
34
35
36endef
37# The pound character "#"
38define pound
39#
40endef
41# Unfortunately you can't simply define backslash as \ or \\.
42backslash := \a
43backslash := $(patsubst %a,%,$(backslash))
44
Dan Willemsen8da52d42019-08-08 10:58:09 -070045TOP :=$= .
46TOPDIR :=$=
47
Dan Willemsen7ddc50a2018-10-18 16:11:40 -070048# Prevent accidentally changing these variables
49.KATI_READONLY := SHELL empty space comma newline pound backslash
50
51# Basic warning/error wrappers. These will be redefined to include the local
52# module information when reading Android.mk files.
53define pretty-warning
54$(warning $(1))
55endef
56
57define pretty-error
58$(error $(1))
59endef