help-make
[Top][All Lists]
Advanced

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

source and objfiles on different paths


From: Riccardo Manfrin
Subject: source and objfiles on different paths
Date: Thu, 06 Jun 2013 23:41:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Hi makers,
I use to list all my $(OBJFILES)

OBJFILES+=foo/foo0.o
OBJFILES+=zoo/foo1.o
OBJFILES+=bar/foo2.o

and then mux their compiling process with rules like the following:

%.o : %.cpp
    $(COMPILE) -c  ... $< -o $@

%.o : %.c
    $(COMPILE) -c  ... $< -o $@

%.o : %.S
    $(COMPILE) -c  ... $< -o $@

My problem is that, having each objfile a peculiar path, the above rules generate the obj file in that same path, whereas I would like to generate the objfiles in a *common place* (e.g: the $(PROJROOT)/build/ directory)

So I need a way to "trim" the paths from the obj files or I need a different approach to list sources and generate objfiles from them.

It would be a real pain to have to first declare the sources and then append a path to each of them.

Do you have any hint on how this issue is typically handled?
Thanks in advance.
RM





reply via email to

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