1 TOP
=$(realpath
$(CURDIR
)/..
/..
)
2 -include $(TOP
)/sdks
/Make.config
6 MAKEFLAGS
+= --no-builtin-rules
10 RELEASE
=$(if
$(filter $(CONFIGURATION
),release
),1)
12 lowercase
=$(shell echo
"$(1)" | tr
'[:upper:]' '[:lower:]')
16 ifneq (,$(findstring CYGWIN
,$(UNAME
)))
21 UNAME_WSL_CHECK
=$(shell uname
-a
)
22 ifneq (,$(findstring Microsoft
,$(UNAME_WSL_CHECK
)))
27 ifneq ($(UNAME
),Darwin
)
28 ifneq ($(UNAME
),Linux
)
29 ifneq ($(UNAME
),Windows
)
30 $(error
"Unsupported UNAME=$(UNAME)")
35 ifeq ($(UNAME
),Windows
)
37 HOST_ARCH_MINGW32
=$(shell uname
-m
)
40 ifneq ($(UNAME
),Darwin
)
41 # iOS and Mac requires Xcode to be available, and Xcode is only available on macOS
46 # On Windows, we will just trigger LLVM and Android builds using this Makefile.
47 ifeq ($(UNAME
),Windows
)
55 IGNORE_PROVISION_MXE
=1
58 CCACHE
:=$(if
$(DISABLE_CCACHE
),,$(shell which ccache
))
59 NINJA
:=$(shell which ninja
)
61 include $(TOP
)/sdks
/versions.mk
62 include $(TOP
)/sdks
/paths.mk
64 ifndef DISABLE_LIBTOOLIZE
65 #brew's libtool is not compatible with some of the deps needed (I.E. V8) so in those systems we need to explicit add to the path
66 #this is due mono not being compatible with xcode's libtool, which is what's on path by default
67 ifeq (, $(shell which glibtoolize
))
68 EXTRA_PATH
=$(wildcard /usr
/local
/Cellar
/libtool
/*/bin
/)
74 ## Common Mono targets
76 .PHONY
: configure-mono
77 configure-mono
: $(TOP
)/configure
79 $(TOP
)/configure
: $(TOP
)/configure.ac
$(TOP
)/autogen.sh
80 cd
$(TOP
) && PATH
=$(EXTRA_PATH
):$$PATH NOCONFIGURE
=1 .
/autogen.sh
$(if
$(wildcard $(TOP
)/..
/mono-extensions
),--enable-extension-module
=xamarin
--enable-extension-module
)
84 ifndef DISABLE_ANDROID
102 # $(1): target (android, ios, mac, wasm)
103 # $(2): compression format (7z, zip)
104 define ArchiveTemplate
105 _
$(1)_HASH
= $$(shell git
-C
$$(TOP
) rev-parse HEAD
)
106 _
$(1)_PACKAGE
= $(1)-$$(CONFIGURATION
)-$$(UNAME
)-$$(_
$(1)_HASH
).
$(2)
109 _
$(1)_COMPRESSION_ARGS
= -t7z
-mx
=9
114 cd
$$(TOP
)/sdks
/out
&& 7z a
$$(_
$(1)_COMPRESSION_ARGS
) $$(TOP
)/$$(_
$(1)_PACKAGE
) $$(sort $$($(1)_ARCHIVE
))
117 ifndef DISABLE_ANDROID
118 $(eval
$(call ArchiveTemplate
,android
,7z
))
122 $(eval
$(call ArchiveTemplate
,ios
,7z
))
126 $(eval
$(call ArchiveTemplate
,mac
,7z
))
130 $(eval
$(call ArchiveTemplate
,wasm
,zip
))
135 .PHONY
: build-custom-
%
139 .PHONY
: setup-custom-
%
141 mkdir
-p
$(TOP
)/sdks
/out
/$*
147 define TargetTemplate
149 .PHONY
: toolchain-
$(1)-$(2)
150 toolchain-
$(1)-$(2): .stamp-
$(1)-$(2)-toolchain
153 toolchain
: toolchain-
$(1)-$(2)
155 .stamp-
$(1)-$(2)-configure
: .stamp-
$(1)-$(2)-toolchain
157 .PHONY
: configure-
$(1)-$(2)
158 configure-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
161 configure
: configure-
$(1)-$(2)
163 .PHONY
: build-
$(1)-$(2)
164 build-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
165 $$(MAKE
) build-custom-
$(1)-$(2)
168 build
: build-
$(1)-$(2)
170 .PHONY
: setup-
$(1)-$(2)
172 $$(MAKE
) setup-custom-
$(1)-$(2)
174 .PHONY
: package-
$(1)-$(2)
175 package-
$(1)-$(2): setup-
$(1)-$(2) build-
$(1)-$(2)
178 package
: package-
$(1)-$(2)
180 .PHONY
: clean-
$(1)-$(2)
184 clean: clean-
$(1)-$(2)
194 ifeq ($(and
$(DISABLE_ANDROID
),$(DISABLE_WASM_CROSS
)),)
195 # FIXME add iOS support(?)
203 ifndef DISABLE_ANDROID
218 ## To run host-side tests
219 ifndef DISABLE_DESKTOP