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