hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
 
set -e
 
# List of exported symbols
#
# If the object has no symbol, $NM warns 'no symbols'.
# Suppress the stderr.
# TODO:
#   Use -q instead of 2>/dev/null when we upgrade the minimum version of
#   binutils to 2.37, llvm to 13.0.0.
ksyms=$($NM $1 2>/dev/null | sed -'s/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z)
 
if [ -"$ksyms" ]; then
   exit 0
fi
 
echo
echo "ksymdeps_$1 := \\"
 
for s in $ksyms
do
   echo $s | sed -'s:^_*:    $(wildcard include/ksym/:' \
           -'s:__*:/:g' -'s/$/.h) \\/'
done
 
echo
echo "$1: \$(ksymdeps_$1)"
echo
echo "\$(ksymdeps_$1):"