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