mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-17 18:34:57 +02:00
trees: don't abuse the mode variable on -f
The "mode" variable is used as a suffix for make commands, for example ./mk -m sets mode to "menuconfig", which means you want to run "make menuconfig". When fetching sources (./mk -f), I was setting mode to "fetch", and putting checks in code to avoid use of make when mode was set to "fetch". The behaviour now is identical, except that a new variable called "do_make" is set to "n" when doing ./mk -f, otherwise set to "y", and this is checked instead. This should make the meaning of the code somewhat clearer. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
+7
-3
@@ -17,6 +17,10 @@ eval "`setvars "" xarch srcdir premake gnatdir xlang mode makeargs elfdir cmd \
|
|||||||
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
|
defconfig postmake mkhelpercfg dry dest_dir mdir cleanargs gccver gccfull \
|
||||||
gnatver gnatfull gccdir cmakedir`"; badhash="n"
|
gnatver gnatfull gccdir cmakedir`"; badhash="n"
|
||||||
|
|
||||||
|
# ./mk -f will set this to "n", thus
|
||||||
|
# disabling the use of make commands
|
||||||
|
do_make="y"
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
while getopts f:b:m:u:c:x:s:l:n:d: option; do
|
while getopts f:b:m:u:c:x:s:l:n:d: option; do
|
||||||
@@ -30,7 +34,7 @@ main()
|
|||||||
-m) mode="menuconfig" ;;
|
-m) mode="menuconfig" ;;
|
||||||
-c) mode="distclean" ;;
|
-c) mode="distclean" ;;
|
||||||
-x) mode="crossgcc-clean" ;;
|
-x) mode="crossgcc-clean" ;;
|
||||||
-f) mode="fetch" ;;
|
-f) do_make="n" ;;
|
||||||
-s) mode="savedefconfig" ;;
|
-s) mode="savedefconfig" ;;
|
||||||
-l) mode="olddefconfig" ;;
|
-l) mode="olddefconfig" ;;
|
||||||
-n) mode="nconfig" ;;
|
-n) mode="nconfig" ;;
|
||||||
@@ -145,7 +149,7 @@ configure_project()
|
|||||||
|
|
||||||
[ "$_f" = "-d" ] && build_depend="" # dry run
|
[ "$_f" = "-d" ] && build_depend="" # dry run
|
||||||
[ "$cmd" = "build_project" ] && break
|
[ "$cmd" = "build_project" ] && break
|
||||||
[ "$mode" = "fetch" ] || break
|
[ "$do_make" = "y" ] && break
|
||||||
|
|
||||||
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
[ "${_tcfg%/*/target.cfg}" = "${_tcfg%"/$tree/target.cfg"}" ] \
|
||||||
&& break
|
&& break
|
||||||
@@ -159,7 +163,7 @@ configure_project()
|
|||||||
[ -n "$tree" ] && mdir="$mdir/$tree"
|
[ -n "$tree" ] && mdir="$mdir/$tree"
|
||||||
[ -f "CHANGELOG" ] || check_project_hashes
|
[ -f "CHANGELOG" ] || check_project_hashes
|
||||||
|
|
||||||
if [ "$mode" != "fetch" ]; then
|
if [ "$do_make" = "y" ]; then
|
||||||
x_ ./mk -f "$project" "$target"
|
x_ ./mk -f "$project" "$target"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user