forked from nspire-emus/firebird
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebird.pro
203 lines (174 loc) · 4.74 KB
/
firebird.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
lessThan(QT_MAJOR_VERSION, 5) : error("You need at least Qt 5 to build firebird!")
# JIT
TRANSLATION_ENABLED = false
# Localization
TRANSLATIONS += i18n/de_DE.ts i18n/fr_FR.ts
QT += core gui widgets quickwidgets
CONFIG += c++11
TEMPLATE = app
TARGET = firebird
# For make install support
target.path = /usr/bin
desktop.path = /usr/share/applications
desktop.files += resources/firebird.desktop
icon.path = /usr/share/icons
icon.files += resources/firebird.png
sendtool.path = /usr/bin
sendtool.files = core/firebird-send
INSTALLS += target desktop icon sendtool
QMAKE_CFLAGS = -g -std=gnu11 -Wall -Wextra
QMAKE_CXXFLAGS = -g -std=c++11 -Wall -Wextra
# Override bad default options to enable better optimizations
QMAKE_CFLAGS_RELEASE = -O3 -flto
QMAKE_CXXFLAGS_RELEASE = -O3 -flto
QMAKE_LFLAGS_RELEASE = -Wl,-O3 -flto
# ICE on mac with clang
macx-clang|ios {
QMAKE_CFLAGS_RELEASE -= -flto
QMAKE_CXXFLAGS_RELEASE -= -flto
QMAKE_LFLAGS_RELEASE -= -Wl,-O3 -flto
}
macx {
ICON = resources/logo.icns
}
# This does also apply to android
linux|macx|ios {
SOURCES += core/os/os-linux.c
}
ios|android {
DEFINES += MOBILE_UI
}
ios {
DEFINES += IS_IOS_BUILD __arm__
QMAKE_INFO_PLIST = Info.plist
QMAKE_CFLAGS += -mno-thumb
QMAKE_CXXFLAGS += -mno-thumb
QMAKE_LFLAGS += -mno-thumb
QMAKE_IOS_DEVICE_ARCHS = armv7
}
# QMAKE_HOST can be e.g. armv7hl, but QT_ARCH would be arm in such cases
QMAKE_TARGET.arch = $$QT_ARCH
win32 {
SOURCES += core/os/os-win32.c
LIBS += -lwinmm -lws2_32
# Somehow it's set to x86_64...
QMAKE_TARGET.arch = x86
}
linux-g++-32 {
QMAKE_CFLAGS += -m32
QMAKE_CXXFLAGS += -m32
QMAKE_TARGET.arch = x86
}
# A platform-independant implementation of lowlevel access as default
ASMCODE_IMPL = core/asmcode.c
equals(TRANSLATION_ENABLED, true) {
TRANSLATE = $$join(QMAKE_TARGET.arch, "", "core/translate_", ".c")
exists($$TRANSLATE) {
SOURCES += $$TRANSLATE
}
TRANSLATE2 = $$join(QMAKE_TARGET.arch, "", "core/translate_", ".cpp")
exists($$TRANSLATE2) {
SOURCES += $$TRANSLATE2
}
ASMCODE = $$join(QMAKE_TARGET.arch, "", "core/asmcode_", ".S")
exists($$ASMCODE): ASMCODE_IMPL = $$ASMCODE
}
else: DEFINES += NO_TRANSLATION
# The x86_64 and ARM JIT use asmcode.c for mem access
contains(QMAKE_TARGET.arch, "x86_64") || contains(QMAKE_TARGET.arch, "arm") {
!contains(ASMCODE_IMPL, "asmcode.c") {
SOURCES += core/asmcode.c
}
}
# Default to armv7 on ARM for movw/movt. If your CPU doesn't support it, comment this out.
contains(QMAKE_TARGET.arch, "arm") {
QMAKE_CFLAGS += -march=armv7-a -marm
QMAKE_CXXFLAGS += -march=armv7-a -marm
QMAKE_LFLAGS += -march=armv7-a -marm # We're using LTO, so the linker has to get the same flags
}
SOURCES += $$ASMCODE_IMPL \
lcdwidget.cpp \
mainwindow.cpp \
main.cpp \
flashdialog.cpp \
emuthread.cpp \
qmlbridge.cpp \
qtkeypadbridge.cpp \
core/arm_interpreter.cpp \
core/coproc.cpp \
core/cpu.cpp \
core/thumb_interpreter.cpp \
core/usblink_queue.cpp \
core/armsnippets_loader.c \
core/casplus.c \
core/des.c \
core/disasm.c \
core/emu.c \
core/flash.c \
core/gdbstub.c \
core/interrupt.c \
core/keypad.c \
core/lcd.c \
core/link.c \
core/mem.c \
core/misc.c \
core/mmu.c \
core/schedule.c \
core/serial.c \
core/sha256.c \
core/usb.c \
core/usblink.c \
qtframebuffer.cpp \
core/debug.cpp
FORMS += \
mainwindow.ui \
flashdialog.ui
HEADERS += \
emuthread.h \
lcdwidget.h \
flashdialog.h \
mainwindow.h \
keymap.h \
qmlbridge.h \
qtkeypadbridge.h \
core/os/os.h \
core/armcode_bin.h \
core/armsnippets.h \
core/asmcode.h \
core/bitfield.h \
core/casplus.h \
core/cpu.h \
core/cpudefs.h \
core/debug.h \
core/des.h \
core/disasm.h \
core/emu.h \
core/flash.h \
core/gdbstub.h \
core/interrupt.h \
core/keypad.h \
core/lcd.h \
core/link.h \
core/mem.h \
core/misc.h \
core/mmu.h \
core/schedule.h \
core/sha256.h \
core/translate.h \
core/usb.h \
core/usblink.h \
core/usblink_queue.h \
qtframebuffer.h
# Generate the binary arm code into armcode_bin.h
armsnippets.commands = arm-none-eabi-gcc -fno-leading-underscore -c $$PWD/core/armsnippets.S -o armsnippets.o -mcpu=arm926ej-s \
&& arm-none-eabi-objcopy -O binary armsnippets.o snippets.bin \
&& xxd -i snippets.bin > $$PWD/core/armcode_bin.h \
&& rm armsnippets.o
# In case you change armsnippets.S, run "make armsnippets" and update armcode_bin.h
QMAKE_EXTRA_TARGETS = armsnippets
OTHER_FILES += \
TODO
RESOURCES += \
resources.qrc
DISTFILES += \
core/firebird-send