xref: /openbmc/linux/scripts/remove-stale-files (revision c83b16ce)
11476fee5SMasahiro Yamada#!/bin/sh
21476fee5SMasahiro Yamada
31476fee5SMasahiro Yamadaset -e
41476fee5SMasahiro Yamada
51476fee5SMasahiro Yamada# When you move, remove or rename generated files, you probably also update
61476fee5SMasahiro Yamada# .gitignore and cleaning rules in the Makefile. This is the right thing
71476fee5SMasahiro Yamada# to do. However, people usually do 'git pull', 'git bisect', etc. without
81476fee5SMasahiro Yamada# running 'make clean'. Then, the stale generated files are left over, often
91476fee5SMasahiro Yamada# causing build issues.
101476fee5SMasahiro Yamada#
111476fee5SMasahiro Yamada# Also, 'git status' shows such stale build artifacts as untracked files.
121476fee5SMasahiro Yamada# What is worse, some people send a wrong patch to get them back to .gitignore
131476fee5SMasahiro Yamada# without checking the commit history.
141476fee5SMasahiro Yamada#
151476fee5SMasahiro Yamada# So, when you (re)move generated files, please move the cleaning rules from
161476fee5SMasahiro Yamada# the Makefile to this script. This is run before Kbuild starts building
171476fee5SMasahiro Yamada# anything, so people will not be annoyed by such garbage files.
181476fee5SMasahiro Yamada#
191476fee5SMasahiro Yamada# This script is not intended to grow endlessly. Rather, it is a temporary scrap
201476fee5SMasahiro Yamada# yard. Stale files stay in this file for a while (for some release cycles?),
211476fee5SMasahiro Yamada# then will be really dead and removed from the code base entirely.
221476fee5SMasahiro Yamada
2392579713SMasahiro Yamadarm -f arch/powerpc/purgatory/kexec-purgatory.c
24d8357e3bSMasahiro Yamadarm -f arch/riscv/purgatory/kexec-purgatory.c
258f99eb85SMasahiro Yamadarm -f arch/x86/purgatory/kexec-purgatory.c
26d8357e3bSMasahiro Yamada
27340a0253SMasahiro Yamadarm -f scripts/extract-cert
282d17bd24SMasahiro Yamada
293122c844SMasahiro Yamadarm -f scripts/kconfig/[gmnq]conf-cfg
30*c83b16ceSMasahiro Yamada
31*c83b16ceSMasahiro Yamadarm -f rust/target.json
32