help-make
[Top][All Lists]
Advanced

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

Re: Problem with Make 3.82 and wilcard in prerequisite for directories


From: Paul Smith
Subject: Re: Problem with Make 3.82 and wilcard in prerequisite for directories
Date: Fri, 09 Nov 2012 13:00:05 -0500

On Fri, 2012-11-09 at 19:22 +0200, Oleksandr Gavenko wrote:
> %.o: %.c
>         COMPILE...
> 
> and handle complete build by:
> 
> C_FILES := $(wildcard */*.c */*/*.c */*/*/*.c)
> O_FILES := $(C_FILES:.c=.o)
> 
> %.o: %.c
>         COMPILE...
> 
> $(APP): $(O_FILES)
>         LINK...
> 
> The only difference - all .o files put to corresponding subdirs instead root
> dir.
> 
> If you still want put it to any dir write:
> 
> .PHONY: copy-to-root
> copy-to-root: $(O_FILES)
>       cp $^ .
> 
> but you loose make dependencies tracking...

Simpler than this is to use VPATH; that's what it's for.

        VPATH = test/a test/b
        
        %.o : %.c
                COMPILE ...
        
        all: a.o b.o





reply via email to

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