Created
August 24, 2021 04:15
-
-
Save taiya/afbd9f5277b9ab45d14b7b5e5b247102 to your computer and use it in GitHub Desktop.
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
# --- specify target with `make run TARGET=mnist.py` | |
TARGET=mnist.py | |
run: | |
ml_python $(TARGET) | |
# --- passing parameters `# make helloworld_pars MYVAR="something"` | |
MYVAR = "hello" | |
helloworld_pars: | |
@echo "foo" $(MYVAR) | |
# --- example reading from stdin | |
helloworld_input: | |
@read -p "please write something: " MYVAR | |
@echo $${MYVAR} | |
# --- example reading from stdin w/ defaults | |
helloworld_inputdefault: | |
@read -p "please write something: " MYVAR | |
MYVAR=$${MYVAR:-"my default value"} | |
@echo $${MYVAR} | |
# --- passing makefile parameters to bash | |
# Usage: | |
# make blah #< prints bar | |
# make blah VERSION=foo #< prints foo | |
blah: | |
@VERSION=$${VERSION:-bar} | |
@echo $${VERSION} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment