3 ms·
The one common paradigm of Makefiles I'm enjoying (and using myself) is the pattern for enabling more verbose logging. ifeq ($(V),1) Q := else Q := @
by tyhoff 7y ago
The one common paradigm of Makefiles I'm enjoying (and using myself) is the pattern for enabling more verbose logging.
ifeq ($(V),1)
Q :=
else
Q := @
endif
somerule:
$(Q)$(CC) -c $^ -o $@
$ make V=1
It's mentioned in this article and I suggest everyone use it in their Makefiles, for when the time comes for me and others to debug it.
- jgrahamc 7y agoThere's no need to write $(V) and $(Q) since they are single letter variables you can just do $V or $Q. Of course, you may prefer the more verbose version.