Last active
April 10, 2019 10:39
-
-
Save nyrahul/25403698c33fb9d108c0205055acf08e to your computer and use it in GitHub Desktop.
Makefile trick: disable verbose compilation .. enable verbose only if 'make V=1'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC=gcc | |
AR=ar | |
V = 0 | |
ACTUAL_CC := $(CC) | |
CC_0 = @echo "CC [$<]"; $(ACTUAL_CC) | |
CC_1 = $(ACTUAL_CC) | |
CC = $(CC_$(V)) | |
ACTUAL_AR := $(AR) | |
AR_0 = @echo "LN [$@]"; $(ACTUAL_AR) | |
AR_1 = $(ACTUAL_AR) | |
AR = $(AR_$(V)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment