From e22916e94de6a1c46e3d181208a0d30d6cc16574 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 8 Nov 2013 11:42:12 +0100 Subject: [PATCH] Add --make option --- README.md | 6 +++++- novaboot | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8e223c6..6c3874b 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,10 @@ scripts. Finally, binaries can be generated in this phases by running Specifies text _preable_ that is put at the begiging of the entry GRUB2 entry. +- \-m, --make\[=make command\] + + Runs `make` to build files that are not generated by novaboot itself. + - \--name=_string_ Use the name _string_ instead of the name of the novaboot script. @@ -224,7 +228,7 @@ scripts. Finally, binaries can be generated in this phases by running - \--scons\[=scons command\] - Runs _scons_ to build files that are not generated by novaboot + Runs `scons` to build files that are not generated by novaboot itself. - \--gen-only diff --git a/novaboot b/novaboot index 14b8753..d22ac85 100755 --- a/novaboot +++ b/novaboot @@ -51,6 +51,7 @@ $CFG::qemu = 'qemu -cpu coreduo -smp 2'; ); chomp(my $nproc = `nproc`); $CFG::scons = "scons -j$nproc"; +$CFG::make = "make -j$nproc"; my $builddir; @@ -92,7 +93,7 @@ read_config($_) foreach $cfg or reverse @cfgs; ## Command line handling -my ($append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $iprelay, $iso_image, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $uboot, $uboot_init); +my ($append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $iprelay, $iso_image, $make, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $uboot, $uboot_init); $rsync_flags = ''; $rom_prefix = 'rom://'; @@ -118,6 +119,7 @@ my %opt_spec; "iprelay=s" => \$iprelay, "iso|i:s" => \$iso_image, "name=s" => \$config_name_opt, + "make|m:s" => \$make, "no-file-gen" => \$no_file_gen, "off" => \$off_opt, "on" => \$on_opt, @@ -539,12 +541,14 @@ foreach my $script (@scripts) { push @bootloader_configs, generate_grub2_config($grub2_config, $config_name, $prefix, $modules, $grub_preamble, $grub2_prolog) if (defined $grub2_config); push @bootloader_configs, generate_pulsar_config('config-'.($pulsar||'novaboot'), $modules) if (defined $pulsar); -### Run scons - if (defined $scons) { +### Run scons or make + { my @files = map({ ($file) = m/([^ ]*)/; $file; } @$modules); # Filter-out generated files my @to_build = grep({ my $file = $_; !scalar(grep($file eq $$_{filename}, @$generated)) } @files); - system_verbose($scons || $CFG::scons." ".join(" ", @to_build)); + + system_verbose($scons || $CFG::scons." ".join(" ", @to_build)) if (defined $scons); + system_verbose($make || $CFG::make ." ".join(" ", @to_build)) if (defined $make); } ### Copy files (using rsync) @@ -998,6 +1002,10 @@ i.e. run update-grub on Debian/Ubuntu. Specifies text I that is put at the begiging of the entry GRUB2 entry. +=item -m, --make[=make command] + +Runs C to build files that are not generated by novaboot itself. + =item --name=I Use the name I instead of the name of the novaboot script. @@ -1017,7 +1025,7 @@ I. =item --scons[=scons command] -Runs I to build files that are not generated by novaboot +Runs C to build files that are not generated by novaboot itself. =item --gen-only -- 2.39.2