platform_build/common/core.mk
Dan Willemsen 8da52d4b9d Move TOP/TOPDIR to build/make/common/core.mk
So that they're set properly during dumpvars / product loading.

SHELL is already set in common/core.mk, so it's not necessary to be in
core/main.mk as well (which quickly loads core/config.mk, which loads
common/core.mk).

Test: get_build_var TOP
Test: get_build_var TOPDIR
Change-Id: I8179ac32628b74ccf29851dc53bf83cfb4b280fd
2019-08-08 10:58:09 -07:00

59 lines
1.6 KiB
Makefile

#
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Only use ANDROID_BUILD_SHELL to wrap around bash.
# DO NOT use other shells such as zsh.
ifdef ANDROID_BUILD_SHELL
SHELL := $(ANDROID_BUILD_SHELL)
else
# Use bash, not whatever shell somebody has installed as /bin/sh
# This is repeated from main.mk, since envsetup.sh runs this file
# directly.
SHELL := /bin/bash
endif
# Utility variables.
empty :=
space := $(empty) $(empty)
comma := ,
# Note that make will eat the newline just before endef.
define newline
endef
# The pound character "#"
define pound
#
endef
# Unfortunately you can't simply define backslash as \ or \\.
backslash := \a
backslash := $(patsubst %a,%,$(backslash))
TOP :=$= .
TOPDIR :=$=
# Prevent accidentally changing these variables
.KATI_READONLY := SHELL empty space comma newline pound backslash
# Basic warning/error wrappers. These will be redefined to include the local
# module information when reading Android.mk files.
define pretty-warning
$(warning $(1))
endef
define pretty-error
$(error $(1))
endef