Index: trunk/psLib/test/sys/Makefile.am
===================================================================
--- trunk/psLib/test/sys/Makefile.am	(revision 8731)
+++ trunk/psLib/test/sys/Makefile.am	(revision 8841)
@@ -10,7 +10,13 @@
 	$(PSLIB_LIBS)
 
+TEST_PROGS = \
+	tap_psStringSubstitute
 
-check_PROGRAMS = \
-	tap_psStringSubstitute
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+TESTS = $(TEST_PROGS)
 
 CLEANFILES = $(check_DATA) temp/* log.txt log2.txt test.fits tst_psTrace02_OUT \
