162306a36Sopenharmony_ci#!/bin/sh
262306a36Sopenharmony_ci
362306a36Sopenharmony_ciset -e
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci# When you move, remove or rename generated files, you probably also update
662306a36Sopenharmony_ci# .gitignore and cleaning rules in the Makefile. This is the right thing
762306a36Sopenharmony_ci# to do. However, people usually do 'git pull', 'git bisect', etc. without
862306a36Sopenharmony_ci# running 'make clean'. Then, the stale generated files are left over, often
962306a36Sopenharmony_ci# causing build issues.
1062306a36Sopenharmony_ci#
1162306a36Sopenharmony_ci# Also, 'git status' shows such stale build artifacts as untracked files.
1262306a36Sopenharmony_ci# What is worse, some people send a wrong patch to get them back to .gitignore
1362306a36Sopenharmony_ci# without checking the commit history.
1462306a36Sopenharmony_ci#
1562306a36Sopenharmony_ci# So, when you (re)move generated files, please move the cleaning rules from
1662306a36Sopenharmony_ci# the Makefile to this script. This is run before Kbuild starts building
1762306a36Sopenharmony_ci# anything, so people will not be annoyed by such garbage files.
1862306a36Sopenharmony_ci#
1962306a36Sopenharmony_ci# This script is not intended to grow endlessly. Rather, it is a temporary scrap
2062306a36Sopenharmony_ci# yard. Stale files stay in this file for a while (for some release cycles?),
2162306a36Sopenharmony_ci# then will be really dead and removed from the code base entirely.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cirm -f arch/powerpc/purgatory/kexec-purgatory.c
2462306a36Sopenharmony_cirm -f arch/riscv/purgatory/kexec-purgatory.c
2562306a36Sopenharmony_cirm -f arch/x86/purgatory/kexec-purgatory.c
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_cirm -f scripts/extract-cert
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_cirm -f scripts/kconfig/[gmnq]conf-cfg
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_cirm -f rust/target.json
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_cirm -f scripts/bin2c
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_cirm -f .scmversion
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_cirm -rf include/ksym
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_cifind . -name '*.usyms' | xargs rm -f
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_cirm -f binkernel.spec
42