Facilitate the merge
[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 ifeq (net_2_0, $(PROFILE))
14 mcs_exe = $(the_libdir)/gmcs.exe
15 else ifeq (net_4_0, $(PROFILE))
16 mcs_exe = $(the_libdir)/dmcs.exe
17 endif
18
19 mcs_aot_image = $(mcs_exe)$(PLATFORM_AOT_SUFFIX)
20
21 mscorlib_dll = $(the_libdir)/mscorlib.dll
22 mscorlib_aot_image = $(mscorlib_dll)$(PLATFORM_AOT_SUFFIX)
23
24 PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
25 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
26
27 ifdef PLATFORM_AOT_SUFFIX
28 Q_AOT=$(if $(V),,@echo "AOT [$(PROFILE)] $(notdir $(@))";)
29 $(mcs_aot_image): $(mcs_exe)
30         $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version --debug $(mcs_exe)
31
32 $(mscorlib_aot_image): $(mscorlib_dll)
33         $(Q_AOT) MONO_PATH='$(the_libdir)' > $(PROFILE)_aot.log 2>&1 $(RUNTIME) --aot=bind-to-runtime-version --debug $(mscorlib_dll)
34
35 ifdef ENABLE_AOT
36
37 ifeq (net_2_0, $(PROFILE))
38 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
39 endif
40
41 ifeq (net_4_0, $(PROFILE))
42 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
43 endif
44
45 clean-local:
46         -rm -f $(mscorlib_aot_image) $(mcs_aot_image)
47
48 install-local:
49         $(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
50         $(INSTALL_LIB) $(mscorlib_aot_image) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
51         $(INSTALL_LIB) $(mcs_aot_image) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
52
53 endif
54
55 endif
56
57 dist-local: dist-default