-# Copyright(c) 2017 Intel Corporation
-
-driver_classes = ['bus', 'crypto', 'event', 'mempool', 'net']
-
-foreach class:driver_classes
+# Copyright(c) 2017-2019 Intel Corporation
+
+# Defines the order of dependencies evaluation
+subdirs = [
+ 'common',
+ 'bus',
+ 'common/mlx5', # depends on bus.
+ 'common/qat', # depends on bus.
+ 'common/sfc_efx', # depends on bus.
+ 'mempool', # depends on common and bus.
+ 'net', # depends on common, bus, mempool
+ 'raw', # depends on common, bus and net.
+ 'crypto', # depends on common, bus and mempool (net in future).
+ 'compress', # depends on common, bus, mempool.
+ 'regex', # depends on common, bus, regexdev.
+ 'vdpa', # depends on common, bus and mempool.
+ 'event', # depends on common, bus, mempool and net.
+ 'baseband', # depends on common and bus.
+]
+
+disabled_drivers = run_command(list_dir_globs, get_option('disable_drivers'),
+ ).stdout().split()
+
+default_cflags = machine_args
+default_cflags += ['-DALLOW_EXPERIMENTAL_API']
+default_cflags += ['-DALLOW_INTERNAL_API']
+
+if cc.has_argument('-Wno-format-truncation')
+ default_cflags += '-Wno-format-truncation'
+endif
+
+foreach subpath:subdirs