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)
17 makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
18 stampfile = $(depsdir)/$(PROFILE)_$(LIBRARY).stamp
19 the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY)
20 the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
23 test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
24 test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
25 test_sourcefile = $(test_lib).sources
26 test_response = $(depsdir)/$(PROFILE)_$(test_lib).response
27 test_makefrag = $(depsdir)/$(PROFILE)_$(test_lib).makefrag
28 test_stampfile = $(depsdir)/$(PROFILE)_$(test_lib).stamp
29 test_flags = /r:$(the_lib) /r:$(topdir)/class/lib/$(PROFILE)/NUnit.Framework.dll $(TEST_MCS_FLAGS)
32 gacutil = $(topdir)/tools/gacutil/gacutil.exe
36 install-local: $(the_lib) $(gacutil)
37 @if test -f Assembly/AssemblyInfo.cs ; then \
38 $(RUNTIME) $(gacutil) /i $(the_lib) /f || exit 1 ; \
40 $(MKINSTALLDIRS) $(DESTDIR)$(prefix)/lib ; \
41 $(INSTALL_LIB) $(the_lib) $(DESTDIR)$(prefix)/lib ; \
44 uninstall-local: $(gacutil)
45 @if test -f Assembly/AssemblyInfo.cs ; then \
46 $(RUNTIME) $(gacutil) /u $$(basename $(the_lib) .dll) ; \
48 -rm -f $(DESTDIR)$(prefix)/lib/$(LIBRARY) ; \
52 cd $(topdir)/tools/gacutil && $(MAKE) || exit 1 ;
55 -rm -f $(the_lib) $(makefrag) $(test_lib) \
56 $(test_makefrag) $(test_response) \
57 $(stampfile) $(test_stampfile) \
58 $(the_pdb) $(test_pdb) \
60 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
65 test-local: $(the_lib) $(test_lib)
68 $(TEST_RUNTIME) $(TEST_HARNESS) $(test_lib)
71 test-local: $(the_lib)
76 DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
81 TEST_FILES = `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'`
84 dist-local: dist-default
85 for f in `cat $(sourcefile)` $(TEST_FILES) ; do \
86 dest=`dirname $(distdir)/$$f` ; \
87 $(MKINSTALLDIRS) $$dest && cp $$f $$dest || exit 1 ; \
90 # Fun with dependency tracking
92 $(the_lib): $(makefrag) $(stampfile) $(response)
93 $(CSCOMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response)
95 # warning: embedded tab in the 'echo touch' line
96 $(makefrag): $(sourcefile)
98 @echo "HAVE_MAKEFRAG = yes" >$@.new
99 @echo "$(stampfile): \\" >>$@.new
100 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
101 @cat $@.new |sed -e '$$s, \\$$,,' >$@
102 @echo " touch \$$@" >>$@
105 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
106 $(response): $(sourcefile)
107 @echo Creating $@ ...
108 @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
118 # for now, don't give any /lib flags or set MONO_PATH, since we
119 # give a full path to the assembly.
122 $(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_stampfile)
123 $(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
125 $(test_response): $(test_sourcefile)
126 @echo Creating $@ ...
127 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
128 @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
130 @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
133 # warning: embedded tab in the 'echo touch' line
134 $(test_makefrag): $(test_response)
135 @echo Creating $@ ...
136 @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
137 @echo "$(test_stampfile): \\" >>$@.new
138 @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
139 @cat $@.new |sed -e '$$s, \\$$,,' >$@
140 @echo " touch \$$@" >>$@
143 -include $(test_makefrag)
146 ifndef HAVE_TEST_MAKEFRAG