diff --git a/Makefile.in b/Makefile.in index 34519dc10..fb3b46590 100644 --- a/Makefile.in +++ b/Makefile.in @@ -98,7 +98,19 @@ check: all $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@ && ) true test -r check.conf || cp $(srcdir)/check.conf . driver/iverilog -B. -BPivlpp -tcheck -ocheck.vvp $(srcdir)/examples/hello.vl +ifeq (@WIN32@,yes) +ifeq (@install_suffix@,) vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World' +else + # On Windows if we have a suffix we must run the vvp part of + # the test with a suffix since it was built/linked that way. + ln vvp/vvp.exe vvp/vvp$(suffix).exe + vvp/vvp$(suffix) -M- -M./vpi ./check.vvp | grep 'Hello, World' + rm vvp/vvp$(suffix).exe +endif +else + vvp/vvp -M- -M./vpi ./check.vvp | grep 'Hello, World' +endif clean: $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@ && ) true diff --git a/vvp/Makefile.in b/vvp/Makefile.in index 7ca3b2fa8..5ae387af3 100644 --- a/vvp/Makefile.in +++ b/vvp/Makefile.in @@ -66,7 +66,19 @@ distclean: clean rm -f stamp-config-h config.h check: all +ifeq (@WIN32@,yes) +ifeq (@install_suffix@,) ./vvp -M../vpi $(srcdir)/examples/hello.vvp | grep 'Hello, World.' +else + # On Windows if we have a suffix we must run the vvp test with + # a suffix since it was built/linked that way. + ln vvp.exe vvp$(suffix).exe + ./vvp$(suffix) -M../vpi $(srcdir)/examples/hello.vvp | grep 'Hello, World.' + rm -f vvp$(suffix).exe +endif +else + ./vvp -M../vpi $(srcdir)/examples/hello.vvp | grep 'Hello, World.' +endif V = vpi_modules.o vpi_callback.o vpi_const.o vpi_event.o vpi_iter.o vpi_mcd.o \ vpi_priv.o vpi_scope.o vpi_real.o vpi_signal.o vpi_tasks.o vpi_time.o \ @@ -81,14 +93,18 @@ vthread.o schedule.o statistics.o tables.o udp.o vvp_island.o vvp_net.o \ vvp_net_sig.o event.o logic.o delay.o words.o island_tran.o $V ifeq (@WIN32@,yes) -# Under Windows (mingw) I need to make the ivl.exe in two steps. -# The first step makes an ivl.exe that dlltool can use to make an -# export and import library, and the last link makes a, ivl.exe +# Under Windows (mingw) I need to make the vvp.exe in two steps. +# The first step makes an vvp.exe that dlltool can use to make an +# export and import library, and the last link makes a, vvp.exe # that really exports the things that the import library imports. +# +# To get this to work correctly we must use the suffixed version of the +# executable to build the library. vvp@EXEEXT@ libvpi.a: $O $(srcdir)/vvp.def - $(CXX) -o vvp@EXEEXT@ $(LDFLAGS) $O $(dllib) $(LIBS) - dlltool --dllname vvp@EXEEXT@ --def $(srcdir)/vvp.def \ + $(CXX) -o vvp$(suffix)@EXEEXT@ $(LDFLAGS) $O $(dllib) $(LIBS) + dlltool --dllname vvp$(suffix)@EXEEXT@ --def $(srcdir)/vvp.def \ --output-lib libvpi.a --output-exp vvp.exp + rm -f vvp$(suffix)@EXEEXT@ $(CXX) $(LDFLAGS) -o vvp@EXEEXT@ vvp.exp $(LDFLAGS) $O $(dllib) $(LIBS) else libvpi.a: libvpi.c