18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ciset -e 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci# List of exported symbols 78c2ecf20Sopenharmony_ci# 88c2ecf20Sopenharmony_ci# If the object has no symbol, $NM warns 'no symbols'. 98c2ecf20Sopenharmony_ci# Suppress the stderr. 108c2ecf20Sopenharmony_ci# TODO: 118c2ecf20Sopenharmony_ci# Use -q instead of 2>/dev/null when we upgrade the minimum version of 128c2ecf20Sopenharmony_ci# binutils to 2.37, llvm to 13.0.0. 138c2ecf20Sopenharmony_ciksyms=$($NM $1 2>/dev/null | sed -n 's/.*__ksym_marker_\(.*\)/\1/p' | tr A-Z a-z) 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciif [ -z "$ksyms" ]; then 168c2ecf20Sopenharmony_ci exit 0 178c2ecf20Sopenharmony_cifi 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciecho 208c2ecf20Sopenharmony_ciecho "ksymdeps_$1 := \\" 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cifor s in $ksyms 238c2ecf20Sopenharmony_cido 248c2ecf20Sopenharmony_ci echo $s | sed -e 's:^_*: $(wildcard include/ksym/:' \ 258c2ecf20Sopenharmony_ci -e 's:__*:/:g' -e 's/$/.h) \\/' 268c2ecf20Sopenharmony_cidone 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciecho 298c2ecf20Sopenharmony_ciecho "$1: \$(ksymdeps_$1)" 308c2ecf20Sopenharmony_ciecho 318c2ecf20Sopenharmony_ciecho "\$(ksymdeps_$1):" 32