* Make-common.in (sim-*_h): Add rules for all sim headers. Also
[deliverable/binutils-gdb.git] / sim / common / gentvals.sh
index 3f837a2805f402c4280f5abe4931deb31d417c88..6dd7315f30aaa5695e65cf5a444fa4d7fa98a892 100644 (file)
@@ -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
This page took 0.026798 seconds and 4 git commands to generate.