Skip to content

Commit 880bf9e

Browse files
committed
Allow compiling with Mono
1 parent fd1458e commit 880bf9e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

server/JsDbg.Gdb/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,23 @@ BINDEPS=$(filter-out %extensions %JsDbg.py %JsDbg.Gdb, $(wildcard $(PUBLISH)/*))
1010

1111
PYTHON_FILES=JsDbg.py ../JsDbg.Stdio/JsDbg{Base,Types}.py
1212

13+
# Setting MONO=1 compiles the code with mono instead of dotnet. It does also
14+
# set up a runtimeconfig.json file to allow running the code with dotnet, which
15+
# JsDbgBase.py makes use of.
16+
# Requires packages:
17+
# apt install libmono-system-runtime-serialization4.0-cil libmono-system-web4.0-cil
18+
MONO=
19+
1320
all: bin/test_program
21+
ifdef MONO
22+
mkdir -p $(PUBLISH)
23+
mcs -r:System.Runtime.Serialization -r:System.Web ../JsDbg.Core/*.cs ../JsDbg.Stdio/*.cs -out:$(PUBLISH)/JsDbg.Stdio.dll
24+
cp -r ../../extensions $(PUBLISH)
25+
cp mono/* $(PUBLISH)
26+
else
1427
cd ../JsDbg.Stdio && $(DOTNET) restore $(RESTOREFLAGS)
1528
cd ../JsDbg.Stdio && $(DOTNET) publish -c Release --no-restore -o $(PUBLISH) $(PUBLISHFLAGS)
29+
endif
1630

1731
clean:
1832
rm -rf bin $(PUBLISH) $(PUBLISH_SC) ../JsDbg.{Core,Stdio,Stdio.Tests}/{bin,obj} jsdbg-gdb.tar.bz2 {.,../JsDbg.Stdio}/{*.pyc,__pycache__}
@@ -32,7 +46,9 @@ check: bin/test_program
3246
@# The restore flags set by debian/rules do not work with dotnet test.
3347
@# dotnet test does require us to download packages from the internet,
3448
@# so if $(RESTOREFLAGS) is set, just skip this test.
49+
ifndef MONO
3550
if test x"$(RESTOREFLAGS)" = x; then cd ../JsDbg.Stdio.Tests && $(DOTNET) restore $(RESTOREFLAGS) && $(DOTNET) test --no-restore; fi
51+
endif
3652
cd testsuite && runtest
3753
python2 ../JsDbg.Stdio/JsDbgBase_test.py
3854
python3 ../JsDbg.Stdio/JsDbgBase_test.py
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"runtimeOptions": {
3+
"tfm": "net5.0",
4+
"framework": {
5+
"name": "Microsoft.NETCore.App",
6+
"version": "5.0.0"
7+
},
8+
"configProperties": {
9+
"System.Globalization.Invariant": true
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)