OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [config/] [vms/] [make-crtlmap.awk] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 709 jeremybenn
# Generate the VMS crtl map
2
#       Copyright (C) 2011  Free Software Foundation, Inc.
3
 
4
BEGIN {
5
    is_first = 1;
6
    maxlen=1;
7
    maxlen_name="??"
8
    prev=""
9
    ORS=""
10
}
11
 
12
# Remove comment and blank lines.
13
/^ *#/ || /^ *$/ {
14
  next;
15
}
16
 
17
{
18
    # Handle comma
19
    if (!is_first)
20
        print ",\n"
21
    else
22
        is_first = 0;
23
 
24
    # Check the map is sorted
25
    if ($0 <= prev)
26
    {
27
        print "Map not sorted!! (with name " $0 ")\n"
28
        exit 1
29
    }
30
    prev = $0
31
 
32
    # Compute the max of the identifier len.
33
    l=length($1)
34
    if (l > maxlen)
35
    {
36
        maxlen = l
37
        maxlen_name = $1
38
    }
39
 
40
    print "{ \"" $1 "\", "
41
    if (NF == 1)
42
        print "0 }"
43
    else if (NF == 2)
44
        printf "VMS_CRTL_" $2 " }"
45
    else if (NF == 3)
46
        printf "VMS_CRTL_" $2 " | VMS_CRTL_" $3 " }"
47
    else
48
        # To be fixed.
49
        exit 1
50
}
51
 
52
END {
53
    print "\n\n"
54
    print "#define VMS_CRTL_MAXLEN " maxlen "  /*" maxlen_name " */\n"
55
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.