Skip to content

Instantly share code, notes, and snippets.

@taktran
Created December 11, 2018 12:55
Show Gist options
  • Save taktran/ddd8bed0119a828d4ff2a6aee5adaae0 to your computer and use it in GitHub Desktop.
Save taktran/ddd8bed0119a828d4ff2a6aee5adaae0 to your computer and use it in GitHub Desktop.
Test makefile playground
HELLO_FILE_NAME := ".hello"
tidy-hello:
-rm $(HELLO_FILE_NAME)
save-hello: tidy-hello write-to-hello
write-to-hello:
echo "save this hello" > $(HELLO_FILE_NAME)
smoke:
@echo "BASH_HELLO: $$BASH_HELLO"
@echo "SHELL_HELLO: $$SHELL_HELLO" # This is empty the first time it is run
hello:
$(MAKE) save-hello
BASH_HELLO="$$(cat $(HELLO_FILE_NAME))" \
SHELL_HELLO="$(shell cat $(HELLO_FILE_NAME))" \
$(MAKE) smoke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment