3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 # All files in this archive are subject to the GNU General Public License.
11 # See the file COPYING in the source tree root for full license agreement.
13 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
14 # KIND, either express or implied.
19 CCACHE
= $$
system(which ccache
)
21 message("using ccache")
22 QMAKE_CXX
= ccache g
++
27 MYBUILDDIR
= $$OUT_PWD
/build
/
28 OBJECTS_DIR
= $$MYBUILDDIR
/o
29 UI_DIR
= $$MYBUILDDIR
/ui
30 MOC_DIR
= $$MYBUILDDIR
/moc
31 RCC_DIR
= $$MYBUILDDIR
/rcc
34 # check version of Qt installation
35 VER
= $$
find(QT_VERSION
, ^
4\
.[5-9]+.*)
37 !isEmpty(QT_VERSION
) error("Qt found:" $$
[QT_VERSION
])
38 error("Qt >= 4.3 required!")
40 message("Qt version used:" $$VER
)
42 RBBASE_DIR
= $$_PRO_FILE_PWD_
43 RBBASE_DIR
= $$
replace(RBBASE_DIR
,/rbutil
/rbutilqt
,)
45 message("Rockbox Base dir: "$$RBBASE_DIR
)
47 # custom rules for rockbox-specific libs
52 RBLIBPOSTFIX
= -universal
54 rbspeex
.commands
= @$
(MAKE
) \
55 TARGET_DIR
=$$MYBUILDDIR
-C $$RBBASE_DIR
/tools
/rbspeex \
56 librbspeex$$RBLIBPOSTFIX CC
=\"$$QMAKE_CC
\"
57 libucl
.commands
= @$
(MAKE
) \
58 TARGET_DIR
=$$MYBUILDDIR
-C $$RBBASE_DIR
/tools
/ucl
/src \
59 libucl$$RBLIBPOSTFIX CC
=\"$$QMAKE_CC
\"
60 libmkamsboot
.commands
= @$
(MAKE
) \
61 TARGET_DIR
=$$MYBUILDDIR
-C $$RBBASE_DIR
/rbutil
/mkamsboot \
62 libmkamsboot$$RBLIBPOSTFIX CC
=\"$$QMAKE_CC
\"
63 libmktccboot
.commands
= @$
(MAKE
) \
64 TARGET_DIR
=$$MYBUILDDIR
-C $$RBBASE_DIR
/rbutil
/mktccboot \
65 libmktccboot$$RBLIBPOSTFIX CC
=\"$$QMAKE_CC
\"
66 libmkmpioboot
.commands
= @$
(MAKE
) \
67 TARGET_DIR
=$$MYBUILDDIR
-C $$RBBASE_DIR
/rbutil
/mkmpioboot \
68 libmkmpioboot$$RBLIBPOSTFIX CC
=\"$$QMAKE_CC
\"
69 QMAKE_EXTRA_TARGETS
+= rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
70 PRE_TARGETDEPS
+= rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
72 # rule for creating ctags file
73 tags
.commands
= ctags
-R
--c
++-kinds
=+p
--fields
=+iaS
--extra
=+q $
(SOURCES
)
74 tags
.depends
= $
(SOURCES
)
75 QMAKE_EXTRA_TARGETS
+= tags
77 # add a custom rule for making the translations
78 lrelease
.commands
= $$
[QT_INSTALL_BINS
]/lrelease
-silent $$_PRO_FILE_
79 QMAKE_EXTRA_TARGETS
+= lrelease
81 PRE_TARGETDEPS
+= lrelease
85 INCLUDEPATH
= $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_
/irivertools \
86 $$_PRO_FILE_PWD_
/zip $$_PRO_FILE_PWD_
/zlib $$_PRO_FILE_PWD_
/base
87 INCLUDEPATH
+= $$RBBASE_DIR
/rbutil
/ipodpatcher $$RBBASE_DIR
/rbutil
/sansapatcher \
88 $$RBBASE_DIR
/tools
/rbspeex $$RBBASE_DIR
/tools
90 DEPENDPATH
= $$INCLUDEPATH
92 LIBS
+= -L$$OUT_PWD
-L$$MYBUILDDIR
-lrbspeex
-lmkamsboot
-lmktccboot
-lmkmpioboot
-lucl
94 # check for system speex. Add a custom rule for pre-building librbspeex if not
95 # found. Newer versions of speex are split up into libspeex and libspeexdsp,
96 # and some distributions package them separately. Check for both and fall back
97 # to librbspeex if not found.
98 # NOTE: keep this after -lrbspeex, otherwise linker errors occur if the linker
99 # defaults to --as-needed (see http://www.gentoo.org/proj/en/qa/asneeded.xml)
100 LIBSPEEX
= $$
system(pkg
-config
--silence
-errors
--libs speex speexdsp
)
101 !static
:!isEmpty(LIBSPEEX
) {
106 TARGET
= RockboxUtility
109 CONFIG
+= debug thread qt warn_on
110 DEFINES
-= QT_NO_DEBUG_OUTPUT
114 CONFIG
+= release thread qt
115 DEFINES
-= QT_NO_DEBUG_OUTPUT
120 DEFINES
+= RBUTIL _LARGEFILE64_SOURCE
124 LIBS
+= -lsetupapi
-lnetapi32
126 unix
:!static
:!libusb1
{
129 unix
:!static
:libusb1
{
135 # force statically linking of libusb. Libraries that are appended
136 # later will get linked dynamically again.
137 LIBS
+= -Wl
,-Bstatic
-lusb
-Wl
,-Bdynamic
141 QMAKE_MAC_SDK
=/Developer
/SDKs
/MacOSX10
.4u
.sdk
142 QMAKE_LFLAGS_PPC
=-mmacosx
-version
-min
=10.4 -arch ppc
143 QMAKE_LFLAGS_X86
=-mmacosx
-version
-min
=10.4 -arch i386
145 LIBS
+= -L
/usr
/local
/lib
-lz \
146 -framework IOKit
-framework CoreFoundation
-framework Carbon \
147 -framework SystemConfiguration
-framework CoreServices
148 INCLUDEPATH
+= /usr
/local
/include
150 # rule for creating a dmg file
151 dmg
.commands
= hdiutil create
-ov
-srcfolder rbutilqt
.app
/ rbutil
.dmg
152 QMAKE_EXTRA_TARGETS
+= dmg
156 QTPLUGIN
+= qtaccessiblewidgets
157 LIBS
+= -L$$
(QT_BUILD_TREE
)/plugins
/accessible
-lqtaccessiblewidgets
160 message("using static plugin")
164 target
.path
= /usr
/local
/bin
168 # source files are separate.
169 include(rbutilqt
.pri
)