From edecfb34f96867472d27f6985c69435bb5573754 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 9 Jan 2017 11:35:30 +0100 Subject: [PATCH] Allow dependencies to override the make target at compilation and install. This allow UUID dependency to just override the target instead of overwrite the all function. --- kiwix-build.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/kiwix-build.py b/kiwix-build.py index 29c78e8..58c9ed3 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -285,6 +285,8 @@ class MakeMixin: install_option = "" configure_script = "./configure" configure_env = None + make_target = "" + make_install_target = "install" @command("configure") def _configure(self, context): @@ -311,13 +313,19 @@ class MakeMixin: @command("compile") def _compile(self, context): context.try_skip(self.source_path) - command = "make -j4 " + self.make_option + command = "make -j4 {make_target} {make_option}".format( + make_target = self.make_target, + make_option = self.make_option + ) self.buildEnv.run_command(command, self.source_path, context) @command("install") def _install(self, context): context.try_skip(self.source_path) - command = "make install " + self.make_option + command = "make {make_install_target} {make_option}".format( + make_install_target = self.make_install_target, + make_option = self.make_option + ) self.buildEnv.run_command(command, self.source_path, context) def build(self): @@ -425,18 +433,8 @@ class UUID(Dependency, ReleaseDownloadMixin, MakeMixin): source_dir = extract_dir = 'e2fsprogs-1.42' configure_option = "--enable-libuuid" configure_env = {'_format_CFLAGS' : "{env.CFLAGS} -fPIC"} - - @command("compile") - def _compile(self, context): - context.try_skip(self.source_path) - command = "make -j4 libs " + self.make_option - self.buildEnv.run_command(command, self.source_path, context) - - @command("install") - def _install(self, context): - context.try_skip(self.source_path) - command = "make install-libs " + self.make_option - self.buildEnv.run_command(command, self.source_path, context) + make_target = 'libs' + make_install_target = 'install-libs' class Xapian(Dependency, ReleaseDownloadMixin, MakeMixin):