diff options
Diffstat (limited to 'kbuild.sh')
-rwxr-xr-x | kbuild.sh | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -36,6 +36,7 @@ do_package_deb=0 opt_bootloader= opt_cmdline_file= opt_defconfig= +opt_make_opts= while [[ $# != 0 ]] ; do option=$1 @@ -75,12 +76,19 @@ while [[ $# != 0 ]] ; do --doc) do_compile_doc=1 ;; + --) + platform=auto + ;; --*) echo "Unrecognized option $option" exit 1 ;; *) - platform=$option + if [[ -z "$platform" ]] ; then + platform=$option + else + opt_make_opts="$option $opt_make_opts" + fi ;; esac done @@ -91,7 +99,7 @@ done kcflags="-Werror -Wno-error=cpp" -if [[ -z "$platform" ]] ; then +if [[ -z "$platform" || "$platform" == "auto" ]] ; then for f in $kbuild_root/platforms/*.sh ; do pattern=$(cat $f | grep "dir_pattern=" | head -1) pattern=${pattern/#dir_pattern=/} @@ -146,8 +154,8 @@ esac # num_cpus=$(cat /proc/cpuinfo | grep '^processor\b' | wc -l) -make="make ARCH=$arch O=$output_dir CROSS_COMPILE=${cross_compile[$arch]}" -pmake="$make -j$((num_cpus*2))" +make="make ARCH=$arch O=$output_dir CROSS_COMPILE=${cross_compile[$arch]} ${extra_make_args}" +pmake="$make -j$((num_cpus*2)) $opt_make_opts" echo "Compiling for platform $platform with $num_cpus CPUs" |