help-make
[Top][All Lists]
Advanced

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

RE: Multiple target patterns


From: Dave Korn
Subject: RE: Multiple target patterns
Date: Wed, 11 Jun 2008 19:40:01 +0100

Boris Godin wrote on 11 June 2008 17:00:

> Guys, i have a new problem:
> this code transforms all into one single line,
> 
> $(foreach DIR,$(DIRS_SOURCES),\
> store/$(DIR)/%.c: src1/$(DIR)/%.c src2/$(DIR)/%.c;  \
>        @echo make combination to $@;\
> )

  Yep.  Look up how to use 'define' to make a multi-line variable
definition.  Then use a function call to insert each value of dir into it.
It'll end up looking something roughly like this (untested):

define make_store

store/$(1)/%.c: src1/$(1)/%.c src2/$(1)/%.c;
        @echo make combination to $@;

endef

$(eval $(foreach DIR,$(DIRS_SOURCES),$(call make_store,$(DIR))))


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....





reply via email to

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