diff options
| author | Willy Tarreau <w@1wt.eu> | 2022-11-17 08:15:27 +0100 |
|---|---|---|
| committer | Willy Tarreau <w@1wt.eu> | 2022-11-17 10:56:35 +0100 |
| commit | d575661d402fc8740c6d915bdd3a5259c38c8a63 (patch) | |
| tree | fd73b4426eb19e151632d4ec4f8aa1d4f7796512 /dev | |
| parent | 59b50bd04a6cd5e67683d6aff2645e84b7c62e02 (diff) | |
| download | haproxy-d575661d402fc8740c6d915bdd3a5259c38c8a63.tar.gz | |
BUILD: makefile: properly pass CC to sub-projects
The "poll" and "tcploop" sub-projects have their own makefiles. But
since the cmd_* commands were migrated from "echo" to $(info) with
make 3.81, the command is confusingly displayed in the top-level
makefile before entering the directory, even making one think that
the build occurred.
Let's instead propagate the verbosity level through the sub-projects
and let them adapt their own cmd_CC. For now this peans a little bit
of duplication for poll and tcploop.
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/poll/Makefile | 20 | ||||
| -rw-r--r-- | dev/tcploop/Makefile | 20 |
2 files changed, 38 insertions, 2 deletions
diff --git a/dev/poll/Makefile b/dev/poll/Makefile index fdee514c6..9a493bb71 100644 --- a/dev/poll/Makefile +++ b/dev/poll/Makefile @@ -4,8 +4,26 @@ 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 - $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^ + $(cmd_CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^ clean: rm -f $(OBJS) *.[oas] *~ diff --git a/dev/tcploop/Makefile b/dev/tcploop/Makefile index 42a6259c2..fd80af9b9 100644 --- a/dev/tcploop/Makefile +++ b/dev/tcploop/Makefile @@ -4,8 +4,26 @@ 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 - $(CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^ + $(cmd_CC) $(OPTIMIZE) $(DEFINE) $(INCLUDE) -o $@ $^ clean: rm -f $(OBJS) *.[oas] *~ |
