Last active
November 22, 2015 03:02
-
-
Save LaughingSun/9528cc4bb8f18acf8904 to your computer and use it in GitHub Desktop.
gnu make is a little hard to understand sometimes... this is telling in regards to how it handles environment variables generally, within rules and within sub makes
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
root.ruleA You ain't got no kind of feeling inside | |
export TMP="I got something that'll sho nuff set yo' stuff on fire" | |
make -C ./submake | |
make[1]: Entering directory '/home/ismael/Fiddles/make-bug/submake' | |
child You ain't got no kind of feeling inside | |
make[1]: Leaving directory '/home/ismael/Fiddles/make-bug/submake' | |
root.ruleB You ain't got no kind of feeling inside | |
make -C ./submake | |
make[1]: Entering directory '/home/ismael/Fiddles/make-bug/submake' | |
child You ain't got no kind of feeling inside | |
make[1]: Leaving directory '/home/ismael/Fiddles/make-bug/submake' | |
root.ruleC You ain't got no kind of feeling inside | |
make -C ./submake TMP="What I got will knock your pride aside" | |
make[1]: Entering directory '/home/ismael/Fiddles/make-bug/submake' | |
child What I got will knock your pride aside | |
make[1]: Leaving directory '/home/ismael/Fiddles/make-bug/submake' | |
root.ruleC You ain't got no kind of feeling inside | |
make -C ./submake | |
make[1]: Entering directory '/home/ismael/Fiddles/make-bug/submake' | |
child Tell me something good | |
make[1]: Leaving directory '/home/ismael/Fiddles/make-bug/submake' |
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
export TMP="You ain't got no kind of feeling inside" | |
.PHONY: all | |
all: ruleA ruleB ruleC ruleD | |
ruleA: | |
@echo root.ruleA ${TMP} | |
export TMP="I got something that'll sho nuff set yo' stuff on fire" | |
$(MAKE) -C ./submake | |
ruleB: | |
@echo root.ruleB ${TMP} | |
$(shell export TMP="You refuse to put anything before your pride") | |
$(MAKE) -C ./submake | |
ruleC: | |
@echo root.ruleC ${TMP} | |
$(MAKE) -C ./submake TMP="What I got will knock your pride aside" | |
ruleD: | |
@echo root.ruleC ${TMP} | |
$(eval export TMP="Tell me something good") | |
$(MAKE) -C ./submake |
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
# Note: this should be submake/Makefile, but gisthub doesn't support subdirectories | |
.PHONY: all | |
all: child | |
child: | |
@echo child ${TMP} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment