help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MAKECMDGOALS and spaces


From: Christof Warlich
Subject: MAKECMDGOALS and spaces
Date: Sat, 13 Feb 2021 19:35:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi,

please consider this Maklefile:

$(MAKECMDGOALS):; echo "Goals: $(MAKECMDGOALS)"

For each goal being passed, it prints the list of all goals, e.g.:

$ make hi ho
echo "Goals: hi ho"
Goals: hi ho
echo "Goals: hi ho"
Goals: hi ho

But it fails when goals contain spaces:

$ make "hi ho"

make "hi ho"
make: *** No rule to make target 'hi ho'.  Stop.

Obviously, make knows that it is supposed to build a target with a
space, but this information got lost within the variable MAKECMDGOALS.
Can I fix my simple example to handle this case in a generic way?  As
much as I could figure so far, it seems to be impossible, right?

Thanks,

Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]