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