2004-06-25 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / Microsoft.Web.Services / Makefile
1 thisdir = class/Microsoft.Web.Services
2 SUBDIRS = 
3 include ../../build/rules.make
4
5 LIBRARY = Microsoft.Web.Services.1.dll
6 LIB_MCS_FLAGS = /r:System.dll /r:System.Security.dll /r:System.Web.dll /r:System.Web.Services.dll /r:System.Xml.dll /r:System.Security.dll /r:Mono.Security.dll /d:WSE1
7 NO_TEST = yes
8
9 LIBRARY2 = Microsoft.Web.Services.2.dll
10 LIB_MCS_FLAGS2 = /r:System.dll /r:System.Security.dll /r:System.Web.dll /r:System.Web.Services.dll /r:System.Xml.dll /r:System.Security.dll /r:Mono.Security.dll /d:WSE2
11 NO_TEST2 = yes
12
13 # We are using a custom makefile to build both WSE1 and WSE2
14
15 sourcefile = Microsoft.Web.Services.dll.sources
16 sourcefile2 = Microsoft.Web.Services.dll.2.sources
17 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
18 response = $(depsdir)/$(LIBRARY).response
19 response2 = $(depsdir)/$(LIBRARY2).response
20 else
21 response = $(sourcefile)
22 response2 = $(sourcefile2)
23 endif
24 makefrag = $(depsdir)/$(LIBRARY).makefrag
25 makefrag2 = $(depsdir)/$(LIBRARY2).makefrag
26 stampfile = $(depsdir)/$(LIBRARY).stamp
27 stampfile2 = $(depsdir)/$(LIBRARY2).stamp
28 the_lib = $(topdir)/class/lib/$(LIBRARY)
29 the_lib2 = $(topdir)/class/lib/$(LIBRARY2)
30 the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
31 the_pdb2 = $(patsubst %.dll,%.pdb,$(the_lib2))
32
33 ifndef NO_TEST
34 test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
35 test_lib2 = $(patsubst %.dll, %_test.dll,$(LIBRARY2))
36 test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
37 test_pdb2 = $(patsubst %.dll,%.pdb,$(test_lib2))
38 test_sourcefile = $(test_lib).sources
39 test_sourcefile2 = $(test_lib2).sources
40 test_response = $(depsdir)/$(test_lib).response
41 test_response2 = $(depsdir)/Microsoft.Web.Services.2_test.dll.response
42 test_makefrag = $(depsdir)/$(test_lib).makefrag
43 test_makefrag2 = $(depsdir)/Microsoft.Web.Services.2_test.dll.makefrag
44 test_stampfile = $(depsdir)/$(test_lib).stamp
45 test_stampfile2 = $(depsdir)/Microsoft.Web.Services.2_test.dll.stamp
46 test_flags = /r:$(the_lib) /r:$(topdir)/class/lib/NUnit.Framework.dll $(TEST_MCS_FLAGS)
47 test_flags2 = /r:$(the_lib2) /r:$(topdir)/class/lib/NUnit.Framework.dll $(TEST_MCS_FLAGS)
48 endif
49
50 all-local: $(the_lib) $(the_lib2)
51
52 ifdef DEFAULT_WSE2
53 def_lib = $(the_lib2)
54 else
55 def_lib = $(the_lib)
56 endif
57
58 install-local: $(the_lib) $(the_lib2)
59         $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib
60         $(INSTALL_LIB) $(the_lib) $(DESTDIR)$(prefix)/lib
61         $(INSTALL_LIB) $(the_lib2) $(DESTDIR)$(prefix)/lib
62         $(INSTALL_LIB) $(def_lib) $(DESTDIR)$(prefix)/lib/Microsoft.Web.Services.dll
63
64 clean-local:
65         -rm -f $(the_lib) $(makefrag) $(test_lib) \
66                $(the_lib2) $(makefrag2) $(test_lib2) \
67                $(test_makefrag) $(test_response) \
68                $(test_makefrag2) $(test_response2) \
69                $(stampfile) $(test_stampfile) \
70                $(stampfile2) $(test_stampfile2) \
71                $(the_pdb) $(test_pdb) \
72                $(the_pdb2) $(test_pdb2) \
73                TestResult.xml
74 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
75         -rm -rf $(response) $(response2)
76 endif
77
78 ifndef NO_TEST
79 test-local: $(the_lib) $(test_lib) $(the_lib2) $(test_lib2) 
80
81 run-test-local:
82         $(TEST_RUNTIME) $(TEST_HARNESS) $(test_lib)
83
84 else
85 test-local: $(the_lib) $(the_lib2)
86
87 run-test-local:
88 endif
89
90 DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
91
92 ifdef NO_TEST
93 TEST_FILES = 
94 else
95 TEST_FILES = `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'`
96 TEST_FILES2 = `cat $(test_sourcefile2) |sed -e 's,^\(.\),Test/\1,'`
97 endif
98
99 dist-local: dist-default
100         for f in `cat $(sourcefile)` $(TEST_FILES) ; do \
101             dest=`dirname $(distdir)/$$f` ; \
102             $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
103         done
104         for f in `cat $sourcefile2)` $(TEST_FILES) ; do \
105             dest=`dirname $(distdir)/$$f` ; \
106             $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1; \
107         done
108
109 # Fun with dependency tracking
110
111 $(the_lib): $(makefrag) $(stampfile) $(response)
112         $(CSCOMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$(topdir)/class/lib/Microsoft.Web.Services.dll @$(response)
113         mv $(topdir)/class/lib/Microsoft.Web.Services.dll $(topdir)/class/lib/Microsoft.Web.Services.1.dll
114
115 # warning: embedded tab in the 'echo touch' line
116 $(makefrag): $(sourcefile)
117         @echo Creating $@ ...
118         @echo "HAVE_MAKEFRAG = yes" >$@.new
119         @echo "$(stampfile): \\" >>$@.new
120         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
121         @cat $@.new |sed -e '$$s, \\$$,,' >$@
122         @echo " touch \$$@" >>$@
123         @rm -rf $@.new
124
125 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
126 $(response): $(sourcefile)
127         @echo Creating $@ ...
128         @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
129 endif
130
131 -include $(makefrag)
132
133 ifndef HAVE_MAKEFRAG
134 $(stampfile):
135         touch $@
136 endif
137
138 $(the_lib2): $(makefrag2) $(stampfile2) $(response2)
139         $(CSCOMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS2) /target:library /out:$(topdir)/class/lib/Microsoft.Web.Services.dll @$(response2)
140         mv $(topdir)/class/lib/Microsoft.Web.Services.dll $(topdir)/class/lib/Microsoft.Web.Services.2.dll
141
142 # warning: embedded tab in the 'echo touch' line
143 $(makefrag2): $(sourcefile2)
144         @echo Creating $@ ...
145         @echo "HAVE_MAKEFRAG = yes" >$@.new
146         @echo "$(stampfile2): \\" >>$@.new
147         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
148         @cat $@.new |sed -e '$$s, \\$$,,' >$@
149         @echo " touch \$$@" >>$@
150         @rm -rf $@.new
151
152 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
153 $(response2): $(sourcefile2)
154         @echo Creating $@ ...
155         @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
156 endif
157
158 -include $(makefrag2)
159
160 ifndef HAVE_MAKEFRAG
161 $(stampfile2):
162         touch $@
163 endif
164
165 include ../../build/config.make
166
167 # for now, don't give any /lib flags or set MONO_PATH, since we
168 # give a full path to the assembly.
169
170 ifndef NO_TEST
171 $(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_stampfile)
172         $(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
173
174 $(test_response): $(test_sourcefile)
175         @echo Creating $@ ...
176 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
177         @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
178 else
179         @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
180 endif
181
182 # warning: embedded tab in the 'echo touch' line
183 $(test_makefrag): $(test_response)
184         @echo Creating $@ ...
185         @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
186         @echo "$(test_stampfile): \\" >>$@.new
187         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
188         @cat $@.new |sed -e '$$s, \\$$,,' >$@
189         @echo " touch \$$@" >>$@
190         @rm -rf $@.new
191
192 -include $(test_makefrag)
193 endif
194
195 ifndef HAVE_TEST_MAKEFRAG
196 $(test_stampfile):
197         touch $@
198 endif
199
200 ifndef NO_TEST
201 $(test_lib2): $(test_makefrag2) $(the_lib2) $(test_response2) $(test_stampfile2)
202         $(CSCOMPILE) /target:library /out:$@ $(test_flags2) @$(test_response2)
203
204 $(test_response2): $(test_sourcefile2)
205         @echo Creating $@ ...
206 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
207         @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
208 else
209         @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
210 endif
211
212
213 # warning: embedded tab in the 'echo touch' line
214 $(test_makefrag2): $(test_response2)
215         @echo Creating $@ ...
216         @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
217         @echo "$(test_stampfile2): \\" >>$@.new
218         @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
219         @cat $@.new |sed -e '$$s, \\$$,,' >$@
220         @echo " touch \$$@" >>$@
221         @rm -rf $@.new
222
223 -include $(test_makefrag2)
224 endif
225 #
226 ifndef HAVE_TEST_MAKEFRAG
227 $(test_stampfile2):
228         touch $@
229 endif