1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/kinetis/dist/generate-cpu-files/generate-header-includes.awk

23 lines
481 B
Awk

# 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"
}