diff --git a/scripts/makefile_helper b/scripts/makefile_helper new file mode 100755 index 0000000000..dfcf40dd16 --- /dev/null +++ b/scripts/makefile_helper @@ -0,0 +1,23 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv) + +set -e + +# If config/options can't be sourced, abort. PWD isn't the expected ROOT. +. config/options "" + +# task handling +case $1 in + --clean) + rm -rf "${BUILD_ROOT}/${BUILD_BASE}."*/* "${BUILD_ROOT}/${BUILD_BASE}."*/.stamps + ;; + --distclean) + rm -rf "${BUILD_ROOT}/.ccache" "${BUILD_ROOT}/${BUILD_BASE}."* + ;; + *) + echo "error: ${0}: unsupported option on CLI; aborting" + exit 1 + ;; +esac