Add "elfzip" target to make which creates a zip of all elf files, as mapzip does...
[maemo-rb.git] / rbutil / rbutilqt / rbutilqt.pro
blobca7214989c3325550e24087bd1395536f7fff09a
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 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
48 !mac {
49 RBLIBPOSTFIX = .a
51 mac {
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.
64 !static:unix:!mac {
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
107 !dbg {
108 PRE_TARGETDEPS += lrelease
111 # Needed by QT on Win
112 INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools \
113 $$_PRO_FILE_PWD_/zip $$_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 -lz
121 # Add a (possibly found) libspeex now, don't do this before -lrbspeex!
122 !static:!isEmpty(LIBSPEEX) {
123 LIBS += $$LIBSPEEX
126 TEMPLATE = app
127 TARGET = RockboxUtility
128 QT += network
129 dbg {
130 CONFIG += debug thread qt warn_on
131 DEFINES -= QT_NO_DEBUG_OUTPUT
132 message("debug")
134 !dbg {
135 CONFIG += release thread qt
136 DEFINES -= QT_NO_DEBUG_OUTPUT
137 DEFINES += NODEBUG
138 message("release")
141 DEFINES += RBUTIL _LARGEFILE64_SOURCE
143 # platform specific
144 win32 {
145 # use MinGW's implementation of stdio functions for extended format string
146 # support.
147 DEFINES += __USE_MINGW_ANSI_STDIO=1
148 LIBS += -lsetupapi -lnetapi32
150 win32:static {
151 QMAKE_LFLAGS += -static-libgcc -static-libstdc++
153 unix:!static:!libusb1:!macx {
154 LIBS += -lusb
156 unix:!static:libusb1:!macx {
157 DEFINES += LIBUSB1
158 LIBS += -lusb-1.0
161 unix:!macx:static {
162 # force statically linking of libusb. Libraries that are appended
163 # later will get linked dynamically again.
164 LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
167 # if -config intel is specified use 10.5 SDK and don't build for PPC
168 macx:!intel {
169 CONFIG += ppc
170 QMAKE_LFLAGS_PPC=-mmacosx-version-min=10.4 -arch ppc
171 QMAKE_LFLAGS_X86=-mmacosx-version-min=10.4 -arch i386
172 QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
174 macx:intel {
175 QMAKE_LFLAGS_X86=-mmacosx-version-min=10.5 -arch i386
176 QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.5.sdk
177 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
179 macx {
180 CONFIG += x86
181 LIBS += -L/usr/local/lib \
182 -framework IOKit -framework CoreFoundation -framework Carbon \
183 -framework SystemConfiguration -framework CoreServices
184 INCLUDEPATH += /usr/local/include
186 # rule for creating a dmg file
187 dmg.commands = hdiutil create -ov -srcfolder rbutilqt.app/ rbutil.dmg
188 QMAKE_EXTRA_TARGETS += dmg
191 static {
192 QTPLUGIN += qtaccessiblewidgets
193 LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
194 LIBS += -L.
195 DEFINES += STATIC
196 message("using static plugin")
199 unix {
200 target.path = /usr/local/bin
201 INSTALLS += target
204 # source files are separate.
205 include(rbutilqt.pri)