aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_ksymdeps.sh
blob: 1324986e1362c594ee48bc7da8f13828d5179ca8 (plain)
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
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

set -e

# List of exported symbols
ksyms=$($NM $1 | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z)

if [ -z "$ksyms" ]; then
	exit 0
fi

echo
echo "ksymdeps_$1 := \\"

for s in $ksyms
do
	echo $s | sed -e 's:^_*:    $(wildcard include/ksym/:' \
			-e 's:__*:/:g' -e 's/$/.h) \\/'
done

echo
echo "$1: \$(ksymdeps_$1)"
echo
echo "\$(ksymdeps_$1):"