X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fgentvals.sh;h=6dd7315f30aaa5695e65cf5a444fa4d7fa98a892;hb=bb0974456ed6d421e8d0b257f1e108c242326afc;hp=3f837a2805f402c4280f5abe4931deb31d417c88;hpb=fa803dc60f0bf01297674c41d001798e18ade4dc;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/common/gentvals.sh b/sim/common/gentvals.sh old mode 100644 new mode 100755 index 3f837a2805..6dd7315f30 --- a/sim/common/gentvals.sh +++ b/sim/common/gentvals.sh @@ -1,12 +1,13 @@ #!/bin/sh -# Usage: gentvals.sh type dir files pattern cpp +# Usage: gentvals.sh target type dir files pattern cpp -type=$1 -dir=$2 +target=$1 +type=$2 +dir=$3 # FIXME: Would be nice to process #include's in these files. -files=$3 -pattern=$4 -cpp=$5 +files=$4 +pattern=$5 +cpp=$6 # FIXME: need trap to remove tmp files. @@ -36,16 +37,38 @@ do echo "#endif" >>tmpvals.h done -echo "#ifdef ${type}_defs" +if test -z "$target" +then + echo "#ifdef ${type}_defs" +else + echo "#ifdef NL_TARGET_$target" + echo "#ifdef ${type}_defs" +fi + for f in $files do if test -f $dir/$f ; then echo "/* from $f */" fi done -echo "/* begin $type target macros */" -$cpp tmpvals.h | grep DEFVAL | sed -e 's/DEFVAL//' -e 's/ / /' -echo "/* end $type target macros */" -echo "#endif" + +if test -z "$target" +then + echo "/* begin $type target macros */" +else + echo "/* begin $target $type target macros */" +fi + +$cpp -I$dir tmpvals.h | grep DEFVAL | sed -e 's/DEFVAL//' -e 's/ / /' + +if test -z "$target" +then + echo "/* end $type target macros */" + echo "#endif" +else + echo "/* end $target $type target macros */" + echo "#endif" + echo "#endif" +fi rm -f tmpvals.list tmpvals.uniq tmpvals.h