2005-08-11 Atsushi Enomoto <atsushi@ximian.com>
[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 RESOURCE_FILES = \
7         resources/collation.core.bin \
8         resources/collation.tailoring.bin \
9         resources/collation.cjkCHS.bin \
10         resources/collation.cjkCHT.bin \
11         resources/collation.cjkJA.bin \
12         resources/collation.cjkKO.bin \
13         resources/collation.cjkKOlv2.bin
14
15 corlib_flags = -unsafe -nostdlib
16 LOCAL_MCS_FLAGS = -nowarn:169,612,618,649 -d:INSIDE_CORLIB
17
18 ifneq ($(FRAMEWORK_VERSION),1.0)
19 LOCAL_MCS_FLAGS += -nowarn:414
20 endif
21
22 LIBRARY = corlib.dll
23 LIBRARY_NAME = mscorlib.dll
24 LIB_MCS_FLAGS = $(corlib_flags) $(RESOURCE_FILES:%=/resource:%)
25 LIBRARY_USE_INTERMEDIATE_FILE = yes
26
27 LIBRARY_COMPILE = $(BOOT_COMPILE)
28 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
29
30 EXTRA_DISTFILES = \
31         corlib.dll.win32-excludes corlib_cmp.dll.excludes corlib_res.dll.excludes \
32         $(plattestlib).excludes                 \
33         Test/ms_run_test.sh                     \
34         Test/resources/MyResources.resources    \
35         Test/resources/Empty.resources          \
36         Test/resources/AFile.txt
37
38 CLEAN_FILES = $(cmplib) $(reslib) $(plattestlib) $(plattestlib).sources \
39                $(cmp_response) $(cmp_makefrag) \
40                $(res_response) $(res_makefrag) \
41                $(cmppdb) $(respdb) $(plattestpdb)
42
43 # If building on a non mono-native platform, default
44 # to running the unit tests on its corlib, to see if
45 # our tests are complaint with their (hopefully bug-free)
46 # corlib. If on a mono-native platform, test our actual
47 # corlib.
48 #
49 # You can access either one on demand with either 'make
50 # run-monotest' or 'make run-plattest'.
51
52 plattestlib = corlib_plattest.dll
53 plattestpdb = $(patsubst %.dll,%.pdb,$(plattestlib))
54 $(plattestlib).sources: corlib_test.dll.sources $(plattestlib).excludes
55         sort corlib_test.dll.sources $(plattestlib).excludes | uniq -u >$@
56
57 TEST_MCS_FLAGS = -debug+ -debug:full -nowarn:168,219,618,672 -unsafe
58
59 ifndef PLATFORM_MONO_NATIVE
60 test_lib = $(plattestlib)
61 test_against = $(PLATFORM_CORLIB)
62 HAVE_CS_TESTS = $(plattestlib).sources
63
64 ## for now, compiling the testsuite with CSC causes CS0583.  So compile with internal MCS
65 TEST_COMPILE = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_MCS) $(USE_MCS_FLAGS)
66 endif
67
68 include ../../build/library.make
69
70 ifndef PLATFORM_MONO_NATIVE
71 run-monotest:
72         $(MAKE) $(reslib)
73         $(MAKE) test_lib=corlib_test.dll test_against=$(reslib) run-test
74
75 run-plattest:
76         $(MAKE) test_lib=$(plattestlib) test_against='$(PLATFORM_CORLIB)' run-test
77
78 else
79 run-monotest: run-test
80 endif
81
82 # corlib_cmp
83 cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
84 cmppdb = $(cmplib:.dll=.pdb)
85 cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response
86 cmp_makefrag = $(depsdir)/$(PROFILE)_corlib_cmp.dll.makefrag
87 cmp_flags = -r:$(PLATFORM_CORLIB) $(corlib_flags)
88
89 $(cmplib): $(cmp_makefrag) $(cmp_response)
90         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(cmp_flags) -target:library -out:$@ @$(cmp_response)
91
92 $(cmp_response): $(sourcefile) corlib_cmp.dll.excludes
93         @echo Creating $@ ...
94         @sort $(sourcefile) corlib_cmp.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
95
96 $(cmp_makefrag): $(cmp_response)
97         @echo Creating $@ ...
98         @sed 's,^,$(cmplib): ,' $< >$@
99
100 # Since we make corlib_cmp on demand, there isn't a real need
101 # to have full dep tracking for it. Also, the generation of this
102 # file is busted on Win32 ('sort' seems to mess up line endings),
103 # leading to a broken build.
104 #
105 # -include $(cmp_makefrag)
106
107 # corlib_res
108 reslib = $(topdir)/class/lib/$(PROFILE)/corlib_res.dll
109 respdb = $(reslib:.dll=.pdb)
110 res_response = $(depsdir)/$(PROFILE)_corlib_res.dll.response
111 res_makefrag = $(depsdir)/$(PROFILE)_corlib_res.dll.makefrag
112 res_flags = -r:$(PLATFORM_CORLIB) $(corlib_flags)
113
114 $(reslib): $(res_makefrag) $(res_response)
115         $(BOOT_COMPILE) $(LIBRARY_FLAGS) $(res_flags) -target:library -out:$@ @$(res_response)
116
117 $(res_response): $(sourcefile) corlib_res.dll.excludes
118         @echo Creating $@ ...
119         @sort $(sourcefile) corlib_res.dll.excludes | uniq -u | $(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
120
121 # warning: embedded tab in the 'echo touch' line
122 $(res_makefrag): $(res_response)
123         @echo Creating $@ ...
124         @sed 's,^,$(reslib): ,' $< >$@
125
126 -include $(res_makefrag)