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:]')
14 CCACHE
:=$(if
$(DISABLE_CCACHE
),,$(shell which ccache
))
15 NINJA
:=$(shell which ninja
)
19 ifneq ($(UNAME
),Darwin
)
20 ifneq ($(UNAME
),Linux
)
21 $(error
"Unsupported UNAME=$(UNAME)")
25 ifneq ($(UNAME
),Darwin
)
26 # iOS requires Xcode to be available, and Xcode is only available on macOS
30 include $(TOP
)/sdks
/versions.mk
31 include $(TOP
)/sdks
/paths.mk
33 #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
34 #this is due mono not being compatible with xcode's libtool, which is what's on path by default
35 ifeq (, $(shell which glibtoolize
))
36 EXTRA_PATH
=$(wildcard /usr
/local
/Cellar
/libtool
/*/bin
/)
41 ## Common Mono targets
43 .PHONY
: configure-mono
44 configure-mono
: $(TOP
)/configure
46 $(TOP
)/configure
: $(TOP
)/configure.ac
$(TOP
)/autogen.sh
47 cd
$(TOP
) && PATH
=$(EXTRA_PATH
):$$PATH NOCONFIGURE
=1 .
/autogen.sh
51 ifndef DISABLE_ANDROID
65 # $(1): target (android, ios, wasm)
66 define ArchiveTemplate
67 _
$(1)_HASH
= $$(shell git
-C
$$(TOP
) rev-parse HEAD
)
68 _
$(1)_PACKAGE
= $(1)-$$(CONFIGURATION
)-$$(UNAME
)-$$(_
$(1)_HASH
).zip
72 cd
$$(TOP
)/sdks
/out
&& 7z a
$$(TOP
)/$$(_
$(1)_PACKAGE
) $$(sort $$($(1)_ARCHIVE
))
75 ifndef DISABLE_ANDROID
76 $(eval
$(call ArchiveTemplate
,android
))
80 $(eval
$(call ArchiveTemplate
,ios
))
84 $(eval
$(call ArchiveTemplate
,wasm
))
89 .PHONY
: build-custom-
%
93 .PHONY
: setup-custom-
%
95 mkdir
-p
$(TOP
)/sdks
/out
/$*
101 define TargetTemplate
103 .PHONY
: toolchain-
$(1)-$(2)
104 toolchain-
$(1)-$(2): .stamp-
$(1)-$(2)-toolchain
107 toolchain
: toolchain-
$(1)-$(2)
109 .stamp-
$(1)-$(2)-configure
: .stamp-
$(1)-$(2)-toolchain
111 .PHONY
: configure-
$(1)-$(2)
112 configure-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
115 configure
: configure-
$(1)-$(2)
117 .PHONY
: build-
$(1)-$(2)
118 build-
$(1)-$(2): .stamp-
$(1)-$(2)-configure
119 $$(MAKE
) build-custom-
$(1)-$(2)
122 build
: build-
$(1)-$(2)
124 .PHONY
: setup-
$(1)-$(2)
126 $$(MAKE
) setup-custom-
$(1)-$(2)
128 .PHONY
: package-
$(1)-$(2)
129 package-
$(1)-$(2): setup-
$(1)-$(2) build-
$(1)-$(2)
132 package
: package-
$(1)-$(2)
134 .PHONY
: clean-
$(1)-$(2)
138 clean: clean-
$(1)-$(2)
148 ifeq ($(and
$(DISABLE_ANDROID
),$(DISABLE_WASM_CROSS
)),)
149 # FIXME add iOS support(?)
157 ifndef DISABLE_ANDROID
167 ## To run host-side tests
168 ifndef DISABLE_DESKTOP