f01e0b18164ae532270648e0c0d9ca2a3144a347
[mono.git] / mcs / class / aot-compiler / Makefile
1 #
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.
5 #
6
7 thisdir = class/aot-compiler
8
9 include ../../build/rules.make
10
11 the_libdir = $(topdir)/class/lib/$(PROFILE)/
12
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)
17
18 mscorlib_dll = $(the_libdir)/mscorlib.dll
19 mscorlib_aot_image = $(mscorlib_dll)$(PLATFORM_AOT_SUFFIX)
20
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
24
25 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
26 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
27
28 ifndef SKIP_AOT
29
30 ifdef PLATFORM_AOT_SUFFIX
31 $(mcs_aot_image): $(mcs_exe) $(mscorlib_dll) $(runtime_dep)
32         $(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)
33
34 $(mscorlib_aot_image): $(mscorlib_dll) $(runtime_dep)
35         $(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)
36
37 ifdef ENABLE_AOT
38
39 clean-local:
40         -rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log
41
42 # AOT build profile mcs to speed up build
43 ifeq ($(PROFILE),build)
44 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
45 install-local:
46 endif
47
48 ifeq ($(PROFILE), $(DEFAULT_PROFILE))
49 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
50 install-local:
51         $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
52         $(INSTALL_LIB) $(mscorlib_aot_image) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
53         $(INSTALL_LIB) $(mcs_aot_image) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
54 endif
55
56 endif
57
58 endif
59
60 endif
61
62 dist-local: dist-default