+EXTRA_DIST = README
-SUBDIRS = memchunk muxing sched threadstate seeking # bufspeed
+if BUILD_BENCHMARKS
+SUBDIRS_BENCHMARKS = benchmarks
+else
+SUBDIRS_BENCHMARKS =
+endif
-noinst_PROGRAMS = lat
+if BUILD_TESTS
+## SUBDIRS_TESTS = tests testsuite
+## FIXME: write tests from scratch
+SUBDIRS_TESTS =
+if HAVE_CHECK
+SUBDIRS_CHECK = check
+else
+SUBDIRS_CHECK =
+endif
+else
+SUBDIRS_TESTS =
+SUBDIRS_CHECK =
+endif
-lat_CFLAGS = $(GST_CFLAGS)
-lat_LDFLAGS = $(GST_LIBS)
+if BUILD_EXAMPLES
+SUBDIRS_EXAMPLES = examples
+else
+SUBDIRS_EXAMPLES =
+endif
-EXTRA_DIST = README
-DIST_SUBDIRS= bufspeed memchunk muxing sched threadstate seeking
+SUBDIRS = \
+ $(SUBDIRS_BENCHMARKS) \
+ $(SUBDIRS_CHECK) \
+ misc \
+ $(SUBDIRS_TESTS) \
+ $(SUBDIRS_EXAMPLES)
+
+# These are all the possible subdirs
+DIST_SUBDIRS = \
+ benchmarks \
+ check \
+ examples \
+ misc