I'm using a makefile to compile a program made of many .c
files, and any time make
is invoked it only compiles those files modified after the last run (nothing special until here).
To avoid cluttering my screen, I prepend @
at the beginning of each $(CC)
call, and before it I print a customized echo
message. For example:
%.o: %.c $(h1) $(h3) %.h
@echo -e "\tCompiling <" $<
@$(CC) $(CFLAGS) -c $< -o $(libDir)$@$(MATHOPTS)
My question is: how can I control the verbosity of make
in a more "dynamic way", in order to be able to:
- Normal behaviour: only a customized message is printed for every makefile rule executed.
- Verbose behaviour: print the command actually executed by every makefile rule (as if the
@
wasn't used at all).
CC = $(CC_$(V))
. – Diplosis