2 # Copyright 2019 Google LLC. All Rights Reserved.
3 # Copyright 2017-2018 Nest Labs Inc. All Rights Reserved.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
20 # This file is a make "header" or pre make header that defines
21 # make macros for controlling build verbosity.
28 # The default build verbosity is 0 or none. Invoking 'make V=0' is
29 # equivalent to 'make' with this default.
31 NL_DEFAULT_VERBOSITY ?= 0
33 # Alias for the command echo suppression marker.
37 # Alias for a conditional command echo suppression marker, conditioned
38 # on the build verbosity.
40 NL_V_AT = $(NL_V_AT_$(V))
41 NL_V_AT_ = $(NL_V_AT_$(NL_DEFAULT_VERBOSITY))
46 # Verbosity Build Progress Macros
49 # Macro for emitting "<ACTION> <target | output>" oneline, succinct
50 # build progress messages.
52 _NL_PROGRESS := printf " %-13s %s\n"
53 NL_PROGRESS := $(NL_AT)$(_NL_PROGRESS)
55 # Macro for emitting "<ACTION> <target | output>" oneline, succinct
56 # build progress messages, conditioned on build verbosity.
58 NL_V_PROGRESS = $(NL_V_PROGRESS_$(V))
59 NL_V_PROGRESS_ = $(NL_V_PROGRESS_$(NL_DEFAULT_VERBOSITY))
60 NL_V_PROGRESS_0 = $(NL_PROGRESS)
61 NL_V_PROGRESS_1 = $(NL_AT)true
63 # Common convenience progress message macros, conditioned on build
66 NL_V_PROGRESS_BOOTSTRAP = $(NL_V_PROGRESS) "BOOTSTRAP" "$(1)";
67 NL_V_PROGRESS_BOOTSTRAP_ALL = $(NL_V_BOOTSTRAP) "all";
68 NL_V_PROGRESS_BOOTSTRAP_CONFIG = $(NL_V_BOOTSTRAP) "config";
69 NL_V_PROGRESS_BOOTSTRAP_MAKE = $(NL_V_BOOTSTRAP) "make";
71 NL_V_PROGRESS_CONFIGURE = $(NL_V_PROGRESS) "CONFIGURE"
73 NL_V_PROGRESS_GIT_INIT = $(NL_V_PROGRESS) "GIT INIT" "$(@)";
75 NL_V_PROGRESS_MAKE = $(NL_V_PROGRESS) "MAKE" "$(@)";
77 NL_V_PROGRESS_LN_S = $(NL_V_PROGRESS) "LN" "$(@)";
79 NL_V_PROGRESS_MKDIR = $(NL_V_PROGRESS) "MKDIR" "$(1)";
80 NL_V_PROGRESS_MKDIR_P = $(NL_V_MKDIR)
81 NL_V_PROGRESS_RMDIR = $(NL_V_PROGRESS) "RMDIR" "$(1)";
83 NL_V_PROGRESS_GZIP = $(NL_V_PROGRESS) "GZIP" "$(@)";
84 NL_V_PROGRESS_TAR = $(NL_V_PROGRESS) "TAR" "$(@)";
85 NL_V_PROGRESS_TGZ = $(NL_V_PROGRESS) "TGZ" "$(@)";
86 NL_V_PROGRESS_TXZ = $(NL_V_PROGRESS) "TXZ" "$(@)";
87 NL_V_PROGRESS_XZ = $(NL_V_PROGRESS) "XZ" "$(@)";
90 # Verbosity Commands and Flags
93 # This is useful when we do not want submake to be chatty about what
94 # it doing when verbosity is suppressed. However, when verbosity is
95 # requested, -s (silent) would otherwise suppress all make verbose
96 # output. Consequently, suppress -s when verbosity is requested.
98 NL_V_MAKE_S = $(NL_V_MAKE_S_$(V))
99 NL_V_MAKE_S_ = $(NL_V_MAKE_S_$(NL_DEFAULT_VERBOSITY))
100 NL_V_MAKE_S_0 = $(MAKE) -s
101 NL_V_MAKE_S_1 = $(MAKE)