blob: 8ee533f33659b1d904020b1c70ef13c249e41ea4 [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 Yamada52d83df2021-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.
Masahiro Yamadabc7cd2d2021-08-30 17:20:33 +090013ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p')
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
Masahiro Yamadabc7cd2d2021-08-30 17:20:33 +090024 printf ' $(wildcard include/ksym/%s) \\\n' "$s"
Masahiro Yamadabbda5ec2018-11-30 10:05:26 +090025done
26
27echo
28echo "$1: \$(ksymdeps_$1)"
29echo
30echo "\$(ksymdeps_$1):"