File:  [Qemu by Fabrice Bellard] / qemu / scripts / make_device_config.sh
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 18:42:41 2018 UTC (3 years, 3 months ago) by root
Branches: qemu, MAIN
CVS tags: qemu1101, qemu1001, qemu1000, qemu0151, qemu0150, qemu0141, qemu0140, HEAD
qemu 0.14.0

    1: #! /bin/sh
    2: # Construct a target device config file from a default, pulling in any
    3: # files from include directives.
    4: 
    5: dest=$1.tmp
    6: dep=$1.d
    7: src=$2
    8: src_dir=`dirname $src`
    9: all_includes=
   10: 
   11: process_includes () {
   12:   cat $1 | grep '^include' | \
   13:   while read include file ; do
   14:     all_includes="$all_includes $src_dir/$file"
   15:     process_includes $src_dir/$file
   16:   done
   17: }
   18: 
   19: f=$src
   20: while [ -n "$f" ] ; do
   21:   f=`tr -d '\r' < $f | awk '/^include / {printf "'$src_dir'/%s", $2}'`
   22:   [ $? = 0 ] || exit 1
   23:   all_includes="$all_includes $f"
   24: done
   25: process_includes $src > $dest
   26: 
   27: cat $src $all_includes | grep -v '^include' > $dest
   28: echo "$1: $all_includes" > $dep

unix.superglobalmegacorp.com