Changeset 30 for trunk/src/kmk/parse.c


Ignore:
Timestamp:
Nov 30, 2002, 7:53:42 AM (23 years ago)
Author:
bird
Message:

Basic nmake emulation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/parse.c

    r27 r30  
    21722172                lineno++;
    21732173                lastc = ' ';
     2174#ifdef NMAKE
     2175                do {
     2176                        while ((c = ParseReadc ()) == ' ' || c == '\t') {
     2177                            continue;
     2178                        }
     2179                        if (c != '#')
     2180                            break;
     2181                        /* comment - skip line */
     2182                        while ((c = ParseReadc ()) != '\n' && c != EOF) {
     2183                            continue;
     2184                        }
     2185                        if (c == EOF)
     2186                            break;
     2187                } while (1);
     2188#else
    21742189                while ((c = ParseReadc ()) == ' ' || c == '\t') {
    21752190                    continue;
    21762191                }
     2192#endif
    21772193                if (c == EOF || c == '\n') {
    21782194                    goto line_read;
     
    22972313        *ep = 0;
    22982314
     2315#ifdef NMAKE
     2316        if (line[0] == '.' || line[0] == '!') {
     2317#else
    22992318        if (line[0] == '.') {
     2319#endif
    23002320            /*
    23012321             * The line might be a conditional. Ask the conditional module
     
    24092429    do {
    24102430        while ((line = ParseReadLine ()) != NULL) {
     2431//debugkso: fprintf(stderr, "%s(%d): inLine=%d line=%s\n", fname, lineno, inLine, line);
    24112432            if (*line == '.') {
    24122433                /*
     
    24502471                 * a creation command.
    24512472                 */
    2452 #ifndef POSIX
     2473#if !defined(POSIX) || defined(NMAKE)
    24532474            shellCommand:
    24542475#endif
     
    24962517                 * and add it to the current list of targets.
    24972518                 */
    2498 #ifndef POSIX
     2519#if !defined(POSIX) || defined(NMAKE)
    24992520                Boolean nonSpace = FALSE;
    25002521#endif
     
    25082529                        goto nextLine;
    25092530                    }
    2510 #ifndef POSIX
     2531#if !defined(POSIX) || defined(NMAKE)
    25112532                    while ((*cp != ':') && (*cp != '!') && (*cp != '\0')) {
    25122533                        nonSpace = TRUE;
     
    25162537                }
    25172538
    2518 #ifndef POSIX
     2539#if !defined(POSIX) || defined(NMAKE)
    25192540                if (*cp == '\0') {
    25202541                    if (inLine) {
     2542#ifndef NMAKE
    25212543                        Parse_Error (PARSE_WARNING,
    25222544                                     "Shell command needs a leading tab");
     2545#endif
    25232546                        goto shellCommand;
    25242547                    } else if (nonSpace) {
     
    25432566
    25442567                    ParseDoDependency (line);
    2545 #ifndef POSIX
     2568#if !defined(POSIX) || defined(NMAKE)
    25462569                }
    25472570#endif
Note: See TracChangeset for help on using the changeset viewer.