#!/bin/sh # Run headers_$1 command for all suitable architectures # Stop on error set -e proc do_command { if test -f $(srctree)/arch/$2/include/asm/Kbuild { make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 } else { printf "Ignoring arch: %s\n" $(arch) } } global archs := $(HDR_ARCH_LIST:-$(ls ${srctree}/arch)) for arch in [$(archs)] { matchstr $(arch) { um { # no userspace export } * { if test -d $(srctree)/arch/$(arch) { do_command $1 $(arch) } } } } (CommandList children: [ (C {(set)} {(-e)}) (FuncDef name: do_command body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-f)} {(${ VSub_Name srctree) (/arch/) ($ VSub_Number "$2") (/include/asm/Kbuild)} {(Lit_Other "]")} ) terminator: ) ] action: [ (C {(make)} {(Lit_VarLike "ARCH=") ($ VSub_Number "$2")} {(Lit_VarLike "KBUILD_HEADERS=") ($ VSub_Number "$1")} {(headers_) ($ VSub_Number "$1")} ) ] spids: [-1 38] ) ] else_action: [ (C {(printf)} {(DQ ("Ignoring arch: %s") (EscapedLiteralPart token:))} {(${ VSub_Name arch)} ) ] spids: [53 68] ) ] spids: [19] ) spids: [15 18] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:archs) op: Equal rhs: { (BracedVarSub token: suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: { (CommandSubPart command_list: (CommandList children: [(C {(ls)} {(${ VSub_Name srctree) (/arch)})] ) left_token: spids: [77 84] ) } ) spids: [74 85] ) } spids: [73] ) ] spids: [73] ) (ForEach iter_name: arch iter_words: [{(${ VSub_Name archs)}] do_arg_iter: False body: (DoGroup children: [ (Case to_match: {(${ VSub_Name arch)} arms: [ (case_arm pat_list:[{(um)}] spids:[111112118-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(-d)} {(${ VSub_Name srctree) (/arch/) (${ VSub_Name arch)} {(Lit_Other "]")} ) terminator: ) ] action: [(C {(do_command)} {($ VSub_Number "$1")} {(${ VSub_Name arch)})] spids: [-1 142] ) ] spids: [-1 154] ) ] spids: [121 122 157 -1] ) ] spids: [102 108 160] ) ] spids: [99 162] ) spids: [93 97] ) ] )