summaryrefslogtreecommitdiff
path: root/resources/scripts/build/src/for
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-08-20 18:54:40 +0100
committerLeah Rowe <leah@libreboot.org>2023-08-20 18:58:32 +0100
commit023d6b69968b44e296caee308c173cb617b89497 (patch)
treea5a192a9105d3ee700f76b789b0b8aebefc51cd3 /resources/scripts/build/src/for
parentf893a29b2214e9b6ebab7640ee25add2c334b5b6 (diff)
unify build/clean into ./build release src
handle it all in the 1 script quite a few clean scripts are still present, so resources/scripts/build/clean/ still exists. 23 sloc reduction. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'resources/scripts/build/src/for')
-rwxr-xr-xresources/scripts/build/src/for25
1 files changed, 21 insertions, 4 deletions
diff --git a/resources/scripts/build/src/for b/resources/scripts/build/src/for
index b3e9ff8e..1b7c7483 100755
--- a/resources/scripts/build/src/for
+++ b/resources/scripts/build/src/for
@@ -21,14 +21,27 @@
[ "x${DEBUG+set}" = 'xset' ] && set -v
set -u -e
+mode=""
project=""
main()
{
- [ $# -lt 1 ] && err "project name not specified"
- project="${1}"
- shift 1
+ while getopts b:c: option
+ do
+ case "${1}" in
+ -b)
+ shift ;;
+ -c)
+ mode="distclean"
+ shift ;;
+ *)
+ err "Invalid option" ;;
+ esac
+ project="${OPTARG}"
+ shift
+ done
+ [ -z "${project}" ] && err "project name not specified"
[ "${project}" = "ich9utils" ] && project="util/ich9utils"
[ -d "${project}" ] || ./fetch "${project}" \
@@ -41,7 +54,11 @@ main()
cmake UEFIExtract/ || err "cannot cmake UEFIExtract"
)
fi
- make -C "${project}" || err "Cannot build project, ${project}"
+ [ ! -z "${mode}" ] || \
+ make -C "${project}" || err "'make' failed (${project})"
+ [ -z "${mode}" ] || \
+ make -C "${project}" distclean || make -C "${project}" clean \
+ || err "cannot clean project src, ${project}"
}
err()