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) -s \
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) -s \
79 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/tools/ucl/src \
80 libucl$$RBLIBPOSTFIX \
81 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
82 libmkamsboot.commands = @$(MAKE) -s \
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) -s \
88 TARGET_DIR=$$MYBUILDDIR -C $$RBBASE_DIR/rbutil/mktccboot \
89 libmktccboot$$RBLIBPOSTFIX \
90 CC=\"$$QMAKE_CC\" AR=\"$$MYAR\"
91 libmkmpioboot.commands = @$(MAKE) -s \
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
139 CONFIG
+= release thread qt
140 DEFINES
-= QT_NO_DEBUG_OUTPUT
145 DEFINES
+= RBUTIL _LARGEFILE64_SOURCE
149 # use MinGW's implementation of stdio functions for extended format string
151 DEFINES += __USE_MINGW_ANSI_STDIO=1
152 LIBS += -lsetupapi -lnetapi32
155 QMAKE_LFLAGS += -static-libgcc -static-libstdc++
157 unix:!static:!libusb0:!macx {
161 unix:!static:libusb0:!macx {
166 # force statically linking of libusb. Libraries that are appended
167 # later will get linked dynamically again.
168 LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
171 # if -config intel is specified use 10.5 SDK and don't build for PPC
174 QMAKE_LFLAGS_PPC
=-mmacosx
-version
-min
=10.4 -arch ppc
175 QMAKE_LFLAGS_X86
=-mmacosx
-version
-min
=10.4 -arch i386
176 QMAKE_MAC_SDK
=/Developer
/SDKs
/MacOSX10
.4u
.sdk
179 QMAKE_LFLAGS_X86
=-mmacosx
-version
-min
=10.5 -arch i386
180 QMAKE_MAC_SDK
=/Developer
/SDKs
/MacOSX10
.5
.sdk
181 QMAKE_MACOSX_DEPLOYMENT_TARGET
= 10.5
185 LIBS
+= -L
/usr
/local
/lib \
186 -framework IOKit
-framework CoreFoundation
-framework Carbon \
187 -framework SystemConfiguration
-framework CoreServices
188 INCLUDEPATH
+= /usr
/local
/include
190 # rule for creating a dmg file
191 dmg
.commands
= hdiutil create
-ov
-srcfolder rbutilqt
.app
/ rbutil
.dmg
192 QMAKE_EXTRA_TARGETS
+= dmg
196 QTPLUGIN
+= qtaccessiblewidgets
197 LIBS
+= -L$$
(QT_BUILD_TREE
)/plugins
/accessible
-lqtaccessiblewidgets
200 message("using static plugin")
204 target
.path
= /usr
/local
/bin
208 # source files are separate.
209 include(rbutilqt
.pri
)