Normalize line endings.
[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 ifdef use_monolite
10 PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
11 BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/monolite/gmcs.exe
12 else
13 PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
14 BOOTSTRAP_MCS = $(EXTERNAL_MCS)
15 endif
16
17 MCS = $(with_mono_path) $(INTERNAL_GMCS)
18
19 PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:BOOTSTRAP_BASIC
20 NO_SIGN_ASSEMBLY = yes
21 NO_TEST = yes
22 NO_INSTALL = yes
23 FRAMEWORK_VERSION = 2.0
24
25 # Compiler all using same bootstrap compiler
26 LIBRARY_COMPILE = $(BOOT_COMPILE)
27
28 # Verbose basic only
29 # V = 1
30
31 #
32 # Copy from rules.make because I don't know how to unset MCS_FLAGS
33 #
34 USE_MCS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
35
36 .PHONY: profile-check do-profile-check
37 profile-check:
38         @:
39
40 ifeq (.,$(thisdir))
41 all-recursive: do-profile-check
42 all-local: post-profile-cleanup
43 clean-local: clean-profile
44 endif
45
46 clean-profile:
47         -rm -f $(PROFILE_EXE) $(PROFILE_OUT) $(monolite_flag)
48
49 post-profile-cleanup:
50         @rm -f $(monolite_flag)
51
52 PROFILE_EXE = $(depsdir)/basic-profile-check.exe
53 PROFILE_OUT = $(PROFILE_EXE:.exe=.out)
54
55 MAKE_Q=$(if $(V),,-s)
56
57 do-profile-check: $(depsdir)/.stamp
58         @ok=:; \
59         rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
60         $(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
61         rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
62         if $$ok; then :; else \
63             if test -f $(topdir)/class/lib/monolite/gmcs.exe; then \
64                 $(MAKE) -s do-profile-check-monolite ; \
65             else \
66                 echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2; \
67                 echo "*** You need Mono version 2.4 or better installed to build MCS" 1>&2 ; \
68                 echo "*** Read INSTALL.txt for information on how to bootstrap a Mono installation." 1>&2 ; \
69                 exit 1; fi; fi
70
71
72 ifdef use_monolite
73
74 do-profile-check-monolite:
75         echo "*** The contents of your 'monolite' directory may be out-of-date" 1>&2
76         echo "*** You may want to try 'make get-monolite-latest'" 1>&2
77         rm -f $(monolite_flag)
78         exit 1
79
80 else
81
82 do-profile-check-monolite: $(depsdir)/.stamp
83         echo "*** The compiler '$(BOOTSTRAP_MCS)' doesn't appear to be usable." 1>&2
84         echo "*** Trying the 'monolite' directory." 1>&2
85         echo dummy > $(monolite_flag)
86         $(MAKE) do-profile-check
87
88 endif
89
90 $(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
91         $(BOOTSTRAP_MCS) /warn:0 /out:$@ $<
92         echo -n "Bootstrap compiler: " 1>&2
93         $(BOOTSTRAP_MCS) --version 1>&2
94
95 $(PROFILE_OUT): $(PROFILE_EXE)
96         $(PROFILE_RUNTIME) $< > $@ 2>&1