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) {
|
2015-05-18 20:44:36 +00:00
|
|
|
message("using ccache at $$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\"
|
2019-11-10 01:52:08 +00:00
|
|
|
EXTRALIBS_OPTS += EXTRALIBS_CXX=\"$$QMAKE_CXX\"
|
2020-05-10 08:32:31 +00:00
|
|
|
EXTRALIBS_OPTS += EXTRALIB_CFLAGS=\"$$MACHINEFLAGS\"
|
|
|
|
EXTRALIBS_OPTS += EXTRALIB_CXXFLAGS=\"$$MACHINEFLAGS\"
|
2020-10-18 16:53:48 +00:00
|
|
|
macx {
|
|
|
|
# on recent macOS we need to pass isysroot to the libs, otherwise it won't find
|
|
|
|
# the standard libaries. This is caused by the passed compiler (doesn't rely on
|
|
|
|
# default compiler but passed full path)
|
|
|
|
EXTRALIBS_OPTS += EXTRALIB_ISYSROOT=\"$$QMAKE_MAC_SDK.macosx.Path\"
|
|
|
|
}
|
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
|
2020-06-09 14:35:40 +00:00
|
|
|
contains(QT_MAJOR_VERSION, 4) {
|
|
|
|
error("Qt 4 is not supported anymore.")
|
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,)
|
|
|
|
|
2015-05-18 20:44:36 +00:00
|
|
|
message("using Rockbox basedir $$RBBASE_DIR")
|
2009-09-04 21:31:17 +00:00
|
|
|
|
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 \
|
2020-08-08 16:46:43 +00:00
|
|
|
mkmpioboot chinachippatcher mkimxboot mks5lboot bspatch ucl \
|
|
|
|
rbtomcrypt
|
2020-10-21 20:17:11 +00:00
|
|
|
# NOTE: Our copy of libbzip2 has to use the name "bz2" to match up with the
|
|
|
|
# distro name. Otherwise cross compiling would end up linking two copies of
|
|
|
|
# bzip2 using different names, causing symbol clashes. Using the same name
|
|
|
|
# makes the compiler pick the one he likes.
|
|
|
|
RBLIBS += bz2
|
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
|
2015-05-13 21:00:49 +00:00
|
|
|
LIBS += -L$$_PRO_FILE_PWD_/msvc
|
2014-03-23 19:47:45 +00:00
|
|
|
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
|
2015-05-30 17:01:33 +00:00
|
|
|
LRELEASE = $$[QT_INSTALL_BINS]/lrelease
|
2019-11-10 06:38:17 +00:00
|
|
|
|
|
|
|
win32:!cross:!exists($$LRELEASE) {
|
2015-05-30 17:01:33 +00:00
|
|
|
LRELEASE = $$[QT_INSTALL_BINS]/lrelease.exe
|
|
|
|
}
|
2015-05-18 20:44:36 +00:00
|
|
|
lrelease.commands = $$LRELEASE -silent $$_PRO_FILE_
|
2008-01-19 18:33:33 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += lrelease
|
2015-05-30 17:16:11 +00:00
|
|
|
exists($$LRELEASE) {
|
2015-05-18 20:44:36 +00:00
|
|
|
message("using lrelease at $$LRELEASE")
|
2008-06-24 21:44:53 +00:00
|
|
|
PRE_TARGETDEPS += lrelease
|
|
|
|
}
|
2015-05-30 17:16:11 +00:00
|
|
|
!exists($$LRELEASE) {
|
2015-05-18 20:44:36 +00:00
|
|
|
warning("could not find lrelease. Skipping translations.")
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
2020-10-21 19:31:13 +00:00
|
|
|
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
|
|
|
|
2020-06-09 14:35:40 +00:00
|
|
|
message("Qt$$QT_MAJOR_VERSION found")
|
2020-07-27 19:15:37 +00:00
|
|
|
QT += widgets
|
|
|
|
if (lessThan(QT_MAJOR_VERSION, 6)) {
|
|
|
|
QT += multimedia
|
|
|
|
}
|
2020-10-29 20:07:42 +00:00
|
|
|
if (greaterThan(QT_MAJOR_VERSION, 5)) {
|
|
|
|
QT += core5compat
|
|
|
|
}
|
2013-01-27 11:16:15 +00:00
|
|
|
|
2019-11-10 06:38:17 +00:00
|
|
|
CONFIG += c++11
|
|
|
|
|
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
|
2015-05-18 20:44:36 +00:00
|
|
|
message("creating debug version")
|
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
|
2015-05-18 20:44:36 +00:00
|
|
|
message("creating release version")
|
2007-09-02 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
2015-03-25 20:58:25 +00:00
|
|
|
DEFINES += RBUTIL _LARGEFILE64_SOURCE
|
2020-06-09 14:35:40 +00:00
|
|
|
DEFINES += QT_DEPRECATED_WARNINGS
|
2007-07-29 17:35:31 +00:00
|
|
|
|
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++
|
|
|
|
}
|
2020-06-09 17:32:07 +00:00
|
|
|
unix:!static:!macx {
|
2009-08-08 12:28:47 +00:00
|
|
|
LIBS += -lusb-1.0
|
|
|
|
}
|
|
|
|
|
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.
|
2020-06-09 17:32:07 +00:00
|
|
|
LIBS += -Wl,-Bstatic -lusb-1.0 -Wl,-Bdynamic
|
2008-02-21 19:55:42 +00:00
|
|
|
}
|
2007-07-29 20:43:07 +00:00
|
|
|
|
2020-06-09 14:35:40 +00:00
|
|
|
macx {
|
|
|
|
QMAKE_MAC_SDK=macosx
|
2014-03-20 21:20:11 +00:00
|
|
|
contains(QT_MAJOR_VERSION, 5) {
|
2016-03-20 19:44:13 +00:00
|
|
|
greaterThan(QT_MINOR_VERSION, 5) {
|
|
|
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
|
|
|
|
message("Qt 5.6+ detected: setting deploy target to 10.7")
|
|
|
|
}
|
|
|
|
!greaterThan(QT_MINOR_VERSION, 5) {
|
|
|
|
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
|
|
|
|
message("Qt up to 5.5 detected: setting deploy target to 10.6")
|
|
|
|
}
|
2014-03-20 21:20:11 +00:00
|
|
|
}
|
2020-06-09 14:35:40 +00:00
|
|
|
|
2010-09-05 09:44:49 +00:00
|
|
|
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
|
2020-06-21 07:38:16 +00:00
|
|
|
dmg.commands = hdiutil create -ov -srcfolder RockboxUtility.app/ RockboxUtility.dmg
|
2008-06-30 14:39:21 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += dmg
|
2007-09-01 21:13:22 +00:00
|
|
|
}
|
|
|
|
|
2007-08-22 22:19:22 +00:00
|
|
|
static {
|
2020-06-09 14:35:40 +00:00
|
|
|
if(equals(QT_MAJOR_VERSION, 5) : lessThan(QT_MINOR_VERSION, 4)) {
|
2019-11-10 01:52:08 +00:00
|
|
|
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
|
|
|
|
2020-06-19 17:47:41 +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)
|