1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

kinetis: Add script for generating vendor header include lines

This commit is contained in:
Joakim Nohlgård 2017-10-28 17:17:13 +02:00
parent 22c52bd3a8
commit 19d407a3e9

View File

@ -0,0 +1,22 @@
# Usage: awk -f <this_script> vendor/MKxxxx.h vendor/MKxxyy.h vendor/MKzzz.h ...
/Processor[s]?:/ {
i=0;
if (FNR == NR) {
printf "#if";
} else {
printf "#elif";
}
while(match($0, /MK.*/)) {
if (i>0) {
printf " || \\\n ";
}
printf " defined(CPU_MODEL_%s)", substr($0, RSTART, RLENGTH);
getline;
i++;
}
printf("\n#include \"%s\"\n", FILENAME);
nextfile;
}
END {
print "#endif"
}