Makefile - Passing arguments

takakd

Takahiro Kudo

Posted on July 4, 2020

Makefile - Passing arguments

I have not known this🥺

# Makefile
DEFAULT=fuga
test:
    @echo $(DEFAULT)
Enter fullscreen mode Exit fullscreen mode
# shell

$ make
# -> fuga

$ make DEFAULT=hoge
# -> hoge
Enter fullscreen mode Exit fullscreen mode

Reference

https://stackoverflow.com/questions/2826029/passing-additional-variables-from-command-line-to-make

💖 💪 🙅 🚩
takakd
Takahiro Kudo

Posted on July 4, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related