DEV Community

loading...

Makefile - Passing arguments

takakd profile image Takahiro Kudo ・1 min read

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

Discussion

pic
Editor guide