~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to ffcall/callback/vacall_r/asmarm.sh

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Translate the assembler syntax of arm assembler programs
3
 
# Usage: asmarm < riscix-asm-file > portable-asm-file
4
 
# The portable-asm-file has to be
5
 
#   1. preprocessed,
6
 
#   2. grep -v '^ *#line' | grep -v '^#'
7
 
#   3. sed -e 's,% ,%,g' -e 's,//,@,g' -e 's,\$,#,g'
8
 
 
9
 
tmpscript1=sed$$tmp1
10
 
tmpscript2=sed$$tmp2
11
 
tmpremove='rm -f $tmpscript1 $tmpscript2'
12
 
trap "$tmpremove" 1 2 15
13
 
 
14
 
cat > $tmpscript1 << \EOF
15
 
# ----------- Remove gcc self-identification
16
 
/gcc2_compiled/d
17
 
/gnu_compiled_c/d
18
 
EOF
19
 
 
20
 
cat > $tmpscript2 << \EOF
21
 
# ----------- Hide comments, to avoid trouble in preprocessing
22
 
s,@,//,g
23
 
# ----------- Turn # into $, to avoid trouble in preprocessing
24
 
s,#,\$,g
25
 
# ----------- Declare global symbols as functions (we have no variables)
26
 
s/\.global      _\([A-Za-z0-9_]*\)$/.global     _\1\
27
 
        DECLARE_FUNCTION(\1)/
28
 
# ----------- Global symbols depends on ASM_UNDERSCORE
29
 
s/_\([A-Za-z0-9_:]*\)/C(\1)/
30
 
EOF
31
 
 
32
 
sed -f $tmpscript1 | \
33
 
sed -f $tmpscript2
34
 
 
35
 
eval "$tmpremove"