2

I'm trying to use

$(patsubst %-%,%:%,$(MAKECMDGOALS))

to replace dashes with colons in the make target but it has no effect.

How could I achieve this?

2 Answers 2

6

You can only have a single wildcard in patsubst. To replace all dashes with colons, you can use subst:

$(subst -,:,$(MAKECMDGOALS))
0

Use the tr command:

tr '-' ':' < OLD_MAKE_TARGET > NEW_MAKE_TARGET

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.