2010-03-21 18:15:17 +00:00
|
|
|
#
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
#
|
|
|
|
# All files in this archive are subject to the GNU General Public License.
|
|
|
|
# See the file COPYING in the source tree root for full license agreement.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
2009-09-04 21:31:17 +00:00
|
|
|
|
2013-05-10 09:59:28 +00:00
|
|
|
# The external Makefiles use ar to create libs. To allow cross-compiling pass
|
|
|
|
# the ar that matches the current gcc. Since qmake doesn't provide a variable
|
|
|
|
# holding the correct ar without any additions we need to figure it ourselves
|
|
|
|
# here.
|
|
|
|
# Only do this if CC is gcc. Also, do this before ccache support is enabled.
|
|
|
|
contains(QMAKE_CC,($$find(QMAKE_CC,.*gcc.*))) {
|
|
|
|
EXTRALIBS_OPTS = "EXTRALIBS_AR=\""$$replace(QMAKE_CC,gcc.*,ar)\"
|
|
|
|
}
|
2009-09-04 21:31:17 +00:00
|
|
|
# ccache
|
2009-10-04 16:41:24 +00:00
|
|
|
unix:!mac:!noccache {
|
2007-08-07 18:05:48 +00:00
|
|
|
CCACHE = $$system(which ccache)
|
|
|
|
!isEmpty(CCACHE) {
|
|
|
|
message("using ccache")
|
2012-04-28 14:40:35 +00:00
|
|
|
QMAKE_CXX = ccache $$QMAKE_CXX
|
|
|
|
QMAKE_CC = ccache $$QMAKE_CC
|
2007-08-07 18:05:48 +00:00
|
|
|
}
|
|
|
|
}
|
2013-05-10 09:59:28 +00:00
|
|
|
MACHINEFLAGS = $$find(QMAKE_CFLAGS, -m[63][42])
|
|
|
|
EXTRALIBS_OPTS += EXTRALIBS_CC=\"$$QMAKE_CC\"
|
|
|
|
EXTRALIBS_OPTS += EXTRALIB_CFLAGS=\"$$MACHINEFLAGS\" \
|
2007-08-07 18:05:48 +00:00
|
|
|
|
2009-10-16 20:44:06 +00:00
|
|
|
MYBUILDDIR = $$OUT_PWD/build/
|
2012-01-02 16:59:29 +00:00
|
|
|
MYLIBBUILDDIR = $$MYBUILDDIR/libs/
|
2009-10-16 20:44:06 +00:00
|
|
|
OBJECTS_DIR = $$MYBUILDDIR/o
|
|
|
|
UI_DIR = $$MYBUILDDIR/ui
|
|
|
|
MOC_DIR = $$MYBUILDDIR/moc
|
|
|
|
RCC_DIR = $$MYBUILDDIR/rcc
|
|
|
|
|
2012-01-02 16:59:29 +00:00
|
|
|
!silent {
|
2013-05-03 22:15:18 +00:00
|
|
|
VERBOSE = "V=1"
|
2012-01-02 16:59:29 +00:00
|
|
|
} else {
|
2013-05-03 22:15:18 +00:00
|
|
|
VERBOSE =
|
2012-01-02 16:59:29 +00:00
|
|
|
}
|
2007-08-07 18:05:48 +00:00
|
|
|
|
2008-08-31 12:32:27 +00:00
|
|
|
# check version of Qt installation
|
2013-01-27 11:16:15 +00:00
|
|
|
!contains(QT_MAJOR_VERSION, 5) {
|
|
|
|
VER = $$find(QT_VERSION, ^4\\.[5-9]+.*)
|
|
|
|
isEmpty(VER) {
|
|
|
|
message("Qt >= 4.5 required!")
|
|
|
|
!isEmpty(QT_VERSION) error("Qt found:" $$[QT_VERSION])
|
|
|
|
}
|
2008-08-31 12:32:27 +00:00
|
|
|
message("Qt version used:" $$VER)
|
2013-01-27 11:16:15 +00:00
|
|
|
}
|
2008-08-31 12:32:27 +00:00
|
|
|
|
2009-09-04 21:31:17 +00:00
|
|
|
RBBASE_DIR = $$_PRO_FILE_PWD_
|
|
|
|
RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,)
|
|
|
|
|
|
|
|
message("Rockbox Base dir: "$$RBBASE_DIR)
|
|
|
|
|
2010-09-05 10:27:39 +00:00
|
|
|
# check for system speex. Add a custom rule for pre-building librbspeex if not
|
|
|
|
# found. Newer versions of speex are split up into libspeex and libspeexdsp,
|
|
|
|
# and some distributions package them separately. Check for both and fall back
|
|
|
|
# to librbspeex if not found.
|
|
|
|
# NOTE: keep adding the linker option after -lrbspeex, otherwise linker errors
|
|
|
|
# occur if the linker defaults to --as-needed
|
|
|
|
# (see http://www.gentoo.org/proj/en/qa/asneeded.xml)
|
|
|
|
#
|
|
|
|
# Always use our own copy when building statically. Don't search for libspeex
|
|
|
|
# on Mac, since we don't deploy statically there.
|
|
|
|
!static:unix:!mac {
|
|
|
|
LIBSPEEX = $$system(pkg-config --silence-errors --libs speex speexdsp)
|
|
|
|
}
|
|
|
|
|
2013-05-03 22:15:18 +00:00
|
|
|
extralibs.commands = $$SILENT \
|
|
|
|
$(MAKE) -f $$RBBASE_DIR/rbutil/rbutilqt/Makefile.libs \
|
|
|
|
$$VERBOSE \
|
2013-05-10 09:59:28 +00:00
|
|
|
SYS_SPEEX=\"$$LIBSPEEX\" \
|
2013-05-03 22:15:18 +00:00
|
|
|
BUILD_DIR=$$MYLIBBUILDDIR/ \
|
2012-01-02 16:59:29 +00:00
|
|
|
TARGET_DIR=$$MYLIBBUILDDIR \
|
2013-05-03 22:15:18 +00:00
|
|
|
RBBASE_DIR=$$RBBASE_DIR \
|
2013-05-10 09:59:28 +00:00
|
|
|
$$EXTRALIBS_OPTS \
|
2013-05-03 22:15:18 +00:00
|
|
|
libs
|
2011-12-03 09:41:48 +00:00
|
|
|
# Note: order is important for RBLIBS! The libs are appended to the linker
|
|
|
|
# flags in this order, put libucl at the end.
|
2013-05-10 09:59:28 +00:00
|
|
|
RBLIBS = rbspeex ipodpatcher sansapatcher mkamsboot mktccboot \
|
|
|
|
mkmpioboot chinachippatcher mkimxboot ucl
|
2014-03-23 19:47:45 +00:00
|
|
|
!win32-msvc* {
|
2014-03-22 21:20:48 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += extralibs
|
|
|
|
PRE_TARGETDEPS += extralibs
|
|
|
|
}
|
2014-03-23 19:47:45 +00:00
|
|
|
win32-msvc* {
|
2014-03-22 21:20:48 +00:00
|
|
|
INCLUDEPATH += msvc
|
2014-03-23 19:47:45 +00:00
|
|
|
LIBS += -L$$_PRO_FILE_/msvc
|
|
|
|
LIBS += -ladvapi32 # required for MSVC / Qt Creator combination
|
2014-03-22 21:20:48 +00:00
|
|
|
}
|
2007-12-15 15:36:40 +00:00
|
|
|
|
2008-06-15 20:53:51 +00:00
|
|
|
# rule for creating ctags file
|
2008-09-28 17:02:36 +00:00
|
|
|
tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
|
2008-06-15 20:53:51 +00:00
|
|
|
tags.depends = $(SOURCES)
|
|
|
|
QMAKE_EXTRA_TARGETS += tags
|
|
|
|
|
2008-02-21 19:55:42 +00:00
|
|
|
# add a custom rule for making the translations
|
2009-09-04 21:31:17 +00:00
|
|
|
lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_
|
2008-01-19 18:33:33 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += lrelease
|
2008-06-24 21:44:53 +00:00
|
|
|
!dbg {
|
|
|
|
PRE_TARGETDEPS += lrelease
|
|
|
|
}
|
2008-01-19 18:33:33 +00:00
|
|
|
|
2007-08-07 18:05:48 +00:00
|
|
|
# Needed by QT on Win
|
2014-03-22 21:20:48 +00:00
|
|
|
INCLUDEPATH += $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
|
2012-02-14 20:02:52 +00:00
|
|
|
$$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base \
|
|
|
|
$$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/gui
|
2010-03-21 18:15:17 +00:00
|
|
|
INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \
|
|
|
|
$$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
|
2013-11-03 10:08:18 +00:00
|
|
|
INCLUDEPATH += logger
|
2008-09-28 17:02:36 +00:00
|
|
|
|
2009-09-23 19:57:37 +00:00
|
|
|
DEPENDPATH = $$INCLUDEPATH
|
|
|
|
|
2012-01-02 16:59:29 +00:00
|
|
|
LIBS += -L$$OUT_PWD -L$$MYLIBBUILDDIR
|
2011-12-03 09:41:48 +00:00
|
|
|
# append all RBLIBS to LIBS
|
|
|
|
for(rblib, RBLIBS) {
|
2013-05-10 09:59:28 +00:00
|
|
|
LIBS += -l$$rblib
|
2011-12-03 09:41:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# on win32 libz is linked implicitly.
|
2011-03-03 19:31:26 +00:00
|
|
|
!win32 {
|
|
|
|
LIBS += -lz
|
|
|
|
}
|
2007-12-14 19:26:54 +00:00
|
|
|
|
2010-09-05 10:27:39 +00:00
|
|
|
# Add a (possibly found) libspeex now, don't do this before -lrbspeex!
|
2010-03-11 19:14:33 +00:00
|
|
|
!static:!isEmpty(LIBSPEEX) {
|
|
|
|
LIBS += $$LIBSPEEX
|
|
|
|
}
|
|
|
|
|
2007-07-29 17:35:31 +00:00
|
|
|
TEMPLATE = app
|
2010-03-21 18:15:17 +00:00
|
|
|
TARGET = RockboxUtility
|
|
|
|
QT += network
|
2013-01-27 11:16:15 +00:00
|
|
|
|
|
|
|
contains(QT_MAJOR_VERSION, 5) {
|
|
|
|
message("Qt5 found")
|
|
|
|
QT += widgets
|
2013-04-03 21:43:27 +00:00
|
|
|
win32 {
|
|
|
|
QT += multimedia
|
|
|
|
}
|
2014-03-20 21:20:11 +00:00
|
|
|
macx {
|
|
|
|
QT += multimedia
|
|
|
|
}
|
2013-01-27 11:16:15 +00:00
|
|
|
}
|
|
|
|
|
2007-09-02 22:11:46 +00:00
|
|
|
dbg {
|
|
|
|
CONFIG += debug thread qt warn_on
|
2011-07-16 22:08:03 +00:00
|
|
|
DEFINES += DBG
|
2007-09-02 22:11:46 +00:00
|
|
|
message("debug")
|
2007-09-02 18:59:38 +00:00
|
|
|
}
|
2007-09-02 22:11:46 +00:00
|
|
|
!dbg {
|
|
|
|
CONFIG += release thread qt
|
2009-08-15 17:02:25 +00:00
|
|
|
DEFINES += NODEBUG
|
2007-09-02 22:11:46 +00:00
|
|
|
message("release")
|
2007-09-02 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
2015-03-25 20:58:25 +00:00
|
|
|
DEFINES += RBUTIL _LARGEFILE64_SOURCE
|
2007-07-29 17:35:31 +00:00
|
|
|
|
2013-06-08 22:06:38 +00:00
|
|
|
# check version of Qt installation
|
2013-11-03 10:31:50 +00:00
|
|
|
!contains(QT_MAJOR_VERSION, 5):!macx:!*-msvc* {
|
2013-06-08 22:06:38 +00:00
|
|
|
# suppress warnings in Qt 4.8 shown by gcc 4.8
|
|
|
|
QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
|
|
|
|
}
|
2010-03-21 18:15:17 +00:00
|
|
|
# platform specific
|
2007-08-07 16:48:45 +00:00
|
|
|
win32 {
|
2010-12-05 15:24:10 +00:00
|
|
|
# use MinGW's implementation of stdio functions for extended format string
|
|
|
|
# support.
|
|
|
|
DEFINES += __USE_MINGW_ANSI_STDIO=1
|
2011-12-07 20:13:14 +00:00
|
|
|
DEFINES += _CRT_SECURE_NO_WARNINGS
|
2012-05-14 21:39:17 +00:00
|
|
|
DEFINES += UNICODE
|
2008-06-21 10:28:10 +00:00
|
|
|
LIBS += -lsetupapi -lnetapi32
|
2007-07-29 17:35:31 +00:00
|
|
|
}
|
2010-09-23 17:53:53 +00:00
|
|
|
win32:static {
|
|
|
|
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
|
|
|
|
}
|
2011-08-09 22:00:10 +00:00
|
|
|
unix:!static:!libusb0:!macx {
|
2009-08-08 12:28:47 +00:00
|
|
|
DEFINES += LIBUSB1
|
|
|
|
LIBS += -lusb-1.0
|
|
|
|
}
|
2011-08-09 22:00:10 +00:00
|
|
|
unix:!static:libusb0:!macx {
|
|
|
|
LIBS += -lusb
|
|
|
|
}
|
2009-08-08 12:28:47 +00:00
|
|
|
|
2010-09-05 18:19:23 +00:00
|
|
|
unix:!macx:static {
|
2008-05-17 14:50:51 +00:00
|
|
|
# force statically linking of libusb. Libraries that are appended
|
|
|
|
# later will get linked dynamically again.
|
|
|
|
LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
|
2008-02-21 19:55:42 +00:00
|
|
|
}
|
2007-07-29 20:43:07 +00:00
|
|
|
|
2010-09-05 09:44:49 +00:00
|
|
|
# if -config intel is specified use 10.5 SDK and don't build for PPC
|
2014-03-20 21:20:11 +00:00
|
|
|
contains(QT_MAJOR_VERSION, 5) {
|
|
|
|
macx {
|
|
|
|
CONFIG += intel
|
|
|
|
message("Qt5 doesn't support PPC anymore, building x86 only")
|
|
|
|
}
|
|
|
|
}
|
2010-09-05 09:44:49 +00:00
|
|
|
macx:!intel {
|
|
|
|
CONFIG += ppc
|
2008-07-09 20:36:38 +00:00
|
|
|
QMAKE_LFLAGS_PPC=-mmacosx-version-min=10.4 -arch ppc
|
|
|
|
QMAKE_LFLAGS_X86=-mmacosx-version-min=10.4 -arch i386
|
2010-09-05 09:44:49 +00:00
|
|
|
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
|
|
|
|
}
|
|
|
|
macx:intel {
|
|
|
|
QMAKE_LFLAGS_X86=-mmacosx-version-min=10.5 -arch i386
|
2014-03-20 21:20:11 +00:00
|
|
|
contains(QT_MAJOR_VERSION, 5) {
|
|
|
|
QMAKE_MAC_SDK=macosx
|
|
|
|
}
|
|
|
|
!contains(QT_MAJOR_VERSION, 5) {
|
|
|
|
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk
|
|
|
|
}
|
2010-09-05 09:44:49 +00:00
|
|
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
|
|
|
|
}
|
|
|
|
macx {
|
|
|
|
CONFIG += x86
|
2010-12-23 18:59:58 +00:00
|
|
|
LIBS += -L/usr/local/lib \
|
2010-04-02 21:32:51 +00:00
|
|
|
-framework IOKit -framework CoreFoundation -framework Carbon \
|
|
|
|
-framework SystemConfiguration -framework CoreServices
|
2007-10-13 16:26:38 +00:00
|
|
|
INCLUDEPATH += /usr/local/include
|
2013-01-27 11:16:15 +00:00
|
|
|
|
2008-06-30 14:39:21 +00:00
|
|
|
# rule for creating a dmg file
|
|
|
|
dmg.commands = hdiutil create -ov -srcfolder rbutilqt.app/ rbutil.dmg
|
|
|
|
QMAKE_EXTRA_TARGETS += dmg
|
2007-09-01 21:13:22 +00:00
|
|
|
}
|
|
|
|
|
2007-08-22 22:19:22 +00:00
|
|
|
static {
|
|
|
|
QTPLUGIN += qtaccessiblewidgets
|
|
|
|
LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
|
2008-07-06 19:46:48 +00:00
|
|
|
LIBS += -L.
|
2007-08-22 22:19:22 +00:00
|
|
|
DEFINES += STATIC
|
|
|
|
message("using static plugin")
|
|
|
|
}
|
2007-07-29 20:43:07 +00:00
|
|
|
|
2008-05-24 16:57:40 +00:00
|
|
|
unix {
|
|
|
|
target.path = /usr/local/bin
|
|
|
|
INSTALLS += target
|
|
|
|
}
|
2008-01-06 22:06:13 +00:00
|
|
|
|
2010-03-21 18:15:17 +00:00
|
|
|
# source files are separate.
|
|
|
|
include(rbutilqt.pri)
|
2015-03-25 20:58:25 +00:00
|
|
|
include(quazip/quazip.pri)
|
|
|
|
include(logger/logger.pri)
|
2008-09-08 21:11:55 +00:00
|
|
|
|