Merge pull request #249 from pcc/xgetinputfocus
[mono.git] / mcs / class / corlib / Makefile
1 thisdir = class/corlib
2 SUBDIRS =
3 include ../../build/rules.make
4 export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
5
6 LIBRARY = corlib.dll
7 LIBRARY_NAME = mscorlib.dll
8 LIB_MCS_FLAGS = $(RESOURCE_FILES:%=-resource:%)
9 LIBRARY_USE_INTERMEDIATE_FILE = yes
10
11 ifeq (basic, $(PROFILE))
12
13 else
14
15 ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
16 LIB_MCS_FLAGS += --runtime:v2
17 else
18 ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
19 LIB_MCS_FLAGS += --runtime:v4
20 else
21 $(error Unknown framework version)
22 endif
23 endif
24
25 endif
26
27 LIBRARY_COMPILE = $(BOOT_COMPILE)
28 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
29
30 RESOURCE_FILES = \
31         resources/collation.core.bin \
32         resources/collation.tailoring.bin \
33         resources/collation.cjkCHS.bin \
34         resources/collation.cjkCHT.bin \
35         resources/collation.cjkJA.bin \
36         resources/collation.cjkKO.bin \
37         resources/collation.cjkKOlv2.bin
38
39 LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC
40 DEFAULT_REFERENCES =
41
42 # System.IO/DirectoryInfoTest.cs needs Mono.Posix
43 TEST_MCS_FLAGS = -debug+ -debug:full -nowarn:168,219,618,672 -unsafe -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -define:MONO_DATACONVERTER_STATIC_METHODS
44
45 EXTRA_DISTFILES = \
46         Test/ms_run_test.sh                     \
47         Test/resources/MyResources.resources    \
48         Test/resources/MyResources.de.resources \
49         Test/resources/Empty.resources          \
50         Test/resources/AFile.txt                \
51         Test/resources/StreamTest.resources     \
52         Test/resources/StreamTest.ja.resources  \
53         Test/resources/bug81759.resources       \
54         Test/resources/415628.bin               \
55         Test/resources/Fergie.GED               \
56         $(RESOURCE_FILES)
57
58 include $(topdir)/build/library.make
59
60 ifdef FIXME_CORLIB_CMP
61 # corlib_cmp
62 corlib_flags = -unsafe -nostdlib
63 cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
64 cmppdb = $(cmplib:.dll=.pdb)
65 cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response
66 cmp_makefrag = $(depsdir)/$(PROFILE)_corlib_cmp.dll.makefrag
67 cmp_flags = -r:$(PLATFORM_CORLIB) $(corlib_flags)
68
69 EXTRA_DISTFILES += corlib_cmp.dll.excludes
70 CLEAN_FILES += $(cmplib) $(cmp_response) $(cmp_makefrag) $(cmppdb)
71
72 $(cmplib): $(cmp_makefrag) $(cmp_response)
73         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) -target:library -out:$@ @$(cmp_response)
74
75 $(cmp_response): $(sourcefile) corlib_cmp.dll.excludes
76         @echo Creating $@ ...
77         @sort $(sourcefile) corlib_cmp.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
78
79 $(cmp_makefrag): $(cmp_response)
80         @echo Creating $@ ...
81         @sed 's,^,$(cmplib): ,' $< >$@
82
83 # Since we make corlib_cmp on demand, there isn't a real need
84 # to have full dep tracking for it. Also, the generation of this
85 # file is busted on Win32 ('sort' seems to mess up line endings),
86 # leading to a broken build.
87 #
88 # -include $(cmp_makefrag)
89
90 $(cmp_response) $(cmp_makefrag): Makefile $(depsdir)/.stamp
91 endif
92
93 vts = VersionTolerantSerialization
94 vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/$(vts)
95 vtslibs = \
96         $(vtsdir)/$(vts)TestLib/1.0/Address.dll \
97         $(vtsdir)/$(vts)TestLib/2.0/Address.dll \
98         $(vtsdir)/$(vts)TestLib/3.0/Address.dll \
99         $(vtsdir)/$(vts)TestLib/4.0/Address.dll \
100         $(vtsdir)/$(vts)TestLib/5.0/Address.dll \
101         $(vtsdir)/$(vts)TestLib/6.0/Address.dll
102
103 test-vts: $(vtslibs) $(vtsdir)/BinarySerializationOverVersions.exe
104
105 $(vtsdir)/$(vts)TestLib/%/Address.dll: $(vtsdir)/$(vts)TestLib/%/Address.cs
106         $(Q_MCS) $(MCS) -target:library -warn:0  $^
107
108 $(vtsdir)/BinarySerializationOverVersions.exe: $(vtsdir)/BinarySerializationOverVersions.cs $(vtsdir)/$(vts)TestLib/1.0/Address.dll
109         $(Q_MCS) $(MCS) $(test_nunit_ref) -warn:0  \
110                 -r:$(vtsdir)/$(vts)TestLib/1.0/Address.dll \
111                 $(vtsdir)/BinarySerializationOverVersions.cs
112         @cp $(vtsdir)/$(vts)TestLib/1.0/Address.dll $(vtsdir)
113
114 # Need to define MONO_PATH to an absolute dir since the test is ran from a subdir
115 run-test-vts: test-vts
116         @echo Running vts tests...
117         $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(TEST_HARNESS) -noshadow \
118                 $(vtsdir)/BinarySerializationOverVersions.exe 
119 test: test-vts
120 run-test: run-test-vts
121
122 EXTRA_DISTFILES += \
123         $(vtsdir)/$(vts)TestLib/1.0/Address.cs \
124         $(vtsdir)/$(vts)TestLib/2.0/Address.cs \
125         $(vtsdir)/$(vts)TestLib/3.0/Address.cs \
126         $(vtsdir)/$(vts)TestLib/4.0/Address.cs \
127         $(vtsdir)/$(vts)TestLib/5.0/Address.cs \
128         $(vtsdir)/$(vts)TestLib/6.0/Address.cs \
129         $(vtsdir)/BinarySerializationOverVersions.cs