-
Notifications
You must be signed in to change notification settings - Fork 1
/
quiet.mk
104 lines (95 loc) · 2.41 KB
/
quiet.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
quiet_mk_ident="@(#) CSLiS quiet.mk 7.11 2022-10-26 15:30:00 "
#
# Copyright 2022 - IBM Inc. All rights reserved
# SPDX-License-Identifier: LGPL-2.1
#
# To put more focus on warnings, be less verbose by default
#
# Use 'make V=1' to see the full commands, make -s to suppress
# all non-warning output
#
ifdef V
ifeq ("$(origin V)", "command line")
LIS_BUILD_VERBOSE = $(V)
endif
endif
ifndef LIS_BUILD_VERBOSE
LIS_BUILD_VERBOSE = 0
endif
#
# The following was inspired by what the 2.6 kernels' 'kbuild' does,
# but is much simplified.
#
ifeq ($(LIS_BUILD_VERBOSE),1)
quiet =
Q =
Q_ECHO = @:
Q_PRINT = -print
Q_CC =
else
quiet = quiet_
Q = @
Q_ECHO = @echo
Q_PRINT =
Q_CC = .compiler
# Do not print "Entering|Leaving directory ..."
MAKEFLAGS += --no-print-directory
endif
# If the user is running make -s (silent mode), suppress echoing of
# commands
ifneq ($(findstring s,$(MAKEFLAGS)),)
quiet = silent_
Q = @
Q_ECHO = @:
Q_PRINT =
Q_CC =
endif
# relative path function and variables useful for Q_ECHO'ing, and possibly
# other things as well
#
define _relpath
$(patsubst $(SRCDIR)/%,%,$(1))
endef
define _relpwd
$(patsubst $(SRCDIR)/%,%,$(shell pwd)/$(1)))
endef
relpwd = $(patsubst $(SRCDIR)/%,%,$(shell pwd))
reltarget = $(patsubst $(SRCDIR)/%,%,$(@))
relpwdtarget = $(patsubst $(SRCDIR)/%,%,$(shell pwd)/$(@F))
reldep1 = $(patsubst $(SRCDIR)/%,%,$(<))
relpwddep1 = $(patsubst $(SRCDIR)/%,%,$(shell pwd)/$(<F))
reldeps = $(foreach d,$^,$(patsubst $(SRCDIR)/%,%,$(d)))
relpwddeps = $(foreach d,$^,$(patsubst $(SRCDIR)/%,%,$(shell pwd)/$(d)))
# empty target command - avoids "nothing to do for" messages
#
nothing = @:
# output tags for use with Q_ECHO (defined here so we can consistently
# change them)
#
qtag_AR = " AR "
qtag_CC = " CC "
qtag__CC_ = " <CC> "
qtag_CCm = " CC [m] "
qtag_CLEAN = " CLEAN "
qtag_CONFIG = " CONFIG "
qtag_continue = " ... "
qtag_DEP = " DEP "
qtag_GENCONF = " GENCONF "
qtag_INSTALL = " INSTALL "
qtag_KBUILD = " KBUILD "
qtag_KERNEL = " KERNEL "
qtag_LD = " LD "
qtag_LDm = " LD [m] "
qtag_MAKE = " MAKE "
qtag_MKDIR = " MKDIR "
qtag_MODPOST = " MODPOST "
qtag_MODULES = " MODULES "
qtag__m_ = " [m] "
qtag_RANLIB = " RANLIB "
qtag_RM = " RM "
qtag_RPM = " RPM "
qtag_STRCONF = " STRCONF "
qtag_SUBDIRS = " SUBDIRS "
qtag_SYMVERS = " SYMVERS "
qtag_USER = " USER "
qtag__WD_ = " <WD> "