Last active
November 4, 2021 15:51
-
-
Save aprell/5dae170cecb68853968c0395ee2e21fa to your computer and use it in GitHub Desktop.
Overriding Makefile variables
This file contains 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
test1: CFLAGS ?= -Wall -Wextra | |
test2: CFLAGS += -Wall -Wextra | |
test3: override CFLAGS += -Wall -Wextra | |
test4: override CFLAGS := -Wall -Wextra $(CFLAGS) | |
test1 test2 test3 test4: | |
@echo "$@: $(CFLAGS)" | |
.PHONY: test1 test2 test3 test4 |
Author
aprell
commented
Nov 4, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment