[build] Roslyn switch
[mono.git] / mcs / build / profiles / basic.make
1 # -*- makefile -*-
2
3 with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
4 with_mono_path_monolite = MONO_PATH="$(topdir)/class/lib/monolite$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
5
6 monolite_flag := $(depsdir)/use-monolite
7 use_monolite := $(wildcard $(monolite_flag))
8
9 MONOLITE_MSCORLIB = $(topdir)/class/lib/monolite/mscorlib.dll
10
11 # Bootstrap compiler does not have to be same as production compiler
12 INTERNAL_GMCS = $(CSC_LOCATION)
13
14 ifdef use_monolite
15 PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
16 else
17 PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
18 endif
19
20 INTERNAL_CSC = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(INTERNAL_GMCS)
21 BOOTSTRAP_MCS = CSC_SDK_PATH_DISABLED= $(INTERNAL_CSC)
22 MCS = $(BOOTSTRAP_MCS)
23
24 DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
25
26 PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
27 NO_SIGN_ASSEMBLY = yes
28 NO_TEST = yes
29 NO_INSTALL = yes
30 FRAMEWORK_VERSION = 4.0
31
32 # Compiler all using same bootstrap compiler
33 LIBRARY_COMPILE = $(BOOT_COMPILE)
34
35 # Verbose basic only
36 # V = 1
37
38 #
39 # Copy from rules.make because I don't know how to unset MCS_FLAGS
40 #
41 USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
42
43 .PHONY: profile-check do-profile-check
44 profile-check:
45         @:
46
47 ifeq (.,$(thisdir))
48 all-recursive: do-profile-check
49 all-local: post-profile-cleanup
50 clean-local: clean-profile
51 endif
52
53 clean-profile:
54         -rm -f $(PROFILE_EXE) $(PROFILE_OUT) $(monolite_flag)
55
56 post-profile-cleanup:
57         @rm -f $(monolite_flag)
58
59 PROFILE_EXE = $(depsdir)/basic-profile-check.exe
60 PROFILE_OUT = $(PROFILE_EXE:.exe=.out)
61
62 MAKE_Q=$(if $(V),,-s)
63
64 do-profile-check: $(depsdir)/.stamp
65         @ok=:; \
66         rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
67         if [ -z '$(MAKE_Q)' ] && [ -n '$(PROFILE_RUNTIME)' ]; then $(PROFILE_RUNTIME) --version; fi; \
68         $(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
69         if $$ok; then rm -f $(PROFILE_EXE) $(PROFILE_OUT); else \
70             if test -f $(MONOLITE_MSCORLIB); then \
71                 $(MAKE) $(MAKE_Q) do-profile-check-monolite ; \
72             else \
73                 echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2; \
74                 echo "*** You need Mono version 4.0 or better installed to build MCS" 1>&2 ; \
75                 echo "*** Check mono README for information on how to bootstrap a Mono installation." 1>&2 ; \
76                 exit 1; fi; fi
77
78
79 ifdef use_monolite
80
81 do-profile-check-monolite:
82         @echo "*** The contents of your 'monolite' directory may be out-of-date" 1>&2
83         @echo "*** You may want to try 'make get-monolite-latest'" 1>&2
84         rm -f $(monolite_flag)
85         exit 1
86
87 else
88
89 do-profile-check-monolite: $(depsdir)/.stamp
90         @echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
91         @echo "*** Trying the 'monolite' directory." 1>&2
92         @echo dummy > $(monolite_flag)
93         $(MAKE) do-profile-check
94
95 endif
96
97 $(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
98         $(MAKE) $(MAKE_Q) -C $(topdir)/packages
99         $(INTERNAL_CSC) /warn:0 /noconfig /r:System.dll /r:mscorlib.dll /out:$@ $<
100
101 $(PROFILE_OUT): $(PROFILE_EXE)
102         $(PROFILE_RUNTIME) $< > $@ 2>&1