2014-08-13 10:39:27 +01:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2017-08-21 15:34:15 +00:00
|
|
|
monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)
|
2017-04-10 11:41:01 +00:00
|
|
|
|
|
|
|
with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
monolite_flag := $(depsdir)/use-monolite
|
|
|
|
use_monolite := $(wildcard $(monolite_flag))
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
MONOLITE_MSCORLIB = $(monolite_path)/mscorlib.dll
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
ifdef use_monolite
|
2017-04-10 11:41:01 +00:00
|
|
|
ifdef MCS_MODE
|
|
|
|
CSC_LOCATION = $(monolite_path)/mcs.exe
|
|
|
|
endif
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
|
2017-04-10 11:41:01 +00:00
|
|
|
BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
else
|
|
|
|
PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
|
2017-04-10 11:41:01 +00:00
|
|
|
ifdef MCS_MODE
|
|
|
|
BOOTSTRAP_MCS = mcs
|
|
|
|
else
|
|
|
|
BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION)
|
2014-08-13 10:39:27 +01:00
|
|
|
endif
|
2017-04-10 11:41:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
MCS = $(BOOTSTRAP_MCS)
|
2014-08-13 10:39:27 +01:00
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
2014-08-13 10:39:27 +01:00
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib $(DEFAULT_REFERENCES)
|
2014-08-13 10:39:27 +01:00
|
|
|
NO_SIGN_ASSEMBLY = yes
|
|
|
|
NO_TEST = yes
|
|
|
|
NO_INSTALL = yes
|
2017-10-19 20:04:20 +00:00
|
|
|
FRAMEWORK_VERSION = 4.5
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
# Compiler all using same bootstrap compiler
|
|
|
|
LIBRARY_COMPILE = $(BOOT_COMPILE)
|
|
|
|
|
|
|
|
# Verbose basic only
|
|
|
|
# V = 1
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copy from rules.make because I don't know how to unset MCS_FLAGS
|
|
|
|
#
|
2017-04-10 11:41:01 +00:00
|
|
|
USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS)
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
.PHONY: profile-check do-profile-check
|
|
|
|
profile-check:
|
|
|
|
@:
|
|
|
|
|
|
|
|
ifeq (.,$(thisdir))
|
|
|
|
all-recursive: do-profile-check
|
|
|
|
all-local: post-profile-cleanup
|
|
|
|
clean-local: clean-profile
|
|
|
|
endif
|
|
|
|
|
|
|
|
clean-profile:
|
|
|
|
-rm -f $(PROFILE_EXE) $(PROFILE_OUT) $(monolite_flag)
|
|
|
|
|
|
|
|
post-profile-cleanup:
|
|
|
|
@rm -f $(monolite_flag)
|
|
|
|
|
|
|
|
PROFILE_EXE = $(depsdir)/basic-profile-check.exe
|
|
|
|
PROFILE_OUT = $(PROFILE_EXE:.exe=.out)
|
|
|
|
|
|
|
|
MAKE_Q=$(if $(V),,-s)
|
|
|
|
|
|
|
|
do-profile-check: $(depsdir)/.stamp
|
|
|
|
@ok=:; \
|
|
|
|
rm -f $(PROFILE_EXE) $(PROFILE_OUT); \
|
2017-04-10 11:41:01 +00:00
|
|
|
if [ -z '$(MAKE_Q)' ] && [ -n '$(PROFILE_RUNTIME)' ]; then $(PROFILE_RUNTIME) --version; fi; \
|
2014-08-13 10:39:27 +01:00
|
|
|
$(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \
|
|
|
|
if $$ok; then rm -f $(PROFILE_EXE) $(PROFILE_OUT); else \
|
2017-04-10 11:41:01 +00:00
|
|
|
if test ! -s $(MONOLITE_MSCORLIB); then \
|
|
|
|
$(MAKE) $(MAKE_Q) do-get-monolite ; \
|
|
|
|
fi; \
|
|
|
|
if test -f $(MONOLITE_MSCORLIB); then \
|
|
|
|
$(MAKE) $(MAKE_Q) do-profile-check-monolite ; \
|
2014-08-13 10:39:27 +01:00
|
|
|
else \
|
2017-04-10 11:41:01 +00:00
|
|
|
echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2; \
|
|
|
|
echo "*** Check README for information on how to bootstrap a Mono installation." 1>&2 ; \
|
2014-08-13 10:39:27 +01:00
|
|
|
exit 1; fi; fi
|
|
|
|
|
|
|
|
|
|
|
|
ifdef use_monolite
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
do-get-monolite:
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
do-profile-check-monolite:
|
2017-08-21 15:34:15 +00:00
|
|
|
@echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2
|
2017-04-10 11:41:01 +00:00
|
|
|
@echo "*** You may want to try 'make get-monolite-latest'" 1>&2
|
2014-08-13 10:39:27 +01:00
|
|
|
rm -f $(monolite_flag)
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
do-get-monolite:
|
2017-08-21 15:34:15 +00:00
|
|
|
@echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2
|
|
|
|
$(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest
|
2017-04-10 11:41:01 +00:00
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
do-profile-check-monolite: $(depsdir)/.stamp
|
2017-04-10 11:41:01 +00:00
|
|
|
@echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2
|
2017-08-21 15:34:15 +00:00
|
|
|
@echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2
|
2017-04-10 11:41:01 +00:00
|
|
|
@echo dummy > $(monolite_flag)
|
2014-08-13 10:39:27 +01:00
|
|
|
$(MAKE) do-profile-check
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs
|
2017-04-10 11:41:01 +00:00
|
|
|
$(MAKE) $(MAKE_Q) -C $(topdir)/packages
|
|
|
|
$(BOOTSTRAP_MCS) /warn:0 /noconfig /r:System.dll /r:mscorlib.dll /out:$@ $<
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
$(PROFILE_OUT): $(PROFILE_EXE)
|
|
|
|
$(PROFILE_RUNTIME) $< > $@ 2>&1
|