-SUBDIRS = Bucket Debug DEM Math XGL zlib
+if ENABLE_AUDIO_SUPPORT
+AUDIO_DIRS = Audio
+else
+AUDIO_DIRS =
+endif
+
+if ENABLE_UNIX_SERIAL
+SERIAL_DIRS = Serial
+else
+SERIAL_DIRS =
+endif
+
+SUBDIRS = \
+ $(AUDIO_DIRS) \
+ Bucket \
+ Debug \
+ DEM \
+ Math \
+ Misc \
+ PUI \
+ $(SERIAL_DIRS) \
+ XGL\
+ zlib