Change a target within Makefile?

2024-07-24 Thread Masahiro Yamada
Hi. My question is very similar to this: https://stackoverflow.com/questions/31443920/remove-target-from-makecmdgoals When a particular flag is set, I want to do something extra. I know this is hard, but please forgive me to repeat a similar question in case somebody in the list may know somethin

Re: Change a target within Makefile?

2024-07-24 Thread Paul Smith
On Wed, 2024-07-24 at 18:44 +0900, Masahiro Yamada wrote: > ifdef GENERATE_B_AS_WELL > # When this flag is set, we want to generate %.b as well. > # I know I cannot update MAKECMDGOALS... > MAKECMDGOALS := $(patsubst %.a, %.b, $(MAKECMDGOALS)) > endif > > > %.a: >     touch > > %.b: %.a >   

Re: Change a target within Makefile?

2024-07-24 Thread Taylor Hutt via Users list for the GNU implementation of make
> My question is very similar to this: > https://stackoverflow.com/questions/31443920/remove-target-from-makecmdgoals > > When a particular flag is set, I want to do something extra. > I know this is hard, but please forgive me to repeat a similar question > in case somebody in the list may know so

Re: Change a target within Makefile?

2024-07-24 Thread Dmitry Goncharov
On Wed, Jul 24, 2024 at 5:46 AM Masahiro Yamada wrote: > Of course, it does not work since MAKECMDGOALS is read-only. Well, it is possible to assign a new value to makecmdgoals. i guess, you mean that make proceeds to build the target specified on the command line, regardless. > If recursion is

Re: Change a target within Makefile?

2024-07-24 Thread Kaz Kylheku
On 2024-07-24 04:34, Paul Smith wrote: > On Wed, 2024-07-24 at 18:44 +0900, Masahiro Yamada wrote: >> ifdef GENERATE_B_AS_WELL >> # When this flag is set, we want to generate %.b as well. >> # I know I cannot update MAKECMDGOALS... >> MAKECMDGOALS := $(patsubst %.a, %.b, $(MAKECMDGOALS)) >> endif >

Re: Change a target within Makefile?

2024-07-24 Thread Masahiro Yamada
On Thu, Jul 25, 2024 at 1:36 AM Dmitry Goncharov wrote: > > On Wed, Jul 24, 2024 at 5:46 AM Masahiro Yamada wrote: > > > Of course, it does not work since MAKECMDGOALS is read-only. > Well, it is possible to assign a new value to makecmdgoals. i guess, > you mean that make proceeds to build the t