Il 01/07/2013 12:10, Michael Tokarev ha scritto: >>>> >>> Perhaps we can instead use something like >>>>> >>>> >>>>> >>>> common.o: $(patsubst %,../%, $(common-obj-y)) >>>>> >>>> $(LD) -r -o $@ $^ >>>>> >>>> >>>>> >>>> and then link common.o into the QEMU target. Libtool can also be >>>>> >>>> used >>>>> >>>> to abstract "ld -r". Making libtool mandatory wouldn't be a problem >>>>> >>>> IMO >>>>> >>>> (we'd need it anyway for modules) as long as you do not need libtool >>>>> >>>> to >>>>> >>>> start QEMU or gdb from the build directory. >>> >> I think this will mean that whole common.o will have to be linked >>> >> into each executable which uses it, even if some executables are >>> >> only using just one function from whole lot of .o files. >> > >> > This would be a different common.o for each directory. > Like util/common.o which requires -lrt and -lutil even if a given > app does not use openpty() or timer_create() ?
No, for each target directory. Paolo