Skip to content

Commit 4ee88f0

Browse files
authored
Use init-os-and-arch.sh in mono samples recipes (#78055)
1 parent 9fe3afe commit 4ee88f0

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

src/mono/sample/HelloWorld/Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
TOP=../../../../
2-
DOTNET:=$(TOP)./dotnet.sh
2+
DOTNET:=$(TOP)dotnet.sh
33
DOTNET_Q_ARGS=--nologo -v:q -consoleloggerparameters:NoSummary
44

5-
MONO_CONFIG ?=Debug
6-
MONO_ARCH=x64
5+
MONO_CONFIG?=Debug
6+
MONO_ARCH?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${arch})
7+
TARGET_OS?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${os} | tr "[:upper:]" "[:lower:]")
78
AOT?=false
89

910
#NET_TRACE_PATH=<path-to-trace-of-sample>
1011
#PGO_BINARY_PATH=<path-to-dotnet-pgo-executable>
1112
#MIBC_PROFILE_PATH=<path-to-mibc-for-sample>
1213

13-
OS := $(shell uname -s)
14-
ifeq ($(OS),Darwin)
15-
TARGET_OS=osx
16-
else
17-
TARGET_OS=linux
18-
endif
19-
2014
MONO_ENV_OPTIONS ?=
2115

2216
publish:

src/mono/sample/mbr/apple/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
CONFIG=Debug
2-
MONO_ARCH=x64
3-
DOTNET := ../../../../../dotnet.sh
1+
TOP=../../../../../
2+
CONFIG?=Debug
3+
MONO_ARCH?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${arch})
4+
DOTNET:=$(TOP)dotnet.sh
45

56
run-sim:
67
$(DOTNET) publish -c $(CONFIG) /p:TargetOS=iOSSimulator /p:TargetArchitecture=$(MONO_ARCH) \

src/mono/sample/mbr/console/Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
TOP=../../../../../
2-
DOTNET:=$(TOP)./dotnet.sh
2+
DOTNET:=$(TOP)dotnet.sh
33
DOTNET_Q_ARGS=--nologo -v:q -consoleloggerparameters:NoSummary
44

55
# How to build the project. For hot reload this must be Debug
66
CONFIG ?=Debug
77
# How was dotnet/runtime built? should be the same as build.sh -c option
88
BUILT_RUNTIME_CONFIG ?= Release
9-
MONO_ARCH=x64
10-
11-
OS := $(shell uname -s)
12-
ifeq ($(OS),Darwin)
13-
TARGET_OS=osx
14-
else
15-
TARGET_OS=linux
16-
endif
9+
MONO_ARCH?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${arch})
10+
TARGET_OS?=$(shell . $(TOP)eng/native/init-os-and-arch.sh && echo $${os} | tr "[:upper:]" "[:lower:]")
1711

1812
MONO_ENV_OPTIONS = --interp
1913

0 commit comments

Comments
 (0)