2018-11-30 01:05:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# List of exported symbols
|
2021-08-19 00:01:14 +00:00
|
|
|
#
|
|
|
|
# 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.
|
2021-08-30 08:20:33 +00:00
|
|
|
ksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p')
|
2018-11-30 01:05:26 +00:00
|
|
|
|
|
|
|
if [ -z "$ksyms" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "ksymdeps_$1 := \\"
|
|
|
|
|
|
|
|
for s in $ksyms
|
|
|
|
do
|
2021-08-30 08:20:33 +00:00
|
|
|
printf ' $(wildcard include/ksym/%s) \\\n' "$s"
|
2018-11-30 01:05:26 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "$1: \$(ksymdeps_$1)"
|
|
|
|
echo
|
|
|
|
echo "\$(ksymdeps_$1):"
|