3 # The rules for building our class libraries.
5 # The NO_TEST stuff is not too pleasant but whatcha
8 # All the dep files now land in the same directory so we
9 # munge in the library name to keep the files from clashing.
11 sourcefile = $(LIBRARY).sources
12 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
13 response = $(depsdir)/$(PROFILE)_$(LIBRARY).response
15 response = $(sourcefile)
19 LIBRARY_NAME = $(LIBRARY)
22 makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
23 the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME)
24 the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
27 test_nunitfw = $(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
28 test_nunitcore = $(topdir)/class/lib/$(PROFILE)/nunit.core.dll
29 test_nunitutil = $(topdir)/class/lib/$(PROFILE)/nunit.util.dll
30 test_nunit_dep = $(test_nunitfw) $(test_nunitcore) $(test_nunitutil)
31 test_nunit_ref = -r:$(test_nunitfw) -r:$(test_nunitcore) -r:$(test_nunitutil)
33 test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
34 test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
35 test_sourcefile = $(test_lib).sources
36 test_response = $(depsdir)/$(PROFILE)_$(test_lib).response
37 test_makefrag = $(depsdir)/$(PROFILE)_$(test_lib).makefrag
38 test_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MCS_FLAGS)
40 btest_lib = $(patsubst %.dll,%_btest.dll,$(LIBRARY))
41 btest_pdb = $(patsubst %.dll,%.pdb,$(btest_lib))
42 btest_sourcefile = $(btest_lib).sources
43 btest_response = $(depsdir)/$(btest_lib).response
44 btest_makefrag = $(depsdir)/$(btest_lib).makefrag
45 btest_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MBAS_FLAGS)
47 HAVE_CS_TESTS := $(wildcard $(test_sourcefile))
48 HAVE_VB_TESTS := $(wildcard $(btest_sourcefile))
52 gacutil = $(topdir)/tools/gacutil/gacutil.exe
53 sn = $(topdir)/tools/security/sn.exe
57 ifeq ($(PROFILE), net_2_0)
61 ifndef NO_SIGN_ASSEMBLY
69 install-local: $(the_lib) $(gacutil) $(sign)
70 $(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
72 uninstall-local: $(gacutil)
73 $(RUNTIME) $(gacutil) /u `echo $(LIBRARY_NAME) | sed 's,.dll$,,'`
76 cd $(topdir)/tools/gacutil && $(MAKE)
79 cd $(topdir)/tools/security && $(MAKE) sn.exe || exit 1 ;
82 $(RUNTIME) $(sn) -q -R $(the_lib) $(topdir)/class/mono.snk
85 -rm -f $(the_lib) $(makefrag) $(test_lib) \
86 $(test_makefrag) $(test_response) \
87 $(the_pdb) $(test_pdb) $(CLEAN_FILES) \
89 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
94 test-local: $(the_lib)
98 run-test-ondotnet-local:
102 $(test_nunit_dep): $(topdir)/build/deps/nunit.stamp
103 @if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
104 $(topdir)/build/deps/nunit.stamp:
105 cd ${topdir}/nunit20 && $(MAKE)
111 test-local: $(test_lib)
113 run-test-local: run-test-lib
115 run-test-lib: test-local
116 $(TEST_RUNTIME) $(TEST_HARNESS) $(test_lib)
118 run-test-ondotnet-local: run-test-ondotnet-lib
120 run-test-ondotnet-lib: test-local
121 $(TEST_HARNESS) $(test_lib)
126 test-local: $(btest_lib)
128 run-test-local: run-btest-lib
130 run-btest-lib: test-local
131 $(TEST_RUNTIME) $(TEST_HARNESS) $(btest_lib)
133 run-test-ondotnet-local: run-btest-ondotnet-lib
135 run-btest-ondotnet-lib: test-local
136 $(TEST_HARNESS) $(btest_lib)
140 DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
145 TEST_FILES += `sed 's,^,Test/,' $(test_sourcefile)`
148 TEST_FILES += `sed 's,^,Test/,' $(btest_sourcefile)`
151 dist-local: dist-default
152 for f in `cat $(sourcefile)` $(TEST_FILES) ; do \
153 dest=`dirname $(distdir)/$$f` ; \
154 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
157 ifndef LIBRARY_COMPILE
158 LIBRARY_COMPILE = $(CSCOMPILE)
161 # Fun with dependency tracking
163 $(the_lib): $(makefrag) $(response)
164 $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response)
166 $(makefrag): $(sourcefile)
167 @echo Creating $@ ...
168 @sed 's,^,$(the_lib): ,' $< >$@
170 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
171 $(response): $(sourcefile)
172 @echo Creating $@ ...
173 @$(PLATFORM_CHANGE_SEPARATOR_CMD) $(sourcefile) >$@
178 # for now, don't give any /lib flags or set MONO_PATH, since we
179 # give a full path to the assembly.
183 $(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_nunit_dep)
184 $(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
186 $(test_response): $(test_sourcefile)
187 @echo Creating $@ ...
188 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
189 @sed 's,^,Test/,' $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
191 @sed 's,^,Test/,' $< >$@
194 $(test_makefrag): $(test_response)
195 @echo Creating $@ ...
196 @sed 's,^,$(test_lib): ,' $< >$@
198 -include $(test_makefrag)
204 $(btest_lib): $(btest_makefrag) $(the_lib) $(btest_response) $(test_nunit_dep)
205 $(BASCOMPILE) /target:library /out:$@ $(btest_flags) @$(btest_response)
207 $(btest_response): $(btest_sourcefile)
208 @echo Creating $@ ...
209 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
210 @sed 's,^,Test/,' $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
212 @sed 's,^,Test/,' $< >$@
215 $(btest_makefrag): $(btest_response)
216 @echo Creating $@ ...
217 @sed 's,^,$(btest_lib): ,' $< >$@
219 -include $(btest_makefrag)