Skip to content

Instantly share code, notes, and snippets.

@taiya
Created August 24, 2021 04:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiya/afbd9f5277b9ab45d14b7b5e5b247102 to your computer and use it in GitHub Desktop.
Save taiya/afbd9f5277b9ab45d14b7b5e5b247102 to your computer and use it in GitHub Desktop.
# --- 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