26 # _$(1)-$(2)_CONFIGURE_FLAGS
28 define RuntimeTemplate
30 _runtime_
$(1)-$(2)_BITNESS
=$$(if
$$(or
$$(findstring i686
,$(3)),$$(findstring i386
,$(3))),-m32
,$$(if
$$(findstring x86_64
,$(3)),-m64
))
32 _runtime_
$(1)-$(2)_CFLAGS
=$(if
$(RELEASE
),-O2
-g
,-O0
-ggdb3
-fno-omit-frame-pointer
) $$(_
$(1)-$(2)_CFLAGS
) $$($(1)-$(2)_CFLAGS
) $$(_runtime_
$(1)-$(2)_BITNESS
)
33 _runtime_
$(1)-$(2)_CXXFLAGS
=$(if
$(RELEASE
),-O2
-g
,-O0
-ggdb3
-fno-omit-frame-pointer
) $$(_
$(1)-$(2)_CXXFLAGS
) $$($(1)-$(2)_CXXFLAGS
) $$(_runtime_
$(1)-$(2)_BITNESS
)
34 _runtime_
$(1)-$(2)_CPPFLAGS
=$(if
$(RELEASE
),-O2
-g
,-O0
-ggdb3
-fno-omit-frame-pointer
) $$(_
$(1)-$(2)_CPPFLAGS
) $$($(1)-$(2)_CPPFLAGS
) $$(_runtime_
$(1)-$(2)_BITNESS
)
35 _runtime_
$(1)-$(2)_CXXCPPFLAGS
=$(if
$(RELEASE
),-O2
-g
,-O0
-ggdb3
-fno-omit-frame-pointer
) $$(_
$(1)-$(2)_CXXCPPFLAGS
) $$($(1)-$(2)_CXXCPPFLAGS
) $$(_runtime_
$(1)-$(2)_BITNESS
)
36 _runtime_
$(1)-$(2)_LDFLAGS
=$$(_
$(1)-$(2)_LDFLAGS
) $$($(1)-$(2)_LDFLAGS
)
38 _runtime_
$(1)-$(2)_AC_VARS
=$$(_
$(1)-$(2)_AC_VARS
) $$($(1)-$(2)_AC_VARS
)
40 _runtime_
$(1)-$(2)_CONFIGURE_ENVIRONMENT
= \
41 $(if
$$(_
$(1)-$(2)_AR
),AR
="$$(_$(1)-$(2)_AR)") \
42 $(if
$$(_
$(1)-$(2)_AS
),AS
="$$(_$(1)-$(2)_AS)") \
43 $(if
$$(_
$(1)-$(2)_CC
),CC
="$$(_$(1)-$(2)_CC)") \
44 $(if
$$(_
$(1)-$(2)_CPP
),CPP
="$$(_$(1)-$(2)_CPP)") \
45 $(if
$$(_
$(1)-$(2)_CXX
),CXX
="$$(_$(1)-$(2)_CXX)") \
46 $(if
$$(_
$(1)-$(2)_CXXCPP
),CXXCPP
="$$(_$(1)-$(2)_CXXCPP)") \
47 $(if
$$(_
$(1)-$(2)_DLLTOOL
),DLLTOOL
="$$(_$(1)-$(2)_DLLTOOL)") \
48 $(if
$$(_
$(1)-$(2)_LD
),LD
="$$(_$(1)-$(2)_LD)") \
49 $(if
$$(_
$(1)-$(2)_OBJDUMP
),OBJDUMP
="$$(_$(1)-$(2)_OBJDUMP)") \
50 $(if
$$(_
$(1)-$(2)_RANLIB
),RANLIB
="$$(_$(1)-$(2)_RANLIB)") \
51 $(if
$$(_
$(1)-$(2)_CMAKE
),CMAKE
="$$(_$(1)-$(2)_CMAKE)") \
52 $(if
$$(_
$(1)-$(2)_STRIP
),STRIP
="$$(_$(1)-$(2)_STRIP)") \
53 CFLAGS
="$$(_runtime_$(1)-$(2)_CFLAGS)" \
54 CXXFLAGS
="$$(_runtime_$(1)-$(2)_CXXFLAGS)" \
55 CPPFLAGS
="$$(_runtime_$(1)-$(2)_CPPFLAGS)" \
56 CXXCPPFLAGS
="$$(_runtime_$(1)-$(2)_CXXCPPFLAGS)" \
57 LDFLAGS
="$$(_runtime_$(1)-$(2)_LDFLAGS)" \
58 $$(_
$(1)-$(2)_CONFIGURE_ENVIRONMENT
) \
59 $$($(1)-$(2)_CONFIGURE_ENVIRONMENT
)
61 _runtime_
$(1)-$(2)_CONFIGURE_FLAGS
= \
62 $$(if
$(3),--host
=$(3)) \
63 --cache-file
=$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
).config.cache \
64 --prefix=$$(TOP
)/sdks
/out
/$(1)-$(2)-$$(CONFIGURATION
) \
65 $$(if
$$(ENABLE_CXX
),--enable-cxx
) \
66 $$(_cross-runtime_
$(1)-$(2)_CONFIGURE_FLAGS
) \
67 $$(_
$(1)-$(2)_CONFIGURE_FLAGS
) \
68 $$($(1)-$(2)_CONFIGURE_FLAGS
)
70 .stamp-
$(1)-$(2)-$$(CONFIGURATION
)-configure
: $$(TOP
)/configure .stamp-
$(1)-$(2)-toolchain
71 mkdir
-p
$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
)
72 $(if
$$(_
$(1)-$(2)_PATH
),PATH
="$$$$PATH:$$(_$(1)-$(2)_PATH)") .
/wrap-configure.sh
$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
) $$(abspath
$$<) $$(_runtime_
$(1)-$(2)_AC_VARS
) $$(_runtime_
$(1)-$(2)_CONFIGURE_ENVIRONMENT
) $$(_runtime_
$(1)-$(2)_CONFIGURE_FLAGS
)
75 .stamp-
$(1)-$(2)-configure
: .stamp-
$(1)-$(2)-$$(CONFIGURATION
)-configure
78 .PHONY
: build-custom-
$(1)-$(2)
79 build-custom-
$(1)-$(2):
80 $$(MAKE
) -C
$(1)-$(2)-$$(CONFIGURATION
)
82 .PHONY
: setup-custom-
$(1)-$(2)
83 setup-custom-
$(1)-$(2):
84 mkdir
-p
$$(TOP
)/sdks
/out
/$(1)-$(2)-$$(CONFIGURATION
)
86 .PHONY
: package-
$(1)-$(2)
88 $$(MAKE
) -C
$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
)/mono
install
89 $$(MAKE
) -C
$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
)/support
install
91 .PHONY
: clean-
$(1)-$(2)
93 rm -rf .stamp-
$(1)-$(2)-toolchain .stamp-
$(1)-$(2)-$$(CONFIGURATION
)-configure
$$(TOP
)/sdks
/builds
/toolchains
/$(1)-$(2) $$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
) $$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
).config.cache
$$(TOP
)/sdks
/out
/$(1)-$(2)-$$(CONFIGURATION
)
95 $$(eval
$$(call TargetTemplate
,$(1),$(2)))
97 .PHONY
: configure-
$(1)
98 configure-
$(1): configure-
$(1)-$(2)
101 build-
$(1): build-
$(1)-$(2)
104 archive-
$(1): package-
$(1)-$(2)
106 $(1)_ARCHIVE
+= $(1)-$(2)-$$(CONFIGURATION
)
110 $(TOP
)/tools
/offsets-tool
/MonoAotOffsetsDumper.exe
: $(wildcard $(TOP
)/tools
/offsets-tool
/*.cs
)
111 $(MAKE
) -C
$(dir $@
) MonoAotOffsetsDumper.exe
118 # $(4): target triple
119 # $(5): device target
121 # $(7): offsets dumper abi
136 # _$(1)-$(2)_CXXFLAGS
137 # _$(1)-$(2)_CPPFLAGS
140 # _$(1)-$(2)_CONFIGURE_FLAGS
142 # _$(1)-$(2)_OFFSETS_DUMPER_ARGS
143 define CrossRuntimeTemplate
145 _cross-runtime_
$(1)-$(2)_CONFIGURE_FLAGS
= \
147 --with-cross-offsets
=$(4).h \
148 --with-llvm
=$$(TOP
)/sdks
/out
/$(6)
150 .stamp-
$(1)-$(2)-toolchain
:
153 .stamp-
$(1)-$(2)-$$(CONFIGURATION
)-configure
: |
$$(if
$$(IGNORE_PROVISION_LLVM
),,provision-
$(6))
155 $$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
)/$(4).h
: .stamp-
$(1)-$(2)-$$(CONFIGURATION
)-configure
$$(TOP
)/tools
/offsets-tool
/MonoAotOffsetsDumper.exe | configure-
$(1)-$(5)
156 cd
$$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
) && \
157 MONO_PATH
=$$(TOP
)/tools
/offsets-tool
/CppSharp
/$$(if
$$(filter $$(UNAME
),Darwin
),osx_32
,$$(if
$$(filter $$(UNAME
),Linux
),linux_64
,$$(error
"Unknown UNAME='$$(UNAME)'"))) \
158 mono
$$(if
$$(filter $$(UNAME
),Darwin
),--arch
=32) --debug
"$$(TOP)/tools/offsets-tool/MonoAotOffsetsDumper.exe" \
159 --abi
$(7) --outfile
"$$@" --mono
"$$(TOP)" --targetdir
"$$(TOP)/sdks/builds/$(1)-$(5)-$$(CONFIGURATION)" \
160 $$(_
$(1)-$(2)_OFFSETS_DUMPER_ARGS
)
162 build-
$(1)-$(2): $$(TOP
)/sdks
/builds
/$(1)-$(2)-$$(CONFIGURATION
)/$(4).h
164 $$(eval
$$(call RuntimeTemplate
,$(1),$(2),$(3)))
167 archive-
$(1): provision-
$(6)