headers.sh 512 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. # Run headers_$1 command for all suitable architectures
  4. # Stop on error
  5. set -e
  6. do_command()
  7. {
  8. if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
  9. make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
  10. else
  11. printf "Ignoring arch: %s\n" ${arch}
  12. fi
  13. }
  14. archs=${HDR_ARCH_LIST:-$(ls ${srctree}/arch)}
  15. for arch in ${archs}; do
  16. case ${arch} in
  17. um) # no userspace export
  18. ;;
  19. *)
  20. if [ -d ${srctree}/arch/${arch} ]; then
  21. do_command $1 ${arch}
  22. fi
  23. ;;
  24. esac
  25. done