Merge pull request #3463 from david-mitchell/al-platform-switch
[mono-project.git] / mcs / class / aot-compiler / Makefile
blob3f22e653c194bb21bb73162180d68468beb1be8e
2 # This directory is used to AOT the C# compiler to speed up the rest of the class libs build
3 # It should be run after the assemblies the compiler depends on have been compiled, since
4 # the AOT image has a dependency on the exact assembly versions used to produce it.
7 thisdir = class/aot-compiler
9 include ../../build/rules.make
11 the_libdir = $(topdir)/class/lib/$(PROFILE)/
13 # mcs.exe is only in the build profile, but the aot image should be compiled against the current
14 # profile
15 mcs_exe = $(topdir)/class/lib/build/mcs.exe
16 mcs_aot_image = $(the_libdir)/mcs.exe$(PLATFORM_AOT_SUFFIX)
18 mscorlib_dll = $(the_libdir)/mscorlib.dll
19 mscorlib_aot_image = $(mscorlib_dll)$(PLATFORM_AOT_SUFFIX)
21 # The $(dir $(RUNTIME)) is necessary to get path to the mono binary in case when we cross-compile
22 # or just compile from a different directory than the top source dir
23 runtime_dep = $(dir $(RUNTIME))/../mono/mini/mono
25 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
26 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
28 ifndef SKIP_AOT
30 ifdef PLATFORM_AOT_SUFFIX
31 Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
32 $(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
33 $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version,outfile=$(mcs_aot_image) --debug $(mcs_exe) || cat $(PROFILE)_aot.log || (cat $(PROFILE)_aot.log; exit 1)
35 $(mscorlib_aot_image): $(mscorlib_dll) $(runtime_dep)
36 $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version --debug $(mscorlib_dll) || (cat $(PROFILE)_aot.log; exit 1)
38 ifdef ENABLE_AOT
40 clean-local:
41 -rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log
43 # AOT build profile mcs to speed up build
44 ifeq ($(PROFILE),build)
45 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
46 install-local:
47 endif
49 ifeq ($(PROFILE), $(DEFAULT_PROFILE))
50 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
51 install-local:
52 $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
53 $(INSTALL_LIB) $(mscorlib_aot_image) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
54 $(INSTALL_LIB) $(mcs_aot_image) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
55 endif
57 endif
59 endif
61 endif
63 dist-local: dist-default