From fd5f16c070d5afd6b01a9ff0cdc4ccc1ab01c76a Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 3 Dec 2011 09:41:48 +0000 Subject: [PATCH] Consolidate libraries list in project file a bit. Instead of having to mention each library several times (extra targets, target dependencies, linker flags) create a list of libraries we build directly and create all other lists from them. Note that libraries get processed in the order of the list, which is important for linking order. As a result libucl needs to come last. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31116 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/rbutilqt.pro | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index 7f9ebb8120..fc547525aa 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro @@ -72,7 +72,7 @@ mac { # here. This assumes that QMAKE_CC will always be "gcc", maybe with a postfix. MYAR = $$replace(QMAKE_CC,gcc.*,ar) -rbspeex.commands = @$(MAKE) -s \ +librbspeex.commands = @$(MAKE) -s \ TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/rbspeex \ librbspeex$$RBLIBPOSTFIX \ SYS_SPEEX=\"$$LIBSPEEX\" \ @@ -95,8 +95,11 @@ libmkmpioboot.commands = @$(MAKE) -s \ APPVERSION=\"rbutil\" \ libmkmpioboot$$RBLIBPOSTFIX \ CC=\"$$QMAKE_CC $$MACHINEFLAGS\" AR=\"$$MYAR\" -QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot -PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot +# Note: order is important for RBLIBS! The libs are appended to the linker +# flags in this order, put libucl at the end. +RBLIBS = librbspeex libmkamsboot libmktccboot libmkmpioboot libucl +QMAKE_EXTRA_TARGETS += $$RBLIBS +PRE_TARGETDEPS += $$RBLIBS # rule for creating ctags file tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES) @@ -118,7 +121,13 @@ INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher DEPENDPATH = $$INCLUDEPATH -LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl +LIBS += -L$$OUT_PWD -L$$MYBUILDDIR +# append all RBLIBS to LIBS +for(rblib, RBLIBS) { + LIBS += -l$$replace(rblib, lib,) +} + +# on win32 libz is linked implicitly. !win32 { LIBS += -lz }