[IMPROVE] Add top Kbuild
authorAlexander Aksenov <a.aksenov@samsung.com>
Mon, 9 Dec 2013 12:54:51 +0000 (16:54 +0400)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Wed, 11 Dec 2013 08:45:45 +0000 (08:45 +0000)
Now modules are built a bit faster

Change-Id: I12b5c97e426982a20dba9b1244b51554481225a6
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
Kbuild [new file with mode: 0644]
build.sh

diff --git a/Kbuild b/Kbuild
new file mode 100644 (file)
index 0000000..7deb5d8
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,13 @@
+EXTRA_CFLAGS := $(extra_cflags)
+
+obj-m := buffer/ \
+         driver/ \
+         writer/ \
+         kprobe/ \
+         ks_manager/ \
+         uprobe/ \
+         us_manager/ \
+         ks_features/ \
+         sampler/ \
+         energy/ \
+         parser/
index f11b7fd..de1fd2c 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -42,51 +42,8 @@ ln -s asm-${link_name} ${kprobe_arch_dir}/asm
 rm -f ${uprobe_arch_dir}/asm
 ln -s asm-${link_name} ${uprobe_arch_dir}/asm
 
-buffer_module_name=swap_buffer.ko
-buffer_inc=${modules_inc}
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${buffer_dir} \
-       extra_cflags="-Werror" modules || exit 1
-
-driver_module_name=swap_driver.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${driver_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-writer_module_name=swap_writer.ko
-writer_inc=${modules_inc}
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${writer_dir} \
-       extra_cflags="-Werror -I${modules_dir} -I${kprobe_dir} -I${kprobe_arch_dir} -I${uprobe_arch_dir}" modules || exit 1
-
-kprobe_module_name=swap_kprobe.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${kprobe_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-ks_manager_module_name=swap_ks_manager.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${ks_manager_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-uprobe_module_name=swap_uprobe.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${uprobe_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-us_manager_module_name=swap_us_manager.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${us_manager_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-ks_features_module_name=swap_ks_features.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${ks_features_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-sampler_module_name=swap_sampler.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${sampler_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-energy_module_name=swap_energy.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${energy_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
-
-parser_module_name=swap_message_parser.ko
-make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} M=${parser_dir} \
-       extra_cflags="-Werror -I${modules_dir}" modules || exit 1
+make CROSS_COMPILE=${cross_compile} ARCH=${arch} -C ${kernel_dir} \
+       M=${modules_dir} extra_cflags="-Werror -I${modules_dir}" modules || exit 1
 
 modules=\
 "${buffer_dir}/${buffer_module_name} \