@@ -349,6 +349,10 @@ setup_env() { local mode
349
349
export KBUILD_OUTPUT=" ${VIRTME_BUILD_DIR} "
350
350
export KCONFIG_CONFIG=" ${VIRTME_KCONFIG} "
351
351
352
+ if [ " ${INPUT_CLEAN} " = 1 ]; then
353
+ rm -rf " ${VIRTME_BUILD_DIR} " " ${VIRTME_PERF_DIR} "
354
+ fi
355
+
352
356
mkdir -p \
353
357
" ${VIRTME_BUILD_DIR} " \
354
358
" ${VIRTME_SCRIPTS_DIR} " \
@@ -1873,11 +1877,12 @@ usage() {
1873
1877
echo
1874
1878
echo " - KConfig: optional kernel config: arguments for './scripts/config' or config file"
1875
1879
echo
1876
- echo " Usage: ${0} <make [params] | make.cross [params] | build <mode> | defconfig <mode> | selftests | bpftests | cmd <command> | src <source file> | static | vm-manual | vm-auto | connect | lcov2html>"
1880
+ echo " Usage: ${0} <make [params] | make.cross [params] | build <mode> | clean <mode> | defconfig <mode> | selftests | bpftests | cmd <command> | src <source file> | static | vm-manual | vm-auto | connect | lcov2html>"
1877
1881
echo
1878
1882
echo " - make: run the make command with optional parameters"
1879
1883
echo " - make.cross: run Intel's make.cross command with optional parameters"
1880
1884
echo " - build: build everything, but don't start the VM ('normal' mode by default)"
1885
+ echo " - clean: clean the build directory"
1881
1886
echo " - defconfig: only generate the .config file ('normal' mode by default)"
1882
1887
echo " - selftests: only build the KSelftests"
1883
1888
echo " - bpftests: only build the BPF tests"
@@ -1969,6 +1974,10 @@ case "${INPUT_MODE}" in
1969
1974
" build" )
1970
1975
prepare_all manual " ${@:- normal} "
1971
1976
;;
1977
+ " clean" )
1978
+ setup_env " ${@:- normal} "
1979
+ rm -r " ${VIRTME_BUILD_DIR} "
1980
+ ;;
1972
1981
" defconfig" )
1973
1982
setup_env " ${@:- normal} "
1974
1983
gen_kconfig " ${@:- normal} "
0 commit comments