855b07aaf6b41206ddad2d6e5909e9daee3077fb
# ========== Copyright Header Begin ==========================================
# OpenSPARC T2 Processor File: hasnative.sh
# Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
# The above named program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License version 2 as published by the Free Software Foundation.
# The above named program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# You should have received a copy of the GNU General Public
# License along with this work; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
# ========== Copyright Header End ============================================
echo "`basename $0` [-p <prefix>] <srcname> <destfile>"
echo "\tgenerate a .h file for instruction IMPL types"
prefix
="_`echo $prefix | sed -e 's/\.h$//g' | tr '[a-z]-/' '[A-Z]__'`_"
if [ ! "$#" = "2" ] ; then
if [ ! "`echo $name | egrep '\.h$'`" = $name ] ;then
echo $name is not a .h filename
!
# ok dig out the base filename
bname
=`basename $name | sed -e 's/\.h$//g' | tr '[a-z] -/' '[A-Z]___' | sed -e 's/__/_/g'`
#ifndef ${prefix}${bname}_H_
#define ${prefix}${bname}_H_
/* This file is autogenerated from $srcname - DO NOT EDIT */
list
=`egrep '^IMPL\(' $srcname | sed -e 's?IMPL(??' -e 's?).*??'`
#define HAS_NATIVE_${n} 1
#endif /* #ifndef ${prefix}${bname}_H_ */