-# This directory depends on an x86 computer, so if nasm is present, we're good
-# complain to hadess@hadess.net
-if HAVE_NASM
-NASMDEP_DIR=bufspeed memchunk
+EXTRA_DIST = README
+
+# Build misc unless both --disable-examples and --disable-benchmarks were passed
+
+if BUILD_BENCHMARKS
+SUBDIRS_BENCHMARKS = benchmarks
+SUBDIRS_MISC = misc
else
-NASMDEP_DIR=
+SUBDIRS_BENCHMARKS =
endif
-SUBDIRS = $(NASMDEP_DIR) muxing sched
+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
-noinst_PROGRAMS = lat
+if BUILD_EXAMPLES
+SUBDIRS_EXAMPLES = examples
+SUBDIRS_MISC = misc
+else
+SUBDIRS_EXAMPLES =
+endif
-lat_CFLAGS = $(GST_CFLAGS)
-lat_LDFLAGS = $(GST_LIBS)
+SUBDIRS = \
+ $(SUBDIRS_BENCHMARKS) \
+ $(SUBDIRS_CHECK) \
+ $(SUBDIRS_MISC) \
+ $(SUBDIRS_TESTS) \
+ $(SUBDIRS_EXAMPLES)
-EXTRA_DIST = README
+# These are all the possible subdirs
+DIST_SUBDIRS = \
+ benchmarks \
+ check \
+ examples \
+ misc