1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
TOP=$(realpath $(CURDIR)/../..)
CONFIGURATION?=release
RELEASE=$(if $(filter $(CONFIGURATION),release),1)
CCACHE:=$(shell which ccache)
ifneq ($(shell uname),"Darwin")
# iOS requires Xcode to be available, and Xcode is only available on macOS
DISABLE_IOS=1
endif
include $(TOP)/sdks/versions.mk
include $(TOP)/sdks/paths.mk
#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
#this is due mono not being compatible with xcode's libtool, which is what's on path by default
ifeq (, $(shell which glibtoolize))
EXTRA_PATH=$(wildcard /usr/local/Cellar/libtool/*/bin/)
endif
all: package
## Common Mono targets
.PHONY: configure-mono
configure-mono: $(TOP)/configure
$(TOP)/configure: $(TOP)/configure.ac $(TOP)/autogen.sh
cd $(TOP) && PATH=$(EXTRA_PATH):$$PATH NOCONFIGURE=1 ./autogen.sh
$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe: $(wildcard $(TOP)/tools/offsets-tool/*.cs)
$(MAKE) -C $(dir $@) MonoAotOffsetsDumper.exe
TARGETS=
## MXE targets
ifndef DISABLE_ANDROID
# FIXME add iOS support(?)
include mxe.mk
endif
## LLVM targets
ifeq ($(and $(DISABLE_ANDROID),$(DISABLE_IOS)),)
include llvm.mk
endif
## BCL targets
ifndef DISABLE_BCL
include bcl.mk
endif
## Android targets
ifndef DISABLE_ANDROID
include android.mk
endif
## iOS targets
ifndef DISABLE_IOS
include ios.mk
endif
## WASM targets
ifndef DISABLE_WASM
include wasm.mk
endif
## Generic targets
.PHONY: $(foreach target,$(TARGETS),toolchain-$(target))
$(foreach target,$(TARGETS),toolchain-$(target)): toolchain-%: .stamp-%-toolchain
$(foreach target,$(TARGETS),.stamp-$(target)-configure): .stamp-%-configure: .stamp-%-toolchain
.PHONY: $(foreach target,$(TARGETS),configure-$(target))
$(foreach target,$(TARGETS),configure-$(target)): configure-%: .stamp-%-configure
.PHONY: build-custom-%
build-custom-%:
$(MAKE) -C $*
.PHONY: $(foreach target,$(TARGETS),build-$(target))
$(foreach target,$(TARGETS),build-$(target)): build-%: .stamp-%-configure
$(MAKE) build-custom-$*
.PHONY: setup-custom-%
setup-custom-%:
mkdir -p $(TOP)/sdks/out/$*
.PHONY: $(foreach target,$(TARGETS),setup-$(target))
$(foreach target,$(TARGETS),setup-$(target)): setup-%:
$(MAKE) setup-custom-$*
.PHONY: $(foreach target,$(TARGETS),package-$(target))
$(foreach target,$(TARGETS),package-$(target)): package-%: setup-% build-%
.PHONY: $(foreach target,$(TARGETS),clean-$(target))
$(foreach target,$(TARGETS),clean-$(target)): clean-%:
## Global targets
.PHONY: toolchain
toolchain: $(foreach target,$(TARGETS),toolchain-$(target))
.PHONY: configure
configure: $(foreach target,$(TARGETS),configure-$(target))
.PHONY: build
build: $(foreach target,$(TARGETS),build-$(target))
.PHONY: package
package: $(foreach target,$(TARGETS),package-$(target))
.PHONY: clean
clean: $(foreach target,$(TARGETS),clean-$(target))
all: package
|