Add Makefile
authorEgorBo <egorbo@gmail.com>
Fri, 31 Jan 2020 12:34:04 +0000 (15:34 +0300)
committerEgorBo <egorbo@gmail.com>
Fri, 31 Jan 2020 12:34:04 +0000 (15:34 +0300)
src/mono/netcore/Makefile [new file with mode: 0644]

diff --git a/src/mono/netcore/Makefile b/src/mono/netcore/Makefile
new file mode 100644 (file)
index 0000000..358cc5a
--- /dev/null
@@ -0,0 +1,28 @@
+
+DOTNET=../../../.dotnet/dotnet
+TESTHOST_PATH=../../../artifacts/bin/testhost/
+
+TARGET_FRAMEWORK=
+CONFIGURATION=
+OS=
+PLATFORM=
+
+# let's check ../../../artifacts/bin/testhost/ for available configurations
+# it's expected to see there only a single config, e.g. "netcoreapp5.0-OSX-Release-x64"
+# otherwise you have to set these variables for desired config
+ifeq ($(words $(wildcard $(TESTHOST_PATH)/*)), 1)
+       TESTHOST_CFG := $(subst -, ,$(notdir $(wildcard $(TESTHOST_PATH)/*)))
+       CONFIGURATION := $(word 3,$(TESTHOST_CFG))
+       OS := $(word 2,$(TESTHOST_CFG))
+       TARGET_FRAMEWORK := $(word 1,$(TESTHOST_CFG))
+       PLATFORM := $(word 4,$(TESTHOST_CFG))
+endif
+
+check-config:
+       @if test -z "$(CONFIGURATION)"; then echo "CONFIGURATION is not set"; exit 1; fi
+
+run-sample: check-config
+       $(DOTNET) msbuild /t:RunSample /p:Configuration=$(CONFIGURATION) ../mono.proj
+
+runtime:
+       $(DOTNET) msbuild /t:Build ../mono.proj