mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
582da9b233
e.g. Usage: ./sam0_common/dist/kconfig_gen.sh samd51
36 lines
733 B
Bash
Executable File
36 lines
733 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Generate Kconfig file for all parts of a sam0 family
|
|
# based on the available vendor files.
|
|
|
|
if [ -z "$1" ]
|
|
then
|
|
echo "usage: $0 <family>"
|
|
exit 1
|
|
fi
|
|
|
|
FAM=$1
|
|
FAM_UC=$(echo $FAM | tr a-z A-Z)
|
|
|
|
VENDOR_FILES=$(dirname $0)/../include/vendor/$FAM/*/$FAM?*.h
|
|
|
|
{
|
|
echo '## CPU Models'
|
|
for i in $VENDOR_FILES; do
|
|
MODEL_LC=$(basename $i .h)
|
|
MODEL_UC=$(echo $MODEL_LC | tr a-z A-Z)
|
|
|
|
echo "config CPU_MODEL_$MODEL_UC"
|
|
echo " bool"
|
|
echo " select CPU_FAM_$FAM_UC"
|
|
echo ""
|
|
done
|
|
|
|
echo 'config CPU_MODEL'
|
|
for i in $VENDOR_FILES; do
|
|
MODEL_LC=$(basename $i .h)
|
|
MODEL_UC=$(echo $MODEL_LC | tr a-z A-Z)
|
|
printf ' default "%s" if CPU_MODEL_%s\n' $MODEL_LC $MODEL_UC
|
|
done
|
|
} > Kconfig.$FAM
|