summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-05-04 00:15:18 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-05-04 21:41:50 +0200
commit8a1cd81b3a0275c0353767bdd2042b3a62decff9 (patch)
treefa37772b7076d63694769906cc30fd1cde82fd8a
parentd964199cc74d8b0079ef4929a2b6a137e201f630 (diff)
downloadrockbox-8a1cd81.tar.gz
rockbox-8a1cd81.tar.bz2
rockbox-8a1cd81.zip
Move building libraries to separate Makefile.
Previously several additional rules were added by qmake to build the required libraries. This has a couple of problems on Windows, requiring the use of a msys shell. Additional variables are passed as environment variables. Windows doesn't understand this. Passing the variables via make command line argument works but make won't be able to change those variables anymore, breaking things. Use intermediate variables passed via make command line that are then exported by the called Makefile. This doesn't work in the generated Makefile since the export lines must not be part of a rule. Also cleans up the project file a bit. Change-Id: Iaffb059ce8bafe17a35bd1e0a74ae7acd966c138
-rw-r--r--rbutil/rbutilqt/Makefile.libs54
-rw-r--r--rbutil/rbutilqt/rbutilqt.pro70
2 files changed, 68 insertions, 56 deletions
diff --git a/rbutil/rbutilqt/Makefile.libs b/rbutil/rbutilqt/Makefile.libs
new file mode 100644
index 0000000000..b3a4c31910
--- /dev/null
+++ b/rbutil/rbutilqt/Makefile.libs
@@ -0,0 +1,54 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+#
+
+ifndef V
+SILENT = @
+endif
+
+TARGET_DIR ?= $(abspath .)/build/
+BUILD_DIR ?= $(abspath .)/build/
+
+# re-export variables that might have been set via command line.
+# If set via command line sub-makefiles cannot override them, so use different
+# variable names in the calling makefile.
+export SYS_SPEEX
+export TARGET_DIR
+export CFLAGS=$(EXTRALIB_CFLAGS)
+export CC=$(EXTRALIBS_CC)
+export AR=$(EXTRALIB_AR)
+
+libs: librbspeex libucl libipodpatcher libsansapatcher libmkamsboot libmktccboot libmkmpioboot libchinachippatcher libmkimxboot
+
+
+librbspeex:
+ $(SILENT) $(MAKE) -C $(RBBASE_DIR)/tools/rbspeex BUILD_DIR=$(BUILD_DIR)/libspeex librbspeex.a
+
+libucl:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/tools/ucl/src BUILD_DIR=$(BUILD_DIR)/ucl libucl.a
+
+libipodpatcher:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/ipodpatcher BUILD_DIR=$(BUILD_DIR)/ipodpatcher APPVERSION="rbutil" libipodpatcher.a
+
+libsansapatcher:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/sansapatcher BUILD_DIR=$(BUILD_DIR)/sansapatcher APPVERSION="rbutil" libsansapatcher.a
+
+libmkamsboot:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkamsboot BUILD_DIR=$(BUILD_DIR)/mkamsboot APPVERSION="rbutil" libmkamsboot.a
+
+libmktccboot:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mktccboot BUILD_DIR=$(BUILD_DIR)/mktccboot APPVERSION="rbutil" libmktccboot.a
+
+libmkmpioboot:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkmpioboot BUILD_DIR=$(BUILD_DIR)/mkmpioboot APPVERSION="rbutil" libmkmpioboot.a
+
+libchinachippatcher:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/chinachippatcher BUILD_DIR=$(BUILD_DIR)/chinachippatcher APPVERSION="rbutil" libchinachippatcher.a
+
+libmkimxboot:
+ $(SILENT)$(MAKE) -C $(RBBASE_DIR)/rbutil/mkimxboot BUILD_DIR=$(BUILD_DIR)/mkimxboot APPVERSION="rbutil" libmkimxboot.a
+
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro
index a082544dc2..4c16ac44cd 100644
--- a/rbutil/rbutilqt/rbutilqt.pro
+++ b/rbutil/rbutilqt/rbutilqt.pro
@@ -31,9 +31,9 @@ MOC_DIR = $$MYBUILDDIR/moc
RCC_DIR = $$MYBUILDDIR/rcc
!silent {
- ADDENV = "V=1"
+ VERBOSE = "V=1"
} else {
- ADDENV = "@"
+ VERBOSE =
}
# check version of Qt installation
@@ -72,65 +72,23 @@ message("Rockbox Base dir: "$$RBBASE_DIR)
# here. This assumes that QMAKE_CC will always be "gcc", maybe with a postfix.
MYAR = $$replace(QMAKE_CC,gcc.*,ar)
-librbspeex.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/rbspeex/ \
+extralibs.commands = $$SILENT \
+ $(MAKE) -f $$RBBASE_DIR/rbutil/rbutilqt/Makefile.libs \
+ $$VERBOSE \
+ SYS_SPEEX=$$LIBSPEEX \
+ BUILD_DIR=$$MYLIBBUILDDIR/ \
TARGET_DIR=$$MYLIBBUILDDIR \
- SYS_SPEEX=\"$$LIBSPEEX\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
-libucl.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/ucl/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/tools/ucl/src libucl.a
-libipodpatcher.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/ipodpatcher/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/ipodpatcher libipodpatcher.a
-libsansapatcher.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/sansapatcher/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/sansapatcher libsansapatcher.a
-libmkamsboot.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/mkamsboot/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot.a
-libmktccboot.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/mktccboot/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/mktccboot libmktccboot.a
-libmkmpioboot.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/mkmpioboot/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/mkmpioboot libmkmpioboot.a
-libchinachippatcher.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/chinachippatcher/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/chinachippatcher libchinachippatcher.a
-libmkimxboot.commands = $$ADDENV \
- BUILD_DIR=$$MYLIBBUILDDIR/mkimxboot/ \
- TARGET_DIR=$$MYLIBBUILDDIR \
- APPVERSION=\"rbutil\" \
- CC=\"$$QMAKE_CC\" CFLAGS=\"$$MACHINEFLAGS\" AR=\"$$MYAR\" \
- $(MAKE) -C $$RBBASE_DIR/rbutil/mkimxboot libmkimxboot.a
+ RBBASE_DIR=$$RBBASE_DIR \
+ EXTRALIBS_CC=\"$$QMAKE_CC\" \
+ EXTRALIB_CFLAGS=\"$$MACHINEFLAGS\" \
+ EXTRALIBS_AR=\"$$MYAR\" \
+ libs
# Note: order is important for RBLIBS! The libs are appended to the linker
# flags in this order, put libucl at the end.
RBLIBS = librbspeex libipodpatcher libsansapatcher libmkamsboot libmktccboot \
libmkmpioboot libchinachippatcher libmkimxboot libucl
-QMAKE_EXTRA_TARGETS += $$RBLIBS
-PRE_TARGETDEPS += $$RBLIBS
+QMAKE_EXTRA_TARGETS += extralibs
+PRE_TARGETDEPS += extralibs
# rule for creating ctags file
tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)