rbutil: correct dependencies by setting DEPENDPATH.
[kugel-rb.git] / rbutil / rbutilqt / rbutilqt.pro
blob8f4f964401ff42cc5b560703c6fb813f907b2e9a
3 # ccache
4 unix:!mac {
5 CCACHE = $$system(which ccache)
6 !isEmpty(CCACHE) {
7 message("using ccache")
8 QMAKE_CXX = ccache g++
9 QMAKE_CC = ccache gcc
13 OBJECTS_DIR = $$OUT_PWD/build/o
14 UI_DIR = $$OUT_PWD/build/ui
15 MOC_DIR = $$OUT_PWD/build/moc
16 RCC_DIR = $$OUT_PWD/build/rcc
18 # check version of Qt installation
19 VER = $$find(QT_VERSION, ^4\.[3-9]+.*)
20 isEmpty(VER) {
21 !isEmpty(QT_VERSION) error("Qt found:" $$[QT_VERSION])
22 error("Qt >= 4.3 required!")
24 message("Qt version used:" $$VER)
26 RBBASE_DIR = $$_PRO_FILE_PWD_
27 RBBASE_DIR = $$replace(RBBASE_DIR,/rbutil/rbutilqt,)
29 message("Rockbox Base dir: "$$RBBASE_DIR)
31 # add a custom rule for pre-building librbspeex
32 !mac {
33 rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex.a
35 mac {
36 rbspeex.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/rbspeex librbspeex-universal
38 QMAKE_EXTRA_TARGETS += rbspeex
39 PRE_TARGETDEPS += rbspeex
41 # rule for creating ctags file
42 tags.commands = ctags -R --c++-kinds=+p --fields=+iaS --extra=+q $(SOURCES)
43 tags.depends = $(SOURCES)
44 QMAKE_EXTRA_TARGETS += tags
46 # add a custom rule for making the translations
47 lrelease.commands = $$[QT_INSTALL_BINS]/lrelease -silent $$_PRO_FILE_
48 QMAKE_EXTRA_TARGETS += lrelease
49 !dbg {
50 PRE_TARGETDEPS += lrelease
53 #custom rules for libucl.a
54 !mac {
55 libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl.a
57 mac {
58 libucl.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/tools/ucl/src libucl-universal
60 QMAKE_EXTRA_TARGETS += libucl
61 PRE_TARGETDEPS += libucl
63 #custom rules for libmkamsboot.a
64 !mac {
65 libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot.a
67 mac {
68 libmkamsboot.commands = @$(MAKE) TARGET_DIR=$$OUT_PWD/ -C $$RBBASE_DIR/rbutil/mkamsboot libmkamsboot-universal
70 QMAKE_EXTRA_TARGETS += libmkamsboot
71 PRE_TARGETDEPS += libmkamsboot
73 SOURCES += rbutilqt.cpp \
74 main.cpp \
75 install.cpp \
76 base/httpget.cpp \
77 configure.cpp \
78 zip/zip.cpp \
79 zip/unzip.cpp \
80 base/zipinstaller.cpp \
81 progressloggergui.cpp \
82 installtalkwindow.cpp \
83 base/talkfile.cpp \
84 base/talkgenerator.cpp \
85 base/autodetection.cpp \
86 ../ipodpatcher/ipodpatcher.c \
87 ../sansapatcher/sansapatcher.c \
88 ../chinachippatcher/chinachip.c \
89 browsedirtree.cpp \
90 themesinstallwindow.cpp \
91 base/uninstall.cpp \
92 uninstallwindow.cpp \
93 base/utils.cpp \
94 preview.cpp \
95 base/encoders.cpp \
96 encttscfggui.cpp \
97 base/encttssettings.cpp \
98 base/tts.cpp \
99 ../../tools/wavtrim.c \
100 ../../tools/voicefont.c \
101 base/voicefile.cpp \
102 createvoicewindow.cpp \
103 base/rbsettings.cpp \
104 base/rbunzip.cpp \
105 base/rbzip.cpp \
106 base/system.cpp \
107 sysinfo.cpp \
108 systrace.cpp \
109 base/bootloaderinstallbase.cpp \
110 base/bootloaderinstallmi4.cpp \
111 base/bootloaderinstallhex.cpp \
112 base/bootloaderinstallipod.cpp \
113 base/bootloaderinstallsansa.cpp \
114 base/bootloaderinstallfile.cpp \
115 base/bootloaderinstallchinachip.cpp \
116 base/bootloaderinstallams.cpp \
117 ../../tools/mkboot.c \
118 ../../tools/iriver.c
120 HEADERS += rbutilqt.h \
121 install.h \
122 base/httpget.h \
123 configure.h \
124 zip/zip.h \
125 zip/unzip.h \
126 zip/zipentry_p.h \
127 zip/unzip_p.h \
128 zip/zip_p.h \
129 version.h \
130 base/zipinstaller.h \
131 installtalkwindow.h \
132 base/talkfile.h \
133 base/talkgenerator.h \
134 base/autodetection.h \
135 base/progressloggerinterface.h \
136 progressloggergui.h \
137 ../ipodpatcher/ipodpatcher.h \
138 ../ipodpatcher/ipodio.h \
139 ../ipodpatcher/parttypes.h \
140 ../sansapatcher/sansapatcher.h \
141 ../sansapatcher/sansaio.h \
142 ../chinachippatcher/chinachip.h \
143 irivertools/h100sums.h \
144 irivertools/h120sums.h \
145 irivertools/h300sums.h \
146 browsedirtree.h \
147 themesinstallwindow.h \
148 base/uninstall.h \
149 uninstallwindow.h \
150 base/utils.h \
151 preview.h \
152 base/encoders.h \
153 encttscfggui.h \
154 base/encttssettings.h \
155 base/tts.h \
156 ../../tools/wavtrim.h \
157 ../../tools/voicefont.h \
158 base/voicefile.h \
159 createvoicewindow.h \
160 base/rbsettings.h \
161 base/rbunzip.h \
162 base/rbzip.h \
163 sysinfo.h \
164 base/system.h \
165 systrace.h \
166 base/bootloaderinstallbase.h \
167 base/bootloaderinstallmi4.h \
168 base/bootloaderinstallhex.h \
169 base/bootloaderinstallipod.h \
170 base/bootloaderinstallsansa.h \
171 base/bootloaderinstallfile.h \
172 base/bootloaderinstallchinachip.h \
173 base/bootloaderinstallams.h \
174 ../../tools/mkboot.h \
175 ../../tools/iriver.h
177 # Needed by QT on Win
178 INCLUDEPATH = $$_PRO_FILE_PWD_ $$_PRO_FILE_PWD_/irivertools $$_PRO_FILE_PWD_/zip $$_PRO_FILE_PWD_/zlib $$_PRO_FILE_PWD_/base
179 INCLUDEPATH += $$RBBASE_DIR/rbutil/ipodpatcher $$RBBASE_DIR/rbutil/sansapatcher $$RBBASE_DIR/tools/rbspeex $$RBBASE_DIR/tools
181 DEPENDPATH = $$INCLUDEPATH
183 LIBS += -L$$OUT_PWD -lrbspeex -lmkamsboot -lucl
185 TEMPLATE = app
186 dbg {
187 CONFIG += debug thread qt warn_on
188 DEFINES -= QT_NO_DEBUG_OUTPUT
189 message("debug")
191 !dbg {
192 CONFIG += release thread qt
193 DEFINES -= QT_NO_DEBUG_OUTPUT
194 DEFINES += NODEBUG
195 message("release")
198 TARGET = rbutilqt
200 FORMS += rbutilqtfrm.ui \
201 aboutbox.ui \
202 installfrm.ui \
203 progressloggerfrm.ui \
204 configurefrm.ui \
205 browsedirtreefrm.ui \
206 installtalkfrm.ui \
207 themesinstallfrm.ui \
208 uninstallfrm.ui \
209 previewfrm.ui \
210 createvoicefrm.ui \
211 sysinfofrm.ui \
212 systracefrm.ui
214 RESOURCES += $$_PRO_FILE_PWD_/rbutilqt.qrc
215 win32 {
216 RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-win.qrc
218 !dbg {
219 RESOURCES += $$_PRO_FILE_PWD_/rbutilqt-lang.qrc
222 TRANSLATIONS += lang/rbutil_de.ts \
223 lang/rbutil_fi.ts \
224 lang/rbutil_fr.ts \
225 lang/rbutil_gr.ts \
226 lang/rbutil_he.ts \
227 lang/rbutil_ja.ts \
228 lang/rbutil_nl.ts \
229 lang/rbutil_pt.ts \
230 lang/rbutil_pt_BR.ts \
231 lang/rbutil_tr.ts \
232 lang/rbutil_zh_CN.ts \
233 lang/rbutil_zh_TW.ts \
236 QT += network
237 DEFINES += RBUTIL _LARGEFILE64_SOURCE
239 win32 {
240 SOURCES += ../ipodpatcher/ipodio-win32.c
241 SOURCES += ../ipodpatcher/ipodio-win32-scsi.c
242 SOURCES += ../sansapatcher/sansaio-win32.c
243 RC_FILE = rbutilqt.rc
244 LIBS += -lsetupapi -lnetapi32
247 unix {
248 SOURCES += ../ipodpatcher/ipodio-posix.c
249 SOURCES += ../sansapatcher/sansaio-posix.c
251 unix:!static:!libusb1 {
252 LIBS += -lusb
254 unix:!static:libusb1 {
255 DEFINES += LIBUSB1
256 LIBS += -lusb-1.0
259 unix:static {
260 # force statically linking of libusb. Libraries that are appended
261 # later will get linked dynamically again.
262 LIBS += -Wl,-Bstatic -lusb -Wl,-Bdynamic
265 macx {
266 QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.4u.sdk
267 QMAKE_LFLAGS_PPC=-mmacosx-version-min=10.4 -arch ppc
268 QMAKE_LFLAGS_X86=-mmacosx-version-min=10.4 -arch i386
269 CONFIG+=x86 ppc
270 LIBS += -L/usr/local/lib -framework IOKit
271 INCLUDEPATH += /usr/local/include
272 QMAKE_INFO_PLIST = Info.plist
273 RC_FILE = icons/rbutilqt.icns
275 # rule for creating a dmg file
276 dmg.commands = hdiutil create -ov -srcfolder rbutilqt.app/ rbutil.dmg
277 QMAKE_EXTRA_TARGETS += dmg
280 static {
281 QTPLUGIN += qtaccessiblewidgets
282 LIBS += -L$$(QT_BUILD_TREE)/plugins/accessible -lqtaccessiblewidgets
283 LIBS += -L.
284 DEFINES += STATIC
285 message("using static plugin")
288 unix {
289 target.path = /usr/local/bin
290 INSTALLS += target