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 stampfile = $(depsdir)/$(PROFILE)_$(LIBRARY).stamp
24 the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME)
25 the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
28 test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
29 test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
30 test_sourcefile = $(test_lib).sources
31 test_response = $(depsdir)/$(PROFILE)_$(test_lib).response
32 test_makefrag = $(depsdir)/$(PROFILE)_$(test_lib).makefrag
33 test_stampfile = $(depsdir)/$(PROFILE)_$(test_lib).stamp
34 test_nunitfw = $(topdir)/class/lib/$(PROFILE)/nunit.framework.dll
35 test_nunitcore = $(topdir)/class/lib/$(PROFILE)/nunit.core.dll
36 test_nunitutil = $(topdir)/class/lib/$(PROFILE)/nunit.util.dll
37 test_nunit_ref = -r:$(test_nunitfw) -r:$(test_nunitcore) -r:$(test_nunitutil)
38 test_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MCS_FLAGS)
41 gacutil = $(topdir)/tools/gacutil/gacutil.exe
45 ifeq ($(PROFILE), net_2_0)
51 install-local: $(the_lib) $(gacutil)
52 $(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
54 uninstall-local: $(gacutil)
55 $(RUNTIME) $(gacutil) /u $$(basename $(the_lib) .dll) ; \
58 cd $(topdir)/tools/gacutil && $(MAKE) || exit 1 ;
61 -rm -f $(the_lib) $(makefrag) $(test_lib) \
62 $(test_makefrag) $(test_response) \
63 $(stampfile) $(test_stampfile) \
64 $(the_pdb) $(test_pdb) $(CLEAN_FILES) \
66 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
72 (cd ${topdir}/nunit20 && make)
74 test-local: $(test_nunitfw) $(the_lib) $(test_lib)
76 run-test-local: run-test-lib
78 run-test-lib: test-local
79 $(TEST_RUNTIME) $(TEST_HARNESS) $(test_lib)
81 run-test-ondotnet-local: run-test-ondotnet-lib
83 run-test-ondotnet-lib: test-local
84 $(TEST_HARNESS) $(test_lib)
87 test-local: $(the_lib)
90 run-test-ondotnet-local:
93 DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
98 TEST_FILES = `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'`
101 dist-local: dist-default
102 for f in `cat $(sourcefile)` $(TEST_FILES) ; do \
103 dest=`dirname $(distdir)/$$f` ; \
104 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
107 ifndef LIBRARY_COMPILE
108 LIBRARY_COMPILE = $(CSCOMPILE)
111 # Fun with dependency tracking
113 $(the_lib): $(makefrag) $(stampfile) $(response)
114 $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response)
116 # warning: embedded tab in the 'echo touch' line
117 $(makefrag): $(sourcefile)
118 @echo Creating $@ ...
119 @echo "HAVE_MAKEFRAG = yes" >$@.new
120 @echo "$(stampfile): \\" >>$@.new
121 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
122 @cat $@.new |sed -e '$$s, \\$$,,' >$@
123 @echo " touch \$$@" >>$@
126 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
127 $(response): $(sourcefile)
128 @echo Creating $@ ...
129 @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
139 # for now, don't give any /lib flags or set MONO_PATH, since we
140 # give a full path to the assembly.
143 $(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_stampfile)
144 $(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
146 $(test_response): $(test_sourcefile)
147 @echo Creating $@ ...
148 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
149 @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
151 @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
154 # warning: embedded tab in the 'echo touch' line
155 $(test_makefrag): $(test_response)
156 @echo Creating $@ ...
157 @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
158 @echo "$(test_stampfile): \\" >>$@.new
159 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
160 @cat $@.new |sed -e '$$s, \\$$,,' >$@
161 @echo " touch \$$@" >>$@
164 -include $(test_makefrag)
167 ifndef HAVE_TEST_MAKEFRAG