blob: e0f883eb39a2e197bac4da0d97d481361663934f [file] [log] [blame]
Sam Ravnborg2fb9b1b2008-06-21 00:24:17 +02001#!/bin/sh
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Sam Ravnborg2fb9b1b2008-06-21 00:24:17 +02003# Run headers_$1 command for all suitable architectures
4
5# Stop on error
6set -e
7
8do_command()
9{
10 if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then
11 make ARCH=$2 KBUILD_HEADERS=$1 headers_$1
Sam Ravnborg2fb9b1b2008-06-21 00:24:17 +020012 else
13 printf "Ignoring arch: %s\n" ${arch}
14 fi
15}
16
Kirill A. Shutemovf68203082010-12-13 19:10:28 +020017archs=${HDR_ARCH_LIST:-$(ls ${srctree}/arch)}
Sam Ravnborg2fb9b1b2008-06-21 00:24:17 +020018
19for arch in ${archs}; do
20 case ${arch} in
21 um) # no userspace export
22 ;;
Sam Ravnborg2fb9b1b2008-06-21 00:24:17 +020023 *)
24 if [ -d ${srctree}/arch/${arch} ]; then
25 do_command $1 ${arch}
26 fi
27 ;;
28 esac
29done