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
  • 84,225
  • 14
  • 89
  • 153
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
  • 16,836
  • 3
  • 30
  • 56