1

Is there any way to get key word args in Makefile ?

i have tried giving args and accessing using $1, $2 etc, but how can we give it with a keywords.

Test user
  • 21
  • 3
  • You are not clear enough in your question, which is why it was closed as a dup (although I would have asked for clarification before closing it). If you had provided an example of exactly what you wanted to do it would have been a lot better than this two-sentence question. The term "key word args" doesn't mean anything to us; that term doesn't appear in the make manual etc. If you want to see the make targets: `make foo` you want `foo`, then the duplicate question is the answer. If you want to see variables make was given `make FOO=bar` and you want `FOO`, that answer won't help. – MadScientist Nov 02 '22 at 14:00

1 Answers1

1

You can directly call just like env vars:

file syntax:

build:
    cat $(file)

command to run:

make file=my_file.txt
Test user
  • 21
  • 3