Do away with stampfiles.
authorRaja R Harinath <harinath@hurrynot.org>
Wed, 9 Jun 2004 10:57:33 +0000 (10:57 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Wed, 9 Jun 2004 10:57:33 +0000 (10:57 -0000)
Introduce support for VB test cases.
* library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): New auto-detecting
defines.
(stampfile, test_stampfile): Remove.
(clean-local): Don't mention them.
(test-local, run-test-local, run-test-ondotnet-local):
Make unconditional.
($(makefrag), $(test_makefrag)): Simplify.
($(btest_lib)): New.  Support for VB testcases.

svn path=/trunk/mcs/; revision=29105

mcs/build/ChangeLog
mcs/build/library.make

index 92cd251b95bd77106e68f3028c28ea7560a43f35..43dc31d4b7f4522ff04cb39af99c9ed81c3b3473 100644 (file)
@@ -1,3 +1,16 @@
+2004-06-09  Raja R Harinath  <rharinath@novell.com>
+
+       Do away with stampfiles.
+       Introduce support for VB test cases.
+       * library.make (HAVE_CS_TESTS, HAVE_VB_TESTS): New auto-detecting
+       defines.
+       (stampfile, test_stampfile): Remove.
+       (clean-local): Don't mention them.
+       (test-local, run-test-local, run-test-ondotnet-local):
+       Make unconditional.
+       ($(makefrag), $(test_makefrag)): Simplify.
+       ($(btest_lib)): New.  Support for VB testcases.
+
 2004-06-09  Raja R Harinath  <rharinath@novell.com>
 
        Partial support for writing Visual Basic source files.
index e1ac2d1b12debac79ff14ae1684c5d0d5b09ecdb..1c5abd3464d34ff063da0f55cdcb95074f688690 100644 (file)
@@ -20,22 +20,33 @@ LIBRARY_NAME = $(LIBRARY)
 endif
 
 makefrag = $(depsdir)/$(PROFILE)_$(LIBRARY).makefrag
-stampfile = $(depsdir)/$(PROFILE)_$(LIBRARY).stamp
 the_lib = $(topdir)/class/lib/$(PROFILE)/$(LIBRARY_NAME)
 the_pdb = $(patsubst %.dll,%.pdb,$(the_lib))
 
 ifndef NO_TEST
+test_nunitfw = $(topdir)/class/lib/$(PROFILE)/nunit.framework.dll 
+test_nunitcore = $(topdir)/class/lib/$(PROFILE)/nunit.core.dll 
+test_nunitutil = $(topdir)/class/lib/$(PROFILE)/nunit.util.dll 
+test_nunit_dep = $(test_nunitfw) $(test_nunitcore) $(test_nunitutil)
+test_nunit_ref = -r:$(test_nunitfw) -r:$(test_nunitcore) -r:$(test_nunitutil)
+
 test_lib = $(patsubst %.dll,%_test.dll,$(LIBRARY))
 test_pdb = $(patsubst %.dll,%.pdb,$(test_lib))
 test_sourcefile = $(test_lib).sources
 test_response = $(depsdir)/$(PROFILE)_$(test_lib).response
 test_makefrag = $(depsdir)/$(PROFILE)_$(test_lib).makefrag
-test_stampfile = $(depsdir)/$(PROFILE)_$(test_lib).stamp
-test_nunitfw = $(topdir)/class/lib/$(PROFILE)/nunit.framework.dll 
-test_nunitcore = $(topdir)/class/lib/$(PROFILE)/nunit.core.dll 
-test_nunitutil = $(topdir)/class/lib/$(PROFILE)/nunit.util.dll 
-test_nunit_ref = -r:$(test_nunitfw) -r:$(test_nunitcore) -r:$(test_nunitutil)
 test_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MCS_FLAGS)
+
+btest_lib = $(patsubst %.dll,%_btest.dll,$(LIBRARY))
+btest_pdb = $(patsubst %.dll,%.pdb,$(btest_lib))
+btest_sourcefile = $(btest_lib).sources
+btest_response = $(depsdir)/$(btest_lib).response
+btest_makefrag = $(depsdir)/$(btest_lib).makefrag
+btest_flags = /r:$(the_lib) $(test_nunit_ref) $(TEST_MBAS_FLAGS)
+
+HAVE_CS_TESTS := $(wildcard $(test_sourcefile))
+HAVE_VB_TESTS := $(wildcard $(btest_sourcefile))
+
 endif
 
 gacutil = $(topdir)/tools/gacutil/gacutil.exe
@@ -49,29 +60,42 @@ endif
 all-local: $(the_lib)
 
 install-local: $(the_lib) $(gacutil)
-       $(RUNTIME)  $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
+       $(RUNTIME) $(gacutil) /i $(the_lib) /f /root $(DESTDIR)$(prefix)/lib /package $(PACKAGE)
 
 uninstall-local: $(gacutil)
-       $(RUNTIME)  $(gacutil) /u $$(basename $(the_lib) .dll) ; \
+       $(RUNTIME) $(gacutil) /u `echo $(LIBRARY_NAME) | sed 's,.dll$,,'`
 
 $(gacutil):
-       cd $(topdir)/tools/gacutil && $(MAKE) || exit 1 ;
+       cd $(topdir)/tools/gacutil && $(MAKE)
 
 clean-local:
        -rm -f $(the_lib) $(makefrag) $(test_lib) \
               $(test_makefrag) $(test_response) \
-              $(stampfile) $(test_stampfile) \
               $(the_pdb) $(test_pdb) $(CLEAN_FILES) \
               TestResult.xml
 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
        -rm -rf $(response)
 endif
 
+
+test-local: $(the_lib)
+       @:
+run-test-local:
+       @:
+run-test-ondotnet-local:
+       @:
+
 ifndef NO_TEST
-$(test_nunitfw):
-       (cd ${topdir}/nunit20 && make)
+$(test_nunit_dep): $(topdir)/build/deps/nunit.stamp
+       @if test -f $@; then :; else rm -f $<; $(MAKE) $<; fi
+$(topdir)/build/deps/nunit.stamp:
+       cd ${topdir}/nunit20 && $(MAKE)
+       echo "stamp" >$@
+endif
 
-test-local: $(test_nunitfw) $(the_lib) $(test_lib)
+ifdef HAVE_CS_TESTS
+
+test-local: $(test_lib)
 
 run-test-local: run-test-lib
 
@@ -82,20 +106,33 @@ run-test-ondotnet-local: run-test-ondotnet-lib
 
 run-test-ondotnet-lib: test-local
        $(TEST_HARNESS) $(test_lib)
+endif
 
-else
-test-local: $(the_lib)
+ifdef HAVE_VB_TESTS
+
+test-local: $(btest_lib)
+
+run-test-local: run-btest-lib
+
+run-btest-lib: test-local
+       $(TEST_RUNTIME) $(TEST_HARNESS) $(btest_lib)
+
+run-test-ondotnet-local: run-btest-ondotnet-lib
+
+run-btest-ondotnet-lib: test-local
+       $(TEST_HARNESS) $(btest_lib)
 
-run-test-local:
-run-test-ondotnet-local:
 endif
 
 DISTFILES = $(sourcefile) $(test_sourcefile) $(EXTRA_DISTFILES)
 
-ifdef NO_TEST
 TEST_FILES = 
-else
-TEST_FILES = `cat $(test_sourcefile) |sed -e 's,^\(.\),Test/\1,'`
+
+ifdef HAVE_CS_TESTS
+TEST_FILES += `sed 's,^,Test/,' $(test_sourcefile)`
+endif
+ifdef HAVE_VB_TESTS
+TEST_FILES += `sed 's,^,Test/,' $(btest_sourcefile)`
 endif
 
 dist-local: dist-default
@@ -110,62 +147,62 @@ endif
 
 # Fun with dependency tracking
 
-$(the_lib): $(makefrag) $(stampfile) $(response)
+$(the_lib): $(makefrag) $(response)
        $(LIBRARY_COMPILE) $(LIBRARY_FLAGS) $(LIB_MCS_FLAGS) /target:library /out:$@ @$(response)
 
-# warning: embedded tab in the 'echo touch' line
 $(makefrag): $(sourcefile)
        @echo Creating $@ ...
-       @echo "HAVE_MAKEFRAG = yes" >$@.new
-       @echo "$(stampfile): \\" >>$@.new
-       @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
-       @cat $@.new |sed -e '$$s, \\$$,,' >$@
-       @echo " touch \$$@" >>$@
-       @rm -rf $@.new
+       @sed 's,^,$(the_lib): ,' $< >$@
 
 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
 $(response): $(sourcefile)
        @echo Creating $@ ...
-       @cat $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
+       @$(PLATFORM_CHANGE_SEPARATOR_CMD) $(sourcefile) >$@
 endif
 
 -include $(makefrag)
 
-ifndef HAVE_MAKEFRAG
-$(stampfile):
-       touch $@
-endif
-
 # for now, don't give any /lib flags or set MONO_PATH, since we
 # give a full path to the assembly.
 
-ifndef NO_TEST
-$(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_stampfile)
+ifdef HAVE_CS_TESTS
+
+$(test_lib): $(test_makefrag) $(the_lib) $(test_response) $(test_nunit_dep)
        $(CSCOMPILE) /target:library /out:$@ $(test_flags) @$(test_response)
 
 $(test_response): $(test_sourcefile)
        @echo Creating $@ ...
 ifdef PLATFORM_CHANGE_SEPARATOR_CMD
-       @cat $< |sed -e 's,^\(.\),Test/\1,' |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
+       @sed 's,^,Test/,' $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
 else
-       @cat $< |sed -e 's,^\(.\),Test/\1,' >$@
+       @sed 's,^,Test/,' $< >$@
 endif
 
-# warning: embedded tab in the 'echo touch' line
 $(test_makefrag): $(test_response)
        @echo Creating $@ ...
-       @echo "HAVE_TEST_MAKEFRAG = yes" >$@.new
-       @echo "$(test_stampfile): \\" >>$@.new
-       @cat $< |sed -e 's,\.cs[ \t]*$$,\.cs \\,' >>$@.new
-       @cat $@.new |sed -e '$$s, \\$$,,' >$@
-       @echo " touch \$$@" >>$@
-       @rm -rf $@.new
+       @sed 's,^,$(test_lib): ,' $< >$@
 
 -include $(test_makefrag)
+
 endif
 
-ifndef HAVE_TEST_MAKEFRAG
-$(test_stampfile):
-       touch $@
+ifdef HAVE_VB_TESTS
+
+$(btest_lib): $(btest_makefrag) $(the_lib) $(btest_response) $(test_nunit_dep)
+       $(BASCOMPILE) /target:library /out:$@ $(btest_flags) @$(btest_response)
+
+$(btest_response): $(btest_sourcefile)
+       @echo Creating $@ ...
+ifdef PLATFORM_CHANGE_SEPARATOR_CMD
+       @sed 's,^,Test/,' $< |$(PLATFORM_CHANGE_SEPARATOR_CMD) >$@
+else
+       @sed 's,^,Test/,' $< >$@
 endif
 
+$(btest_makefrag): $(btest_response)
+       @echo Creating $@ ...
+       @sed 's,^,$(btest_lib): ,' $< >$@
+
+-include $(btest_makefrag)
+
+endif