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>
This commit is contained in:
Leah Rowe
2023-08-20 18:54:40 +01:00
parent f893a29b22
commit 023d6b6996
12 changed files with 27 additions and 236 deletions
+21 -4
View File
@@ -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()