2010-03-21 18:15:17 +00:00
|
|
|
#
|
|
|
|
# __________ __ ___.
|
|
|
|
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
# \/ \/ \/ \/ \/
|
|
|
|
# $Id$
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
# 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")
|
|
|
|
QMAKE_CXX = ccache g++
|
|
|
|
QMAKE_CC = ccache gcc
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-16 20:44:06 +00:00
|
|
|
MYBUILDDIR = $$OUT_PWD/build/
|
|
|
|
OBJECTS_DIR = $$MYBUILDDIR/o
|
|
|
|
UI_DIR = $$MYBUILDDIR/ui
|
|
|
|
MOC_DIR = $$MYBUILDDIR/moc
|
|
|
|
RCC_DIR = $$MYBUILDDIR/rcc
|
|
|
|
|
2007-08-07 18:05:48 +00:00
|
|
|
|
2008-08-31 12:32:27 +00:00
|
|
|
# check version of Qt installation
|
2010-09-23 16:42:01 +00:00
|
|
|
VER = $$find(QT_VERSION, ^4\\.[5-9]+.*)
|
2008-08-31 12:32:27 +00:00
|
|
|
isEmpty(VER) {
|
2010-09-23 16:42:01 +00:00
|
|
|
message("Qt >= 4.5 required!")
|
2008-08-31 12:32:27 +00:00
|
|
|
!isEmpty(QT_VERSION) error("Qt found:" $$[QT_VERSION])
|
|
|
|
}
|
|
|
|
message("Qt version used:" $$VER)
|
|
|
|
|
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)
|
|
|
|
|
2009-10-16 20:44:06 +00:00
|
|
|
# custom rules for rockbox-specific libs
|
2008-07-09 21:41:41 +00:00
|
|
|
!mac {
|
2009-11-28 22:39:05 +00:00
|
|
|
RBLIBPOSTFIX = .a
|
2008-07-09 21:41:41 +00:00
|
|
|
}
|
|
|
|
mac {
|
2009-11-28 22:39:05 +00:00
|
|
|
RBLIBPOSTFIX = -universal
|
2008-07-09 21:41:41 +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)
|
|
|
|
}
|
2010-12-23 18:59:58 +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. This assumes that QMAKE_CC will always be "gcc", maybe with a postfix.
|
|
|
|
MYAR = $$replace(QMAKE_CC,gcc.*,ar)
|
2010-09-05 10:27:39 +00:00
|
|
|
|
2010-03-21 18:15:17 +00:00
|
|
|
rbspeex.commands = @$(MAKE) \
|
|
|
|
TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/rbspeex \
|
2010-12-23 18:59:41 +00:00
|
|
|
librbspeex$$RBLIBPOSTFIX \
|
2010-12-23 18:59:58 +00:00
|
|
|
SYS_SPEEX=\"$$LIBSPEEX\" \
|
|
|
|
CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
|
2010-03-21 18:15:17 +00:00
|
|
|
libucl.commands = @$(MAKE) \
|
|
|
|
TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/ucl/src \
|
2010-12-23 18:59:41 +00:00
|
|
|
libucl$$RBLIBPOSTFIX \
|
2010-12-23 18:59:58 +00:00
|
|
|
CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
|
2010-03-21 18:15:17 +00:00
|
|
|
libmkamsboot.commands = @$(MAKE) \
|
|
|
|
TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkamsboot \
|
2010-12-23 18:59:41 +00:00
|
|
|
APPVERSION=\"rbutil\" \
|
|
|
|
libmkamsboot$$RBLIBPOSTFIX \
|
2010-12-23 18:59:58 +00:00
|
|
|
CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
|
2010-03-21 18:15:17 +00:00
|
|
|
libmktccboot.commands = @$(MAKE) \
|
|
|
|
TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \
|
2010-12-23 18:59:41 +00:00
|
|
|
libmktccboot$$RBLIBPOSTFIX \
|
2010-12-23 18:59:58 +00:00
|
|
|
CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
|
2010-06-04 21:43:15 +00:00
|
|
|
libmkmpioboot.commands = @$(MAKE) \
|
|
|
|
TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkmpioboot \
|
2010-12-23 18:59:41 +00:00
|
|
|
APPVERSION=\"rbutil\" \
|
|
|
|
libmkmpioboot$$RBLIBPOSTFIX \
|
2010-12-23 18:59:58 +00:00
|
|
|
CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
|
2010-06-04 21:43:15 +00:00
|
|
|
QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
|
|
|
|
PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
|
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
|
2010-03-21 18:15:17 +00:00
|
|
|
INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
|
2011-03-25 22:16:12 +00:00
|
|
|
$$_PRO_FILE_PWD_/quazip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
|
2010-03-21 18:15:17 +00:00
|
|
|
INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \
|
|
|
|
$$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
|
2008-09-28 17:02:36 +00:00
|
|
|
|
2009-09-23 19:57:37 +00:00
|
|
|
DEPENDPATH = $$INCLUDEPATH
|
|
|
|
|
2011-03-03 19:31:26 +00:00
|
|
|
LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl
|
|
|
|
!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
|
2007-09-02 22:11:46 +00:00
|
|
|
dbg {
|
|
|
|
CONFIG += debug thread qt warn_on
|
|
|
|
DEFINES -= QT_NO_DEBUG_OUTPUT
|
|
|
|
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 -= QT_NO_DEBUG_OUTPUT
|
|
|
|
DEFINES += NODEBUG
|
2007-09-02 22:11:46 +00:00
|
|
|
message("release")
|
2007-09-02 18:59:38 +00:00
|
|
|
}
|
|
|
|
|
2007-07-29 20:43:07 +00:00
|
|
|
DEFINES += RBUTIL _LARGEFILE64_SOURCE
|
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
|
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++
|
|
|
|
}
|
2010-09-05 18:19:23 +00:00
|
|
|
unix:!static:!libusb1:!macx {
|
2007-09-23 10:34:28 +00:00
|
|
|
LIBS += -lusb
|
2007-07-29 17:35:31 +00:00
|
|
|
}
|
2010-09-05 18:19:23 +00:00
|
|
|
unix:!static:libusb1:!macx {
|
2009-08-08 12:28:47 +00:00
|
|
|
DEFINES += LIBUSB1
|
|
|
|
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.
|
|
|
|
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
|
|
|
|
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
|
|
|
|
QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk
|
|
|
|
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
|
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)
|
2008-09-08 21:11:55 +00:00
|
|
|
|