BUILD: makefile: move default verbosity settings to include/make/verbose.mk

The $(Q), $(V), $(cmd_xx) handling needs to be reused in sub-project
makefiles and it's a pain to maintain inside the main makefile. Let's
just move that into a new subdir include/make/ with a dedicated file
"verbose.mk". It slightly cleans up the makefile in addition.
This commit is contained in:
Willy Tarreau
2022-11-17 08:23:10 +01:00
parent d575661d40
commit 8dd672523f
4 changed files with 32 additions and 60 deletions

View File

@@ -1,27 +1,11 @@
include ../../include/make/verbose.mk
CC = cc
OPTIMIZE = -O2 -g
DEFINE =
INCLUDE =
OBJS = poll
V = 0
Q = @
ifeq ($V,1)
Q=
endif
ifeq ($V,1)
cmd_CC = $(CC)
else
ifeq (3.81,$(firstword $(sort $(MAKE_VERSION) 3.81)))
# 3.81 or above
cmd_CC = $(info $ CC $@) $(Q)$(CC)
else
# 3.80 or older
cmd_CC = $(Q)echo " CC $@";$(CC)
endif
endif
poll: poll.c
$(cmd_CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^

View File

@@ -1,27 +1,11 @@
include ../../include/make/verbose.mk
CC = gcc
OPTIMIZE = -O2 -g
DEFINE =
INCLUDE =
OBJS = tcploop
V = 0
Q = @
ifeq ($V,1)
Q=
endif
ifeq ($V,1)
cmd_CC = $(CC)
else
ifeq (3.81,$(firstword $(sort $(MAKE_VERSION) 3.81)))
# 3.81 or above
cmd_CC = $(info $ CC $@) $(Q)$(CC)
else
# 3.80 or older
cmd_CC = $(Q)echo " CC $@";$(CC)
endif
endif
tcploop: tcploop.c
$(cmd_CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^