2 # Sed script to parse CPP macros and generate output usable by make
4 # It is expected that this script is fed the output of 'gpp -dM'
5 # which preprocesses the common.h header files and outputs the final
6 # list of CPP macros (and whitespace is sanitized)
9 # Only process values prefixed with #define CONFIG_
10 /^#define CONFIG_[A-Za-z0-9_]\+/ {
11 # Strip the #define prefix
13 # Change to form CONFIG_*=VALUE
15 # Drop trailing spaces
17 # drop quotes around string values
19 # Concatenate string values
21 # Wrap non-numeral values with quotes
22 s/=\(.*\?[^0-9].*\)$/=\"\1\"/;
23 # Change '1' and empty values to "y" (not perfect, but
24 # supports conditional compilation in the makefiles