AppName 1.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# Generate an assembler header file containing ApplicationName
# and ApplicationVersion using information in the Messages file.
# Component version and date need only be updated in Messages file
#
# 1997-06-24: BAL: Made generic for toolbox apps.  Extracts app name
#                  from _TaskName tag and gets version number and date
#                  from Version tag

BEGIN {
    name_found = 0
    version_found = 0
}

{
    if (!version_found) {
        split($1, Id, ":")
        if (Id[1] == "Version") {
            version_found = 1
            split($2, Date, "-")
        }
    }
    if (!name_found) {
        split($1, Name, ":")
        if (Name[1] == "_TaskName") {
            name_found = 1
        }
    }
}

END {
    printf("; AppName - generated from Messages, used by ModuleWrap\n")
    printf("\n")
    printf("                   GBLS    ApplicationName\n")
    printf("                   GBLS    ApplicationVersion\n")
    printf("\n")
    printf("ApplicationName    SETS    \"%s\"\n", Name[2])
    printf("ApplicationVersion SETS    \"%s %s %s 19%s\"\n", Id[2], Date[1], Date[2], Date[3])
    printf("\n")
    printf("                   END\n")
}