Created
July 25, 2019 10:03
-
-
Save qgp9/e8f023538e04234ecca5316ba9b54af0 to your computer and use it in GitHub Desktop.
Makefile export and override
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
foo ?= default | |
override foo += added | |
export foo | |
all:: | |
@echo outer: foo is "$(foo)" | |
@$(MAKE) -s -f sub-make.mk |
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
# Variable 'foo' was "exported" from the top-level Makefile. | |
all:: | |
@echo inner: foo is "$(foo)" |
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
set -x | |
# Q1 | |
make | |
# Q2 | |
foo=env make | |
# Q3 | |
make foo=cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment