TARGET_J2EE/JVM fixes
[mono.git] / mcs / class / corlib / Makefile
index 5c55a78da49a186bab1769cc3e06ebcfac707bce..69772f5f70407925943c0955bdd69a62cf1d32b4 100644 (file)
@@ -3,29 +3,40 @@ SUBDIRS =
 include ../../build/rules.make
 export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
 
-# corlib is crazy to build so we skip build/library.make and do stuff
-# ourselves.
-#
-# Here, we define a bunch of variables.
-
-corlib_flags = /unsafe /nostdlib
-LOCAL_MCS_FLAGS = /nowarn:649 /nowarn:169 -d:INSIDE_CORLIB
+RESOURCE_FILES = \
+       resources/collation.core.bin \
+       resources/collation.tailoring.bin \
+       resources/collation.cjkCHS.bin \
+       resources/collation.cjkCHT.bin \
+       resources/collation.cjkJA.bin \
+       resources/collation.cjkKO.bin \
+       resources/collation.cjkKOlv2.bin
+
+corlib_flags = -unsafe -nostdlib
+LOCAL_MCS_FLAGS = -nowarn:169,612,618,649 -d:INSIDE_CORLIB
+
+ifneq ($(FRAMEWORK_VERSION),1.0)
+LOCAL_MCS_FLAGS += -nowarn:414
+endif
 
 LIBRARY = corlib.dll
 LIBRARY_NAME = mscorlib.dll
-LIB_MCS_FLAGS = $(corlib_flags)
+LIB_MCS_FLAGS = $(corlib_flags) $(RESOURCE_FILES:%=/resource:%)
+LIBRARY_USE_INTERMEDIATE_FILE = yes
 
-# disable, until people fix their code...
-#corlib_flags = /unsafe /nostdlib /d:INSIDE_CORLIB
+LIBRARY_COMPILE = $(BOOT_COMPILE)
+LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 
-ifeq (net_2_0, $(PROFILE))
-LIBRARY_INSTALL_DIR = $(prefix)/lib/mono/2.0
-else
-LIBRARY_INSTALL_DIR = $(prefix)/lib
-endif
+EXTRA_DISTFILES = \
+       corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
+       $(plattestlib).excludes                 \
+       Test/ms_run_test.sh                     \
+       Test/resources/MyResources.resources    \
+       Test/resources/Empty.resources          \
+       Test/resources/AFile.txt                        \
+       $(RESOURCE_FILES)
 
 CLEAN_FILES = $(cmplib) $(reslib) $(plattestlib) $(plattestlib).sources \
-              $(net20bootstrap_response) $(net20bootstrap_makefrag) \
               $(cmp_response) $(cmp_makefrag) \
               $(res_response) $(res_makefrag) \
               $(cmppdb) $(respdb) $(plattestpdb)
@@ -41,13 +52,10 @@ CLEAN_FILES = $(cmplib) $(reslib) $(plattestlib) $(plattestlib).sources \
 
 plattestlib = corlib_plattest.dll
 plattestpdb = $(patsubst %.dll,%.pdb,$(plattestlib))
-reslib = $(topdir)/class/lib/$(PROFILE)/corlib_res.dll
-cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
-
 $(plattestlib).sources: corlib_test.dll.sources $(plattestlib).excludes
-       cat corlib_test.dll.sources $(plattestlib).excludes | sort | uniq -u >$@
+       sort corlib_test.dll.sources $(plattestlib).excludes | uniq -u >$@
 
-TEST_MCS_FLAGS = /debug+ /debug:full /nowarn:0618 /nowarn:0672 /unsafe
+TEST_MCS_FLAGS = -debug+ -debug:full -nowarn:168,219,618,672 -unsafe
 
 ifndef PLATFORM_MONO_NATIVE
 test_lib = $(plattestlib)
@@ -55,89 +63,36 @@ test_against = $(PLATFORM_CORLIB)
 HAVE_CS_TESTS = $(plattestlib).sources
 
 ## for now, compiling the testsuite with CSC causes CS0583.  So compile with internal MCS
-TEST_COMPILE = $(INTERNAL_MCS) $(USE_MCS_FLAGS)
+TEST_COMPILE = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_MCS) $(USE_MCS_FLAGS)
 endif
 
-run-test-ondotnet-local: run-plattest-ondotnet
+include ../../build/library.make
 
-ifdef PLATFORM_MONO_NATIVE
-run-monotest: run-test
-else
+ifndef PLATFORM_MONO_NATIVE
 run-monotest:
        $(MAKE) $(reslib)
        $(MAKE) test_lib=corlib_test.dll test_against=$(reslib) run-test
 
 run-plattest:
        $(MAKE) test_lib=$(plattestlib) test_against='$(PLATFORM_CORLIB)' run-test
-endif
-
-run-plattest-ondotnet: $(plattestlib)
-       $(TEST_HARNESS) $(plattestlib)
 
-EXTRA_DISTFILES = \
-       corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
-       $(plattestlib).excludes \
-       Test/ms_run_test.sh
-
-ifeq (net_2_0, $(PROFILE))
-# Net 2.0 corlib is built with in-tree 'gmcs'
-LIBRARY_COMPILE = MONO_PATH="../lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(gmcs) $(USE_MCS_FLAGS) /define:NET_1_1 /define:NET_2_0
 else
-LIBRARY_COMPILE = $(BOOT_COMPILE)
-endif
-
-include ../../build/library.make
-
-gmcs = $(topdir)/gmcs/gmcs.exe
-net20bootstraplib = $(topdir)/class/lib/net_2_0_bootstrap/mscorlib.dll
-
-ifeq (net_2_0, $(PROFILE))
-$(the_lib): $(gmcs)
-endif
-
-# The in-tree 'gmcs' needs at least a stripped-down version of the net 2.0 corlib.dll.  We build that first.
-# make sure that $(gmcs) is up-to-date
-FORCE:
-$(gmcs): $(net20bootstraplib) FORCE
-       cd $(topdir)/gmcs && $(MAKE)
-
-ifdef PLATFORM_CHANGE_SEPARATOR_CMD
-post_process = $(PLATFORM_CHANGE_SEPARATOR_CMD)
-else
-post_process = cat
+run-monotest: run-test
 endif
 
-#net_2_0_bootstrap
-
-net20bootstrap_response = $(depsdir)/net_2_0_bootstrap_corlib.dll.response
-net20bootstrap_makefrag = $(depsdir)/net_2_0_bootstrap_corlib.dll.makefrag
-
-$(net20bootstraplib): $(net20bootstrap_makefrag) $(net20bootstrap_response)
-       $(BOOTSTRAP_MCS) /nowarn:649 /nowarn:169 /define:INSIDE_CORLIB /define:NET_1_1 /define:BOOTSTRAP_NET_2_0 $(corlib_flags) /target:library /out:$(net20bootstraplib) @$(net20bootstrap_response)
-
-$(net20bootstrap_response): $(sourcefile)
-       @echo Creating $@ ...
-       @cat $< |$(post_process) >$@
-
-$(net20bootstrap_makefrag): $(net20bootstrap_response)
-       @echo Creating $@ ...
-       @sed 's,^,$(net20bootstraplib): ,' $< >$@
-
--include $(net20bootstrap_makefrag)
-
 # corlib_cmp
-
-cmppdb = $(patsubst %.dll,%.pdb,$(cmplib))
+cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
+cmppdb = $(cmplib:.dll=.pdb)
 cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response
 cmp_makefrag = $(depsdir)/$(PROFILE)_corlib_cmp.dll.makefrag
-cmp_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
+cmp_flags = -r:$(PLATFORM_CORLIB) $(corlib_flags)
 
 $(cmplib): $(cmp_makefrag) $(cmp_response)
-       $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) /target:library /out:$@ @$(cmp_response)
+       $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) -target:library -out:$@ @$(cmp_response)
 
-$(cmp_response): $(response) corlib_cmp.dll.excludes
+$(cmp_response): $(sourcefile) corlib_cmp.dll.excludes
        @echo Creating $@ ...
-       @cat corlib_cmp.dll.excludes $< | sort | uniq -u | $(post_process) >$@
+       @sort $(sourcefile) corlib_cmp.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
 
 $(cmp_makefrag): $(cmp_response)
        @echo Creating $@ ...
@@ -151,18 +106,18 @@ $(cmp_makefrag): $(cmp_response)
 # -include $(cmp_makefrag)
 
 # corlib_res
-
-respdb = $(patsubst %.dll,%.pdb,$(reslib))
+reslib = $(topdir)/class/lib/$(PROFILE)/corlib_res.dll
+respdb = $(reslib:.dll=.pdb)
 res_response = $(depsdir)/$(PROFILE)_corlib_res.dll.response
 res_makefrag = $(depsdir)/$(PROFILE)_corlib_res.dll.makefrag
-res_flags = /r:$(PLATFORM_CORLIB) $(corlib_flags)
+res_flags = -r:$(PLATFORM_CORLIB) $(corlib_flags)
 
 $(reslib): $(res_makefrag) $(res_response)
-       $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) /target:library /out:$@ @$(res_response)
+       $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) -target:library -out:$@ @$(res_response)
 
 $(res_response): $(sourcefile) corlib_res.dll.excludes
        @echo Creating $@ ...
-       @cat corlib_res.dll.excludes $(sourcefile) | sort | uniq -u | $(post_process) >$@
+       @sort $(sourcefile) corlib_res.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
 
 # warning: embedded tab in the 'echo touch' line
 $(res_makefrag): $(res_response)