Hi,
I have a problem creating makefile with multple target patterns.
Suppose we 2 source folders with files and folders with same names:
src1/a.c src2/a.c
src1/dir1/foo.c src2/dir1/foo.c
src1/dir2/bar.c src2/dir2/bar.c
Suppose we need somehow to combine every par of files we have there into
a 3rd directory, say store (directories dir1 and dir2 are already
created inside store).
My idea was to use multiple target patterns, using foreach for directories.
DIRS_SOURCES = . dir1 dir2
$(foreach DIR,$(DIRS_SOURCES),\
store/$(DIR)/%.c: src1/$(DIR)/%.c src2/$(DIR)/%.c
@echo make combination to $@
)
But this is not working. How can I create such generic makefile without
writing
store/%.c: src1/%.c src2/%.c
store/dir1/%.c: src1/dir1/%.c src2/dir1/%.c
store/dir2/%.c: src1/dir2/%.c src2/dir2/%.c
because, i already have many directories inside src1 and src2, and maybe
i need to add some other directory fast.
Anyone? xD
Thanks.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
_______________________________________________
Help-make mailing list
Help-make@gnu.org
http://lists.gnu.org/mailman/listinfo/help-make