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 message("Qt >= 4.5 required!")
38 !isEmpty(QT_VERSION
) error("Qt found:" $$
[QT_VERSION
])
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 # check for system speex. Add a custom rule for pre-building librbspeex if not
55 # found. Newer versions of speex are split up into libspeex and libspeexdsp,
56 # and some distributions package them separately. Check for both and fall back
57 # to librbspeex if not found.
58 # NOTE: keep adding the linker option after -lrbspeex, otherwise linker errors
59 # occur if the linker defaults to --as-needed
60 # (see http://www.gentoo.org/proj/en/qa/asneeded.xml)
62 # Always use our own copy when building statically. Don't search for libspeex
63 # on Mac, since we don't deploy statically there.
65 LIBSPEEX
= $$
system(pkg
-config
--silence
-errors
--libs speex speexdsp
)
67 # The external Makefiles use ar to create libs. To allow cross-compiling pass
68 # the ar that matches the current gcc. Since qmake doesn't provide a variable
69 # holding the correct ar without any additions we need to figure it ourselves
70 # here. This assumes that QMAKE_CC will always be "gcc", maybe with a postfix.
71 MYAR = $$replace(QMAKE_CC,gcc.*,ar)
73 rbspeex.commands = @$(MAKE) \
74 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/rbspeex \
75 librbspeex$$RBLIBPOSTFIX \
76 SYS_SPEEX=\"$$LIBSPEEX\" \
77 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
78 libucl.commands = @$(MAKE) \
79 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/ucl/src \
80 libucl$$RBLIBPOSTFIX \
81 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
82 libmkamsboot.commands = @$(MAKE) \
83 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkamsboot \
84 APPVERSION=\"rbutil\" \
85 libmkamsboot$$RBLIBPOSTFIX \
86 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
87 libmktccboot.commands = @$(MAKE) \
88 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \
89 libmktccboot$$RBLIBPOSTFIX \
90 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
91 libmkmpioboot.commands = @$(MAKE) \
92 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mkmpioboot \
93 APPVERSION=\"rbutil\" \
94 libmkmpioboot$$RBLIBPOSTFIX \
95 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
96 QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
97 PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot libmkmpioboot
99 # rule for creating ctags file
100 tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
101 tags.depends = $(SOURCES)
102 QMAKE_EXTRA_TARGETS += tags
104 # add a custom rule for making the translations
105 lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_
106 QMAKE_EXTRA_TARGETS += lrelease
108 PRE_TARGETDEPS += lrelease
111 # Needed by QT on Win
112 INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
113 $$_PRO_FILE_PWD_/quazip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
114 INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \
115 $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
117 DEPENDPATH = $$INCLUDEPATH
119 LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lmkmpioboot -lucl
124 # Add a (possibly found) libspeex now, don't do this before -lrbspeex!
125 !static
:!isEmpty(LIBSPEEX
) {
130 TARGET
= RockboxUtility
133 CONFIG
+= debug thread qt warn_on
134 DEFINES
-= QT_NO_DEBUG_OUTPUT
138 CONFIG
+= release thread qt
139 DEFINES
-= QT_NO_DEBUG_OUTPUT
144 DEFINES
+= RBUTIL _LARGEFILE64_SOURCE
148 # use MinGW's implementation of stdio functions for extended format string
150 DEFINES += __USE_MINGW_ANSI_STDIO=1
151 LIBS += -lsetupapi -lnetapi32
154 QMAKE_LFLAGS += -static-libgcc -static-libstdc++
156 unix:!static:!libusb1:!macx {
159 unix:!static:libusb1:!macx {
165 # force statically linking of libusb. Libraries that are appended
166 # later will get linked dynamically again.
167 LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
170 # if -config intel is specified use 10.5 SDK and don't build for PPC
173 QMAKE_LFLAGS_PPC
=-mmacosx
-version
-min
=10.4 -arch ppc
174 QMAKE_LFLAGS_X86
=-mmacosx
-version
-min
=10.4 -arch i386
175 QMAKE_MAC_SDK
=/Developer
/SDKs
/MacOSX10
.4u
.sdk
178 QMAKE_LFLAGS_X86
=-mmacosx
-version
-min
=10.5 -arch i386
179 QMAKE_MAC_SDK
=/Developer
/SDKs
/MacOSX10
.5
.sdk
180 QMAKE_MACOSX_DEPLOYMENT_TARGET
= 10.5
184 LIBS
+= -L
/usr
/local
/lib \
185 -framework IOKit
-framework CoreFoundation
-framework Carbon \
186 -framework SystemConfiguration
-framework CoreServices
187 INCLUDEPATH
+= /usr
/local
/include
189 # rule for creating a dmg file
190 dmg
.commands
= hdiutil create
-ov
-srcfolder rbutilqt
.app
/ rbutil
.dmg
191 QMAKE_EXTRA_TARGETS
+= dmg
195 QTPLUGIN
+= qtaccessiblewidgets
196 LIBS
+= -L$$
(QT_BUILD_TREE
)/plugins
/accessible
-lqtaccessiblewidgets
199 message("using static plugin")
203 target
.path
= /usr
/local
/bin
207 # source files are separate.
208 include(rbutilqt
.pri
)