summaryrefslogtreecommitdiff
path: root/generateredefinesfile.awk
blob: 592c19a5dd8aa325d32685eb5c60b4df42d00266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# "jump" is the jump instruction for the platform
# "prefix1" is the prefix of what is being mapped from
# "prefix2" is the prefix of what is being mapped to
{ 
    # Remove the CR character in case the sources are mapped from
    # a Windows share and contain CRLF line endings
    gsub(/\r/,"", $0);
    
    # Skip empty lines and comment lines starting with semicolon
    if (NF && !match($0, /^[:space:]*;/))
    {
        # Only process the entries that begin with "#"
        if (match($0, /^#.*/))
        {
            gsub(/^#/,"", $0);
            print "LEAF_ENTRY " prefix1 $0 ", _TEXT"
            print "    " jump " EXTERNAL_C_FUNC(" prefix2 $0 ")"
            print "LEAF_END " prefix1 $0 ", _TEXT"
            print ""
        }
    }
}