Coldfire strlen, slight optimization pointed out by amiconn, eliminate some unconditi...
[kugel-rb.git] / rbutil / rbutilqt / rbutilqt.pro
blobbb191f59c9b19982d059b75408137ae9d4a09711
2 # __________ __ ___.
3 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 # \/ \/ \/ \/ \/
8 # $Id$
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.
17 # ccache
18 unix:!mac:!noccache {
19 CCACHE = $$system(which ccache)
20 !isEmpty(CCACHE) {
21 message("using ccache")
22 QMAKE_CXX = ccache g++
23 QMAKE_CC = ccache gcc
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]+.*)
36 isEmpty(VER) {
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
48 !mac {
49 RBLIBPOSTFIX = .a
51 mac {
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 QMAKE_EXTRA_TARGETS += rbspeex libucl libmkamsboot libmktccboot
67 PRE_TARGETDEPS += rbspeex libucl libmkamsboot libmktccboot
69 # rule for creating ctags file
70 tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
71 tags.depends = $(SOURCES)
72 QMAKE_EXTRA_TARGETS += tags
74 # add a custom rule for making the translations
75 lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_
76 QMAKE_EXTRA_TARGETS += lrelease
77 !dbg {
78 PRE_TARGETDEPS += lrelease
81 # Needed by QT on Win
82 INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
83 $$_PRO_FILE_PWD_/zip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
84 INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher \
85 $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
87 DEPENDPATH = $$INCLUDEPATH
89 LIBS += -L$$OUT_PWD -L$$MYBUILDDIR -lrbspeex -lmkamsboot -lmktccboot -lucl
91 # check for system speex. Add a custom rule for pre-building librbspeex if not
92 # found. Newer versions of speex are split up into libspeex and libspeexdsp,
93 # and some distributions package them separately. Check for both and fall back
94 # to librbspeex if not found.
95 # NOTE: keep this after -lrbspeex, otherwise linker errors occur if the linker
96 # defaults to --as-needed (see http://www.gentoo.org/proj/en/qa/asneeded.xml)
97 LIBSPEEX = $$system(pkg-config --silence-errors --libs speex speexdsp)
98 !static:!isEmpty(LIBSPEEX) {
99 LIBS += $$LIBSPEEX
102 TEMPLATE = app
103 TARGET = RockboxUtility
104 QT += network
105 dbg {
106 CONFIG += debug thread qt warn_on
107 DEFINES -= QT_NO_DEBUG_OUTPUT
108 message("debug")
110 !dbg {
111 CONFIG += release thread qt
112 DEFINES -= QT_NO_DEBUG_OUTPUT
113 DEFINES += NODEBUG
114 message("release")
117 DEFINES += RBUTIL _LARGEFILE64_SOURCE
119 # platform specific
120 win32 {
121 LIBS += -lsetupapi -lnetapi32
123 unix:!static:!libusb1 {
124 LIBS += -lusb
126 unix:!static:libusb1 {
127 DEFINES += LIBUSB1
128 LIBS += -lusb-1.0
131 unix:static {
132 # force statically linking of libusb. Libraries that are appended
133 # later will get linked dynamically again.
134 LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
137 macx {
138 QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
139 QMAKE_LFLAGS_PPC=-mmacosx-version-min=10.4 -arch ppc
140 QMAKE_LFLAGS_X86=-mmacosx-version-min=10.4 -arch i386
141 CONFIG+=x86 ppc
142 LIBS += -L/usr/local/lib -lz \
143 -framework IOKit -framework CoreFoundation -framework Carbon \
144 -framework SystemConfiguration -framework CoreServices
145 INCLUDEPATH += /usr/local/include
147 # rule for creating a dmg file
148 dmg.commands = hdiutil create -ov -srcfolder rbutilqt.app/ rbutil.dmg
149 QMAKE_EXTRA_TARGETS += dmg
152 static {
153 QTPLUGIN += qtaccessiblewidgets
154 LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
155 LIBS += -L.
156 DEFINES += STATIC
157 message("using static plugin")
160 unix {
161 target.path = /usr/local/bin
162 INSTALLS += target
165 # source files are separate.
166 include(rbutilqt.pri)