DEV Community

Takahiro Kudo
Takahiro Kudo

Posted on

6 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay