3

I want to write a makefile that can be run with any task and just echo all the task names.
Is there any way to do this?

Like:

%.%: 
    echo "$@"
Cyrus
  • 77,979
  • 13
  • 71
  • 125
vpe27339
  • 91
  • 1
  • 4

1 Answers1

5

Assuming that your make is GNU make or alike, use the following Makefile:

.PHONY: all

%:
       @echo "Here I am! $@"

See the result:

> make first
Here I am! first
> make second
Here I am! second
> make first second
Here I am! first
Here I am! second
user3159253
  • 15,770
  • 3
  • 26
  • 46