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
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make