Index: trunk/psModules/test/detrend/Makefile.am
===================================================================
--- trunk/psModules/test/detrend/Makefile.am	(revision 9877)
+++ trunk/psModules/test/detrend/Makefile.am	(revision 13644)
@@ -1,3 +1,2 @@
-
 AM_CPPFLAGS = \
 	$(SRCINC) \
@@ -12,7 +11,16 @@
 	$(PSMODULES_LIBS)
 
-check_PROGRAMS = tap_pmShutterCorrection
+TEST_PROGS = \
+	tap_pmShutterCorrection
 
-CLEANFILES = temp/* core core.* *~
+if BUILD_TESTS
+bin_PROGRAMS = $(TEST_PROGS)
+TESTS = $(TEST_PROGS)
+else
+check_PROGRAMS = $(TEST_PROGS)
+endif
+
+CLEANFILES = $(check_DATA) temp/* core core.* *~ *.bb *.bbg *.da gmon.out
 
 test: check
+	$(top_srcdir)/test/test.pl
