On 2012-11-09, Bastian Beischer wrote:

> %.o: ./*/%.c
>         COMPILE...

Very danger construction. It is not documented by 'info make'.

You can rewrite your rule to:

%.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...

-- 
Best regards!


_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to