| # Writes a target device config file to stdout, from a default and from |
| # include directives therein. Also emits Makefile dependencies. |
| # Usage: make_device_config.sh SRC DEPFILE-NAME DEPFILE-TARGET > DEST |
| cat $1 | grep '^include' | \ |
| while read include file ; do |
| all_includes="$all_includes $src_dir/$file" |
| process_includes $src_dir/$file |
| f=$(cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}') |
| all_includes="$all_includes $f" |
| cat $src $all_includes | grep -v '^include' |
| echo "$target: $all_includes" > $dep |