blob: e5264b072d1572afad42ff973d60558973eaf81f [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
45# Prevent accidentally changing these variables
46.KATI_READONLY := SHELL empty space comma newline pound backslash
47
48# Basic warning/error wrappers. These will be redefined to include the local
49# module information when reading Android.mk files.
50define pretty-warning
51$(warning $(1))
52endef
53
54define pretty-error
55$(error $(1))
56endef