[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re: "no rule to make target" when target is a variable
From: |
Ken Smith |
Subject: |
Re: Re: "no rule to make target" when target is a variable |
Date: |
Wed, 6 Dec 2006 01:45:25 -0800 |
On 12/5/06, Brendan Bridgford <address@hidden> wrote:
...
Here's a fuller picture of what I'm trying to do (pretend for a moment that
my syntax works):
...
I want to apply essentially the same rules to multiple targets without
explicitly listing each target (i.e. a variable target name), while
retaining control over what gets made (i.e . I don't want "c = foobar
poobar"). Is there a better way of going about this?
You could generate your targets like this. This achieves what I
believe you were attempting with your example.
Expected output:
% make
foo rules
poo rules
GNUmakefile:
target-prefixes := foo poo
.PHONY: all
all:
$(foreach c,$(target-prefixes), \
$(eval $(c)bar: ; @echo $(c) rules) \
$(eval all: $(c)bar) \
)
HTH,
Ken Smith