⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 build-macros

📁 This Source-Navigator, an IDE for C/C++/Fortran/Java/Tcl/PHP/Python and a host of other languages.
💻
字号:
#!/bin/sh################################################################################# $Id: build-macros,v 1.1.1.1 2002/04/18 23:42:16 mdejong Exp $## Copyight (C) 1997 Cygnus Solutions, Inc.## Description:# This script takes a couple of pre-compiled C programs and inspects the # assembler output to try and guess what the mneumonics and pseudo-op names# are for a particular assembly syntax.## Usage: build-defns <macro filename> ## If the script gets it wrong, you can always edit the .m4 file by hand!################################################################################outfile=$1.m4asmsrc=a.sfunctionname=funcbglobalvar=inastaticvar=hiddena############################################################################### Test $* for non-emptiness.  If it is empty, then output an error message to# indicate that something went wrong when trying to locate some piece of# information in the assembly source.##############################################################################check(){  error=$1  shift  if [ "$*" = "" ] ; then    echo Unable to determine $error!    rm $outfile    exit  fi}############################################################################### Try and locate the pseudo-op (out of a possible number of lines of matching# text) that indicates that a data object is static.##############################################################################static_keyword(){  for token in $* ; do    token=`echo $token | awk -F, '{ print $1 }'`    if [ "$token" = "hiddena" -a "$last" != "$globalop" ] ; then       staticop=$last    fi    last=$token  done}######################################################################## Emit some progress indicators to the user on stdout and build the M4# macro file.#######################################################################emit(){  echo We use \`$3\' to $2.  echo "define(\`$1', \`"$3"')" >> $outfile} ############ mainline###########if [ $# = 0 ] ; then  echo "Usage: $0 <filename>.m4"  exit 1else  rm $outfilefiif [ ! -f $asmsrc ] ; then  echo File not found: $asmsrc  exit 1firesult="#"check $result "comment character"commchar=$resultemit "_COMMCHAR" "start end-of-line comments" $commcharresult=`grep $functionname $asmsrc`check $result "jump opcode mneumonic"callop=`echo $result | awk '{ print $1 }'`emit "_CALLOP" "make subroutine calls" $callopresult=`grep $globalvar $asmsrc | grep -v 12`check $result "pseudo-op for declaring global data"globalop=`echo $result | awk '{ print $1 }'`emit "_GLOBALOP" "declare global data" $globalopresult=`grep $staticvar $asmsrc | grep -v 36`check $result "pseudo-op for declaring static data"static_keyword $resultemit "_STATICOP" "declare static data" $staticopresult=".macro"check $result "macro pseudo-op"macrop=$resultemit "_MACROP" "define macros" $macropresult=".L"check $result "local label prefix"macrop=$resultemit "_LOCLABEL" "prefix local labels" $macropresult={symbol-name}":"check $result "label pattern"label=$resultemit "_LABEL" "specify labels" $labelecho "(except on HPPA, where a label may be ^{symbol-name}{ws})"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -