headers.sh 608 B

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