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:
parent
22c52bd3a8
commit
19d407a3e9
22
cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk
vendored
Normal file
22
cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk
vendored
Normal 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"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user