-tests/chardata.o: tests/chardata.c tests/chardata.h
-tests/runtests.o: tests/runtests.c tests/chardata.h
-tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY)
- $(LINK_EXE) $^ -lcheck
+tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h
+tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h
+tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h
+tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
+ $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
+tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
+tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
+ $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
+
+tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c
+tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
+ $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
+
+run-benchmark: tests/benchmark/benchmark
+ tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3