-
Notifications
You must be signed in to change notification settings - Fork 0
/
QtSpim.pro
341 lines (293 loc) · 12 KB
/
QtSpim.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# SPIM S20 MIPS simulator.
# Qt interface for SPIM simulator.
#
# Copyright (c) 1990-2016, James R. Larus.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# Neither the name of the James R. Larus nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#-------------------------------------------------
#
# Project created by QtCreator 2010-07-11T10:46:07
#
#-------------------------------------------------
QT += core widgets gui printsupport
MY_TARGET = wasm
TEMPLATE = app
OBJECTS_DIR = ./objs
MOC_DIR = ./moc
YACCSOURCES = spim/CPU/parser.y
LEXSOURCES = spim/CPU/scanner.l
#CONFIG += yacc_no_name_mangle
CONFIG += c++1z
CONFIG -= release debug
QT += widgets gui
defined(TSAN, "var"):!equals(TSAN, 0) { # TSAN Settings
message("Building thread sanitizer Makefile")
CONFIG += debug sanitizer sanitize_thread
TARGET = $${MY_TARGET}-tsan
DEFINES += DEBUG
} else:defined(DEBUG, "var"):!equals(DEBUG, 0) { # Debug settings
message("Building debug Makefile")
CONFIG += debug
TARGET = $${MY_TARGET}-debug
DEFINES += DEBUG
} else { # Release settings
message("Building release Makefile")
CONFIG += release
TARGET = $${MY_TARGET}
}
contains(QMAKE_CXX, em++) {
QMAKE_LFLAGS += --emrun -s FORCE_FILESYSTEM=1\
-lm -O2 --bind\
--preload-file spim/CPU/exceptions.s@/usr/share/spim/exceptions.s\
-s ENVIRONMENT=web \
-s EXTRA_EXPORTED_RUNTIME_METHODS="\"\\\"['ccall', 'cwrap']\\\"\""
QMAKE_CXXFLAGS += -pedantic -Wunused -Wno-write-strings -x c++
MEM_SIZES = TEXT_SIZE=65536 DATA_SIZE=131072 K_TEXT_SIZE=65536
DEFINES += WASM $${MEM_SIZES} DEFAULT_EXCEPTION_HANDLER="\"\\\"/usr/share/spim/exceptions.s\\\"\""
QMAKE_POST_LINK += sed -i \'\' \'s/throw\"getitimer() is not implemented yet\"//g\' $${TARGET}.js; \
sed -i \'\' \'s/throw\"setitimer() is not implemented yet\"//g\' $${TARGET}.js; \
mv $${TARGET}.js wasm.js; \
rm -f $${TARGET}.html qtlogo.svg qtloader.js
QMAKE_CLEAN += $${MY_TARGET}.wasm $${MY_TARGET}.js $${MY_TARGET}.data $${MY_TARGET}-debug.wasm $${MY_TARGET}-debug.data
} else {
QMAKE_CLEAN += $${MY_TARGET} $${MY_TARGET}-debug $${MY_TARGET}-tsan
DEFINES += DEFAULT_EXCEPTION_HANDLER="\"\\\"spim/CPU/exceptions.s\\\"\""
SOURCES += main.cpp
HEADERS += spim/spim.h
}
SOURCES += spim/spim.cpp\
spim/CPU/data.cpp\
spim/CPU/display-utils.cpp\
spim/CPU/image.cpp\
spim/CPU/inst.cpp\
spim/CPU/mem.cpp\
spim/CPU/run.cpp\
spim/CPU/spim-utils.cpp\
spim/CPU/string-stream.cpp\
spim/CPU/sym-tbl.cpp\
spim/CPU/syscall.cpp\
# spim/CPU/vasm.cpp\
# ../Spimbot/spimbotview.cpp\
# ../Spimbot/spimbotwidget.cpp\
# ../Spimbot/robot.cpp\
# ../Spimbot/scenario.cpp\
# ../Spimbot/puzzles/fillfill.cpp\
# ../Spimbot/images/images.cpp\
# ../Spimbot/images/animation.cpp\
# ../Spimbot/inversus/*.cpp\
# ../Spimbot/inversus/*.hpp\
# HEADERS += spimview.h\
# regtextedit.h\
# texttextedit.h\
# datatextedit.h\
# spim_settings.h\
# settablecheckbox.h\
# console.h\
# ../Spimbot/spimbotview.h\
# ../Spimbot/spimbotwidget.h\
# ../Spimbot/ui_spimbotview.h\
# ../Spimbot/ui_spimbotwidget.h\
# ../Spimbot/ui_spimview.h\
# ../Spimbot/robot.h\
# ../Spimbot/scenario.h\
# ../Spimbot/puzzles/puzzle.h\
# ../Spimbot/puzzles/fillfill.h\
# ../Spimbot/images/images.h\
# ../Spimbot/images/animation.h\
# ../Spimbot/inversus/*.h\
# ../Spimbot/utils/vec2d.h\
# FORMS += spimview.ui\
# savelogfile.ui\
# printwindows.ui\
# runparams.ui\
# settings.ui\
# changevalue.ui \
# breakpoint.ui \
# ../Spimbot/spimbotview.ui \
# ../Spimbot/spimbotwidget.ui
INCLUDEPATH += spim/CPU $ENV{EMSCRIPTEN}/system/include/ # ../spim ../QtSpim
INCLUDEPATH += "/usr/local/Cellar/boost/1.79.0_2/include/"
INCLUDEPATH += "/opt/homebrew/Cellar/boost/1.79.0_2/include/"
# RESOURCES = windows_images.qrc exception.qrc ../Spimbot/images/spimbot_images.qrc
# win32:RC_FILE = qtspim.rc
QMAKE_YACC = bison
QMAKE_YACCFLAGS = -d --defines=parser.tab.h --output=parser.tab.cpp
QMAKE_YACCFLAGS_MANGLE = -p yy
QMAKE_YACC_HEADER = parser.tab.h
QMAKE_YACC_SOURCE = parser.tab.cpp
QMAKE_LEX = flex
QMAKE_LEXFLAGS_MANGLE = -Pyy
QMAKE_LEXFLAGS = -I -8 --outfile=lex.scanner.c
# Help file
#
#HELP_PROJ = help/qtspim.qhp
#buildcompressedhelp.name = Build compressed help
#buildcompressedhelp.input = HELP_PROJ
#buildcompressedhelp.output = help/${QMAKE_FILE_BASE}.qch
#buildcompressedhelp.commands= qhelpgenerator ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
#buildcompressedhelp.CONFIG = no_link recursive
# qcollectiongenerator must be run in the directory containing the project file, otherwise it
# puts partial paths in the .qhc file, which make it impossible to install the help files in
# other directories.
#
#HELP_COL_PROJ = help/qtspim.qhcp
#buildhelpcollection.name = Build help collection
#buildhelpcollection.input = HELP_COL_PROJ
#buildhelpcollection.output = help/${QMAKE_FILE_BASE}.qhc
#linux|macx:buildhelpcollection.commands= bash -c '\"pushd ${QMAKE_FILE_PATH}; qcollectiongenerator ${QMAKE_FILE_BASE}.qhcp; popd; $(MOVE) ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qhc ${QMAKE_FILE_OUT};\"'
#win32:buildhelpcollection.commands= cmd -c '\"pushd ${QMAKE_FILE_PATH} & qcollectiongenerator ${QMAKE_FILE_BASE}.qhcp & popd & $(MOVE) ${QMAKE_FILE_PATH}\\${QMAKE_FILE_BASE}.qhc ${QMAKE_FILE_OUT}\"'
#buildhelpcollection.CONFIG = no_link recursive
#QMAKE_EXTRA_COMPILERS += buildcompressedhelp buildhelpcollection
#POST_TARGETDEPS += help/qtspim.qch help/qtspim.qhc
# Microsoft Visual C compiler flags
#
win32-msvc2008 {
# Compile all files as C++
#
QMAKE_CFLAGS_DEBUG += -TP
QMAKE_CFLAGS_RELEASE += -TP
# Disable security warnings
#
DEFINES += _CRT_SECURE_NO_WARNINGS
}
win32-msvc2010 {
# Compile all files as C++
#
QMAKE_CFLAGS_DEBUG += -TP
QMAKE_CFLAGS_RELEASE += -TP
# Disable security warnings
#
DEFINES += _CRT_SECURE_NO_WARNINGS
}
win32-msvc2012 {
# Compile all files as C++
#
QMAKE_CFLAGS_DEBUG += -TP
QMAKE_CFLAGS_RELEASE += -TP
# Disable security warnings
#
DEFINES += _CRT_SECURE_NO_WARNINGS
}
# gcc flags
#
win32-g++ {
# Compile all files as C++
# Suppress gcc warning about deprecated conversion from string constant to char*
#
QMAKE_CFLAGS_DEBUG += -Wno-write-strings
QMAKE_CFLAGS_RELEASE += -Wno-write-strings
QMAKE_CXXFLAGS_DEBUG += -Wno-write-strings
QMAKE_CXXFLAGS_RELEASE += -Wno-write-strings
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
QMAKE_MOVE = mv
}
linux-g++-32 {
# Compile all files as C++
# Suppress gcc warning about deprecated conversion from string constant to char*
#
QMAKE_CFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CXXFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wall -Wextra
# Libraries will be installed in standard location
QMAKE_RPATHDIR = /usr/lib/qtspim/lib
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
}
linux-g++ {
QMAKE_CFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wall -Wextra
QMAKE_CXXFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -std=c++17 -Wall -Wextra
# Libraries will be installed in standard location
QMAKE_RPATHDIR = /usr/lib/qtspim/lib
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
}
# m1
macx:contains(QMAKE_HOST.arch, arm64):{
QMAKE_APPLE_DEVICE_ARCHS=arm64
# Suppress macOS warning when using recent SDK version
CONFIG+=sdk_no_version_check
message("mac m1")
# Compile all files as C++
# Suppress gcc warning about deprecated conversion from string constant to char*
#
QMAKE_CFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
QMAKE_INFO_PLIST = macinfo.plist
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14
ICON = NewIcon.icns
}
macx-g++:contains(QMAKE_HOST.arch, x86_64):{
QMAKE_APPLE_DEVICE_ARCHS=x86_64
# Suppress macOS warning when using recent SDK version
CONFIG+=sdk_no_version_check
message("mac g++")
# Compile all files as C++
# Suppress gcc warning about deprecated conversion from string constant to char*
#
QMAKE_CFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
QMAKE_INFO_PLIST = macinfo.plist
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14
ICON = NewIcon.icns
}
macx-clang:contains(QMAKE_HOST.arch, x86_64):{
QMAKE_APPLE_DEVICE_ARCHS=x86_64
# Suppress macOS warning when using recent SDK version
CONFIG+=sdk_no_version_check
message("mac clang")
# Compile all files as C++
# Suppress gcc warning about deprecated conversion from string constant to char*
#
QMAKE_CFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_DEBUG += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
QMAKE_CXXFLAGS_RELEASE += -Wno-type-limits -Wno-write-strings -Wno-register -Wno-deprecated-register -Wall -Wextra
# Suppress error when deleting non-existent file.
#
QMAKE_DEL_FILE = rm -f
QMAKE_INFO_PLIST = macinfo.plist
QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14
ICON = NewIcon.icns
}