DEV Community

Takahiro Kudo
Takahiro Kudo

Posted on

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

Top comments (0)