help-make
[Top][All Lists]
Advanced

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

Applying implicit rule to list


From: mailinglists
Subject: Applying implicit rule to list
Date: Thu, 14 Jun 2012 12:27:03 +0200
User-agent: Internet Messaging Program (IMP) H3 (4.3.7)

Hi

I have a list like

CHILDREN := Block1 Block2 Block99 Block1999

Now I want to have a target "all.%" which should do the "%" on all blocks indicated by $(CHILDREN). E.g., "all.SomeAction" should depend on Block1.SomeAction, Block2.SomeAction, Block99.SomeAction, Block1999.SomeAction where there should be only one receipe. After playing around I came across this:

CHILDREN := Block1 Block2 Block99 Block1999

FOO2 = $(addsuffix .%,$(CHILDREN))
.PHONY: $(FOO2)
$(FOO2):
        @echo "    I am $@ (replacement: $*)"
        @echo "        Call: $(MAKE) -C Subblocks/$(word 1,$(subst ., ,$@)) $*"

.PHONY: all.%
all.%: $(FOO2)
        @echo "    Ich bin all.% (all.$*)"
        @echo "         Deps: $+"

However, the output is:

$ make all.SomeAction
    I am Block2.SomeAction (replacement: SomeAction)
        Call: make -C Subblocks/Block2 SomeAction
    Ich bin all.% (all.SomeAction)
Deps: Block1.SomeAction Block2.SomeAction Block99.SomeAction Block1999.SomeAction

Only the action for Block2.SomeAction (i.e. for the second element) is called.

How can I solve this issue?

Regards
Niki







reply via email to

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