Procházet zdrojové kódy

Make mcs.exe .net4 application

Marek Safar před 15 roky
rodič
revize
5e5b296eae

+ 10 - 9
mcs/Makefile

@@ -2,14 +2,14 @@ thisdir := .
 
 SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
 
-basic_SUBDIRS := build jay mcs class tools
+basic_SUBDIRS := build jay mcs class
+build_SUBDIRS := build class mcs class/aot-compiler tools
 net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors
-moonlight_raw_SUBDIRS := build class tools
-moonlight_SUBDIRS := tools
+moonlight_raw_SUBDIRS := build class
 monodroid_SUBDIRS := build class
 monotouch_SUBDIRS := build class
 net_3_5_SUBDIRS := build class tools/xbuild
-net_4_0_SUBDIRS := build class nunit24 ilasm tools tests errors docs
+net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
 
 # List of test subdirs that should pass 100%
 centum_tests := \
@@ -100,13 +100,14 @@ profiles-do--run-test:
 
 # Orchestrate the bootstrap here.
 _boot_ = all clean install
-$(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--basic--%
+$(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--build--%
 $(_boot_:%=profile-do--net_3_5--%):           profile-do--net_3_5--%:           profile-do--net_2_0--%
 $(_boot_:%=profile-do--moonlight--%):         profile-do--moonlight--%:         profile-do--moonlight_raw--%
-$(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--basic--%
-$(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--basic--%
-$(_boot_:%=profile-do--moonlight_raw--%):     profile-do--moonlight_raw--%:     profile-do--basic--%
-$(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--basic--%
+$(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--build--%
+$(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--build--%
+$(_boot_:%=profile-do--moonlight_raw--%):     profile-do--moonlight_raw--%:     profile-do--build--%
+$(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--build--%
+$(_boot_:%=profile-do--build--%):             profile-do--build--%:             profile-do--basic--%
 
 testcorlib:
 	@cd class/corlib && $(MAKE) test run-test

+ 1 - 0
mcs/build/Makefile

@@ -17,6 +17,7 @@ common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
 PLATFORMS = darwin linux win32
 PROFILES = \
 	basic \
+	build \
 	net_2_0 \
 	moonlight_raw \
 	moonlight \

+ 2 - 2
mcs/build/library.make

@@ -66,8 +66,8 @@ library_CLEAN_FILES += $(build_lib) $(build_lib).so $(build_lib).mdb $(build_lib
 ifdef NO_SIGN_ASSEMBLY
 SN = :
 else
-sn = $(topdir)/class/lib/basic/sn.exe
-SN = $(Q) MONO_PATH="$(topdir)/class/lib/basic$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn)
+sn = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/sn.exe
+SN = $(Q) MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(sn)
 SNFLAGS = -q
 endif
 

+ 21 - 0
mcs/build/profiles/build.make

@@ -0,0 +1,21 @@
+# -*- makefile -*-
+
+BOOTSTRAP_PROFILE = basic
+BUILD_TOOLS_PROFILE = basic
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+
+# nuttzing!
+
+profile-check:
+	@:
+
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+
+NO_SIGN_ASSEMBLY = yes
+NO_TEST = yes
+NO_INSTALL = yes
+
+FRAMEWORK_VERSION = 4.0

+ 1 - 1
mcs/build/profiles/monodroid.make

@@ -1,6 +1,6 @@
 #! -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)

+ 1 - 1
mcs/build/profiles/monotouch.make

@@ -1,6 +1,6 @@
 #! -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)

+ 1 - 1
mcs/build/profiles/moonlight_raw.make

@@ -1,6 +1,6 @@
 #! -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)

+ 1 - 1
mcs/build/profiles/net_2_0.make

@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 

+ 1 - 1
mcs/build/profiles/net_3_5.make

@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 

+ 1 - 1
mcs/build/profiles/net_4_0.make

@@ -1,6 +1,6 @@
 # -*- makefile -*-
 
-BOOTSTRAP_PROFILE = basic
+BOOTSTRAP_PROFILE = build
 
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)

+ 7 - 7
mcs/build/rules.make

@@ -24,6 +24,10 @@ Q=$(if $(V),,@)
 # echo -e "\\t" does not work on some systems, so use 5 spaces
 Q_MCS=$(if $(V),,@echo "MCS     [$(PROFILE)] $(notdir $(@))";)
 
+ifndef BUILD_TOOLS_PROFILE
+BUILD_TOOLS_PROFILE = build
+endif
+
 USE_MCS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
 USE_MBAS_FLAGS = /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
 USE_CFLAGS = $(LOCAL_CFLAGS) $(CFLAGS)
@@ -37,14 +41,10 @@ INSTALL_BIN = $(INSTALL) -c -m 755
 INSTALL_LIB = $(INSTALL_BIN)
 MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
 INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/basic/mcs.exe
+INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
 INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
 corlib = mscorlib.dll
 
-ifndef BUILD_TOOLS_PROFILE
-BUILD_TOOLS_PROFILE = basic
-endif
-
 INTERNAL_RESGEN = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe
 
 depsdir = $(topdir)/build/deps
@@ -117,8 +117,8 @@ endif
 ifdef NO_INSTALL
 GACUTIL = :
 else
-gacutil = $(topdir)/class/lib/basic/gacutil.exe
-GACUTIL = MONO_PATH="$(topdir)/class/lib/basic$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
+gacutil = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gacutil.exe
+GACUTIL = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(gacutil)
 endif
 
 STD_TARGETS = test run-test run-test-ondotnet clean install uninstall doc-update

+ 9 - 1
mcs/class/Makefile

@@ -2,7 +2,15 @@ thisdir = class
 
 # Note that Mono.Security and System.Security aren't listed.
 # We may have to add those if 'mcs' starts using them.
-basic_SUBDIRS := corlib System System.XML System Mono.Security Mono.CompilerServices.SymbolWriter System.Core aot-compiler
+basic_SUBDIRS := corlib System System.XML System Mono.Security System.Core 
+
+build_SUBDIRS :=  \
+	corlib \
+	System \
+	System.XML \
+	System Mono.Security \
+	Mono.Posix \
+	System.Core
 
 net_1_1_java_SUBDIRS = \
 	System.Xml					\

+ 1 - 0
mcs/class/System.Core/build_System.Core.dll.sources

@@ -0,0 +1 @@
+#include net_4_0_System.Core.dll.sources

+ 7 - 6
mcs/class/aot-compiler/Makefile

@@ -10,9 +10,9 @@ include ../../build/rules.make
 
 the_libdir = $(topdir)/class/lib/$(PROFILE)/
 
-# mcs is in the basic profile, but the aot image should be compiled against the current
+# mcs.exe is only in the build profile, but the aot image should be compiled against the current
 # profile
-mcs_exe = $(topdir)/class/lib/basic/mcs.exe
+mcs_exe = $(topdir)/class/lib/build/mcs.exe
 mcs_aot_image = $(the_libdir)/mcs.exe$(PLATFORM_AOT_SUFFIX)
 
 mscorlib_dll = $(the_libdir)/mscorlib.dll
@@ -36,12 +36,13 @@ ifdef ENABLE_AOT
 clean-local:
 	-rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log
 
-ifeq ($(PROFILE),basic)
+# AOT build profile mcs to speed up build
+ifeq ($(PROFILE),build)
 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
 install-local:
 endif
 
-ifeq ($(PROFILE),net_2_0)
+ifeq ($(PROFILE),net_4_0)
 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
 install-local:
 	$(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)
@@ -49,8 +50,8 @@ install-local:
 	$(INSTALL_LIB) $(mcs_aot_image) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
 endif
 
-# No mcs in net 4.0
-ifeq ($(PROFILE),net_4_0)
+# No mcs in net 2.0
+ifeq ($(PROFILE),net_2_0)
 all-local: $(mscorlib_aot_image)
 install-local:
 	$(MKINSTALLDIRS) $(DESTDIR)$(LIBRARY_INSTALL_DIR)

+ 2 - 2
mcs/errors/Makefile

@@ -41,7 +41,7 @@ TEST_SUPPORT_FILES = \
 # mention all targets
 all-local $(STD_TARGETS:=-local):
 
-VALID_PROFILE := $(filter net_2_0 moonlight net_4_0, $(PROFILE))
+VALID_PROFILE := $(filter net_4_0, $(PROFILE))
 ifdef VALID_PROFILE
 
 qcheck: run-mcs-tests 
@@ -67,7 +67,7 @@ TESTER_OPTIONS = -compiler-options:"-v -d:NET_4_0 -sdk:4"
 TEST_SUPPORT_FILES += DCS0266-lib.dll
 endif
 
-COMPILER = $(topdir)/class/lib/basic/mcs.exe
+COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
 
 run-mcs-tests: $(TEST_SUPPORT_FILES)

+ 9 - 2
mcs/mcs/Makefile

@@ -12,9 +12,16 @@ EXTRA_DISTFILES = \
 	TODO			\
 	ikvm.cs
 
-LOCAL_MCS_FLAGS += -d:STATIC
-PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/2.0
+ifeq (basic, $(PROFILE))
 PROGRAM = $(topdir)/class/lib/basic/mcs.exe
+else
+PROGRAM = $(topdir)/class/lib/build/mcs.exe
+LOCAL_MCS_FLAGS += -lib:$(topdir)/class/lib/build
+endif
+
+LOCAL_MCS_FLAGS += -d:STATIC
+
+PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/4.0
 
 PROGRAM_COMPILE = $(BOOT_COMPILE)
 

+ 2 - 2
mcs/tests/Makefile

@@ -19,7 +19,7 @@ USE_MCS_FLAGS :=
 # mention all targets
 all-local $(STD_TARGETS:=-local):
 
-VALID_PROFILE := $(filter net_2_0 moonlight net_4_0, $(PROFILE))
+VALID_PROFILE := $(filter net_4_0, $(PROFILE))
 ifdef VALID_PROFILE
 # casts
 bootstrap-cast.exe: gen-cast-test.cs
@@ -52,7 +52,7 @@ DEFINES = -compiler-options:"-d:NET_4_0 -sdk:4"
 endif
 
 LOCAL_RUNTIME_FLAGS = --verify-all
-COMPILER = $(topdir)/class/lib/basic/mcs.exe
+COMPILER = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/mcs.exe
 TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
 
 TEST_ILS := $(wildcard *-lib.il)

+ 4 - 10
mcs/tools/Makefile

@@ -2,7 +2,6 @@ thisdir = tools
 
 per_profile_dirs = \
 	al		\
-	compiler-tester	\
 	linker		\
 	tuner		\
 	csharp		\
@@ -19,6 +18,7 @@ per_profile_dirs = \
 net_4_0_dirs := \
 	$(per_profile_dirs) \
 	corcompare	\
+	compiler-tester	\
 	mono-xmltool	\
 	mono-shlib-cop	\
 	sgen		\
@@ -46,19 +46,13 @@ net_4_0_dirs := \
 net_2_0_dirs := \
 	$(per_profile_dirs) \
 	monodoc		\
-	mdoc		\
-	compiler-tester
-
-moonlight_dirs := \
-	compiler-tester
+	mdoc
 
-basic_SUBDIRS = gacutil resgen security culevel
+build_SUBDIRS = gacutil resgen security culevel
 net_2_0_SUBDIRS := $(basic_SUBDIRS) $(net_2_0_dirs)
-moonlight_raw_SUBDIRS := $(moonlight_dirs)
-moonlight_SUBDIRS := $(moonlight_dirs)
 net_4_0_SUBDIRS := $(net_4_0_dirs) $(basic_SUBDIRS)
 
-SUBDIRS = $(basic_SUBDIRS) $(net_2_0_SUBDIRS) $(moonlight_SUBDIRS)
+SUBDIRS = $(basic_SUBDIRS) $(net_2_0_SUBDIRS)
 DIST_SUBDIRS = $(SUBDIRS) $(net_4_0_dirs)
 
 include ../build/rules.make

+ 1 - 1
mcs/tools/security/Makefile

@@ -22,7 +22,7 @@ PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 
 DISTFILES = README TESTS $(SECURITY_SOURCES)
 
-ifeq (basic, $(PROFILE))
+ifeq (build, $(PROFILE))
 all-local: $(topdir)/class/lib/$(PROFILE)/sn.exe
 else
 all-local: $(SECURITY_TARGETS)

+ 3 - 2
scripts/Makefile.am

@@ -148,6 +148,7 @@ EXTRA_DIST =			\
 	mono-find-requires.in	\
 	peverify.in			\
 	mcs.in				\
+	gmcs.in				\
 	dmcs.in				\
 	mono-test-install	\
 	mono-heapviz		\
@@ -202,8 +203,8 @@ mcs: mcs.in Makefile
 	$(REWRITE_COMMON) $(srcdir)/mcs.in > [email protected]
 	mv -f [email protected] $@
 
-gmcs: mcs.in Makefile
-	$(REWRITE_COMMON) $(srcdir)/mcs.in > [email protected]
+gmcs: gmcs.in Makefile
+	$(REWRITE_COMMON) $(srcdir)/gmcs.in > [email protected]
 	mv -f [email protected] $@
 
 dmcs: dmcs.in Makefile

+ 1 - 1
scripts/dmcs.in

@@ -1,2 +1,2 @@
 #!/bin/sh
-exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/2.0/mcs.exe -sdk:4 "$@"
+exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.0/mcs.exe -sdk:4 "$@"

+ 2 - 0
scripts/gmcs.in

@@ -0,0 +1,2 @@
+#!/bin/sh
+exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.0/mcs.exe -sdk:2 "$@"

+ 1 - 1
scripts/mcs.in

@@ -1,2 +1,2 @@
 #!/bin/sh
-exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/2.0/mcs.exe -sdk:2 "$@"
+exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.0/mcs.exe -sdk:2 "$@"