1 TOP
=$(realpath
$(CURDIR
)/..
/..
)
2 -include $(TOP
)/sdks
/Make.config
4 MAKEFLAGS
+= --no-builtin-rules
8 RELEASE
=$(if
$(filter $(CONFIGURATION
),release
),1)
10 lowercase
=$(shell echo
"$(1)" | tr
'[:upper:]' '[:lower:]')
14 ifneq (,$(findstring CYGWIN
,$(UNAME
)))
19 UNAME_WSL_CHECK
=$(shell uname
-a
)
20 ifneq (,$(findstring Microsoft
,$(UNAME_WSL_CHECK
)))
25 ifneq ($(UNAME
),Darwin
)
26 ifneq ($(UNAME
),Linux
)
27 ifneq ($(UNAME
),Windows
)
28 $(error
"Unsupported UNAME=$(UNAME)")
33 ifeq ($(UNAME
),Windows
)
35 HOST_ARCH_MINGW32
=$(shell uname
-m
)
38 ifneq ($(UNAME
),Darwin
)
39 # iOS and Mac requires Xcode to be available, and Xcode is only available on macOS
44 # On Windows, we will just trigger LLVM and Android builds using this Makefile.
45 ifeq ($(UNAME
),Windows
)
53 IGNORE_PROVISION_MXE
=1
56 CCACHE
:=$(if
$(DISABLE_CCACHE
),,$(shell which ccache
))
57 NINJA
:=$(shell which ninja
)
59 include $(TOP
)/sdks
/versions.mk
60 include $(TOP
)/sdks
/paths.mk
62 ifndef DISABLE_LIBTOOLIZE
63 #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
64 #this is due mono not being compatible with xcode's libtool, which is what's on path by default
65 ifeq (, $(shell which glibtoolize
))
66 EXTRA_PATH
=$(wildcard /usr
/local
/Cellar
/libtool
/*/bin
/)
73 ## Common Mono targets
75 .PHONY
: configure-mono
76 configure-mono
: $(TOP
)/configure
79 ifeq ($(UNAME
),Darwin
)
81 @if
[ $$(ulimit
-n
) -lt
1024 ] ; then \
82 echo
"Error: Increase ulimit -n to at least 1024"; \
91 $(TOP
)/configure
: $(TOP
)/configure.ac
$(TOP
)/autogen.sh .stamp-ulimit-check
92 cd
$(TOP
) && PATH
=$(EXTRA_PATH
):$$PATH NOCONFIGURE
=1 .
/autogen.sh
$(if
$(wildcard $(TOP
)/..
/mono-extensions
),--enable-extension-module
=xamarin
--enable-extension-module
)
114 # $(1): target (android, ios, mac, wasm)
115 # $(2): compression format (7z, zip)
116 define ArchiveTemplate
117 _
$(1)_HASH
= $$(shell git
-C
$$(TOP
) rev-parse HEAD
)
118 _
$(1)_PACKAGE
= $(1)-$$(CONFIGURATION
)-$$(UNAME
)-$$(_
$(1)_HASH
).
$(2)
121 _
$(1)_COMPRESSION_ARGS
= -t7z
-mx
=9
126 cd
$$(TOP
)/sdks
/out
&& 7z a
$$(_
$(1)_COMPRESSION_ARGS
) $$(TOP
)/$$(_
$(1)_PACKAGE
) $$(sort $$($(1)_ARCHIVE
))
130 $(eval
$(call ArchiveTemplate
,android
,7z
))
134 $(eval
$(call ArchiveTemplate
,ios
,7z
))
138 $(eval
$(call ArchiveTemplate
,mac
,7z
))
142 $(eval
$(call ArchiveTemplate
,wasm
,zip
))
147 .PHONY
: build-custom-
%
151 .PHONY
: setup-custom-
%
153 mkdir
-p
$(TOP
)/sdks
/out
/$*
159 define TargetTemplate
161 .PHONY
: toolchain-
$(1)-$(2)
162 toolchain-
$(1)-$(2): .stamp-
$(1)-$(2)-toolchain
165 toolchain
: toolchain-
$(1)-$(2)
167 .stamp-
$(1)-$(2)-configure
: .stamp-
$(1)-$(2)-toolchain
169 .PHONY
: configure-
$(1)-$(2)
170 configure-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
173 configure
: configure-
$(1)-$(2)
175 .PHONY
: build-
$(1)-$(2)
176 build-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
177 $$(MAKE
) build-custom-
$(1)-$(2)
180 build
: build-
$(1)-$(2)
182 .PHONY
: setup-
$(1)-$(2)
184 $$(MAKE
) setup-custom-
$(1)-$(2)
186 .PHONY
: package-
$(1)-$(2)
187 package-
$(1)-$(2): setup-
$(1)-$(2) build-
$(1)-$(2)
189 .PHONY
: clean-
$(1)-$(2)
193 clean: clean-
$(1)-$(2)
203 ifeq ($(and
$(DISABLE_ANDROID
),$(DISABLE_WASM_CROSS
)),)
204 # FIXME add iOS support(?)
227 ## To run host-side tests