3 BOOTSTRAP_MCS = $(EXTERNAL_MCS)
6 # If we are bootstrapping with an external mono -- for example, trying
7 # to do `make basic' with an old mono RPM, we need to make sure that we don't
8 # set MONO_PATH for an old runtime -- otherwise it will get a new corlib and
9 # be fscked up. We do this by testing if the first word of runtime is the same
10 # as external runtime -- if so, we make sure not to set the MONO_PATH on mcs.
13 ifeq ($(word 1, $(RUNTIME)),$(EXTERNAL_RUNTIME))
20 MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_MCS)
23 PROFILE_MCS_FLAGS = -d:NET_1_1 -d:ONLY_1_1 -d:BOOTSTRAP_WITH_OLDLIB
24 NO_SIGN_ASSEMBLY = yes
28 .PHONY: profile-check do-profile-check
33 all-recursive: do-profile-check
34 clean-local: clean-profile
38 -rm -f $(PROFILE_CS) $(PROFILE_EXE) $(PROFILE_OUT)
40 PROFILE_CS = $(topdir)/build/deps/basic-profile-check.cs
41 PROFILE_EXE = $(PROFILE_CS:.cs=.exe)
42 PROFILE_OUT = $(PROFILE_CS:.cs=.out)
46 rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
47 $(MAKE) -s $(PROFILE_OUT) || ok=false; \
48 rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
49 if $$ok; then :; else \
50 echo "*** The compiler '$(EXTERNAL_MCS)' doesn't appear to be usable." 1>&2 ; \
51 if test -f $(topdir)/class/lib/monolite/mcs.exe; then \
52 echo "*** Falling back to using pre-compiled binaries. Be warned, this may not work." 1>&2 ; \
53 ( cd $(topdir)/jay && $(MAKE) ); \
54 ( cd $(topdir)/mcs && $(MAKE) PROFILE=basic cs-parser.cs ); \
55 ( cd $(topdir)/class/lib/monolite/ && cp *.exe *.dll ../basic ); \
56 case `ls -1t $(topdir)/class/lib/basic/mcs.exe $(topdir)/mcs/cs-parser.cs | sed 1q` in \
57 $(topdir)/class/lib/basic/mcs.exe) : ;; \
58 *) sleep 5; cp $(topdir)/class/lib/monolite/mcs.exe $(topdir)/class/lib/basic ;; \
61 echo "*** You need a C# compiler installed to build MCS. (make sure mcs works from the command line)" 1>&2 ; \
62 echo "*** Read INSTALL.txt for information on how to bootstrap a Mono installation." 1>&2 ; \
65 $(PROFILE_CS): $(topdir)/build/profiles/basic.make
66 echo 'public class X { public static void Main () { System.Console.WriteLine ("OK"); } }' > $@
68 $(PROFILE_EXE): $(PROFILE_CS)
69 $(EXTERNAL_MCS) /out:$@ $<
71 $(PROFILE_OUT): $(PROFILE_EXE)
72 $(EXTERNAL_RUNTIME) $< > $@ 2>&1
73 set x `wc -l $@`; case $$2 in 1) :;; *) exit 1;; esac
74 grep '^OK$$' $@ > /dev/null