# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
-output=$1
-shift
-
-if test -z "$output" || test -z "$1"; then
- echo "Usage: $0 OUTPUTFILE INPUTFILE..."
- exit 1
-fi
-
-if test -e "$output"; then
- echo "Output file \"$output\" already exists; refusing to overwrite."
+if test -z "$1"; then
+ echo "Usage: $0 INPUTFILE..."
exit 1
fi
for input; do
- arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'`
+ arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g')
${AWK:-awk} 'BEGIN { n = 0
- printf "#include \"config.h\"\n"
- printf "#include \"qemu-common.h\"\n"
- printf "#include \"gdbstub.h\"\n"
+ printf "#include \"qemu/osdep.h\"\n"
print "static const char '$arrayname'[] = {"
for (i = 0; i < 255; i++)
_ord_[sprintf("%c", i)] = i
printf "'\''\\n'\'', \n"
} END {
print " 0 };"
- }' < $input >> $output
+ }' < $input
done
-echo >> $output
-echo "const char *const xml_builtin[][2] = {" >> $output
+echo
+echo '#include "exec/gdbstub.h"'
+echo "const char *const xml_builtin[][2] = {"
for input; do
- basename=`echo $input | sed 's,.*/,,'`
- arrayname=xml_feature_`echo $input | sed 's,.*/,,; s/[-.]/_/g'`
- echo " { \"$basename\", $arrayname }," >> $output
+ basename=$(echo $input | sed 's,.*/,,')
+ arrayname=xml_feature_$(echo $input | sed 's,.*/,,; s/[-.]/_/g')
+ echo " { \"$basename\", $arrayname },"
done
-echo " { (char *)0, (char *)0 }" >> $output
-echo "};" >> $output
+echo " { (char *)0, (char *)0 }"
+echo "};"