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


Ignore:
Timestamp:
Apr 4, 2003, 2:03:50 AM (22 years ago)
Author:
bird
Message:

kMk changes. Made extensions configurable from config.h. fixed parents.

File:
1 edited

Legend:

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

    r45 r46  
    103103#include "pathnames.h"
    104104
    105 #if defined(NMAKE) || defined(KMK)
    106 #define SUPPORT_INLINEFILES     1
    107 #endif
    108105
    109106/*
     
    118115static Boolean      inLine;     /* true if currently in a dependency
    119116                                 * line or its commands */
    120 #if defined(NMAKE) || defined(KMK)
     117#if defined(USE_INLINEFILES)
    121118static Boolean      inInlineFile; /* true if currently in a inline file.*/
    122119#endif
     
    165162    Includes,       /* .INCLUDES */
    166163    Interrupt,      /* .INTERRUPT */
     164#ifdef USE_ARCHIVES
    167165    Libs,           /* .LIBS */
     166#endif
    168167    MFlags,         /* .MFLAGS or .MAKEFLAGS */
    169168    Main,           /* .MAIN and we don't have anything user-specified to
     
    219218{ ".INVISIBLE",   Attribute,    OP_INVISIBLE },
    220219{ ".JOIN",        Attribute,    OP_JOIN },
     220#ifdef USE_ARCHIVES
    221221{ ".LIBS",        Libs,         0 },
     222#endif
    222223{ ".MAIN",        Main,         0 },
    223224{ ".MAKE",        Attribute,    OP_MAKE },
     
    256257static void ParseDoDependency __P((char *));
    257258static int ParseAddCmd __P((ClientData, ClientData));
    258 #ifdef SUPPORT_INLINEFILES
     259#ifdef USE_INLINEFILES
    259260static int ParseAppendInline __P((ClientData, ClientData));
    260261static Boolean ParseCmdIsComponent __P((const char *, const char *));
     
    740741                                 * a list of .PATH targets */
    741742    int             tOp;        /* operator from special target */
     743#ifdef USE_ARCHIVES
    742744    Lst             sources;    /* list of archive source names after
    743745                                 * expansion */
     746#endif
    744747    Lst             curTargs;   /* list of target names to be found and added
    745748                                 * to the targets list */
     
    783786        }
    784787        if (*cp == '(') {
     788#ifdef USE_ARCHIVES
    785789            /*
    786790             * Archives must be handled specially to make sure the OP_ARCHV
     
    797801                             "Error in archive specification: \"%s\"", line);
    798802                return;
    799             } else {
     803            } else
    800804                continue;
    801             }
     805#else
     806            Parse_Error(PARSE_FATAL, "Archives are not supported!", line);
     807            return;
     808#endif /* USE_ARCHIVES */
    802809        }
    803810        savec = *cp;
     
    10891096    } else if (specType == ExShell) {
    10901097    #ifdef KMK
    1091         Parse_Error(PARSE_FATAL, "specification not supported by kMk!");
     1098        Parse_Error(PARSE_FATAL, "shell specification not supported by kMk!");
    10921099        return;
    10931100    #else
     
    11061113     */
    11071114    if ((specType == Suffixes) || (specType == ExPath) ||
    1108         (specType == Includes) || (specType == Libs) ||
     1115        (specType == Includes) ||
     1116#ifdef USE_ARCHIVES
     1117        (specType == Libs) ||
     1118#endif
    11091119        (specType == Null))
    11101120    {
     
    11501160                    Suff_AddInclude (line);
    11511161                    break;
     1162#ifdef USE_ARCHIVES
    11521163                case Libs:
    11531164                    Suff_AddLib (line);
    11541165                    break;
     1166#endif
    11551167                case Null:
    11561168                    Suff_SetNull (line);
     
    11931205
    11941206            if (*cp == '(') {
     1207#ifdef USE_ARCHIVES
    11951208                GNode     *gn;
    11961209
     
    12081221                Lst_Destroy (sources, NOFREE);
    12091222                cp = line;
     1223#else
     1224                Parse_Error(PARSE_FATAL, "Archives are not supported!", line);
     1225                return;
     1226#endif /* USE_ARCHIVES */
    12101227            } else {
    12111228                if (*cp) {
     
    15281545
    15291546
    1530 #ifdef SUPPORT_INLINEFILES
     1547#ifdef USE_INLINEFILES
    15311548/*-
    15321549 * ParseAppendInline  --
     
    22562273    semiNL = FALSE;
    22572274    ignDepOp = FALSE;
    2258     #ifdef SUPPORT_INLINEFILES
     2275    #ifdef USE_INLINEFILES
    22592276    ignComment = inInlineFile;
    22602277    #else
     
    22712288    for (;;) {
    22722289        c = ParseReadc();
    2273         #ifdef SUPPORT_INLINEFILES
     2290        #ifdef USE_INLINEFILES
    22742291        if (inInlineFile)
    22752292            break;
     
    23062323            switch(c) {
    23072324            case '\n':
    2308                 #ifdef SUPPORT_INLINEFILES
     2325                #ifdef USE_INLINEFILES
    23092326                /* No newline escaping in inline files, unless it's a directive. */
    23102327                if (inInlineFile) {
     
    23672384#ifndef KMK
    23682385            case ';':
    2369                 #ifdef SUPPORT_INLINEFILES
     2386                #ifdef USE_INLINEFILES
    23702387                if (inInlineFile)
    23712388                    break;
     
    23892406                break;
    23902407            case '=':
    2391                 #ifdef SUPPORT_INLINEFILES
     2408                #ifdef USE_INLINEFILES
    23922409                if (inInlineFile)
    23932410                    break;
     
    24422459            case ':':
    24432460            case '!':
    2444                 #ifdef SUPPORT_INLINEFILES
     2461                #ifdef USE_INLINEFILES
    24452462                if (inInlineFile)
    24462463                    break;
     
    24792496         * a '\'
    24802497         */
    2481 #ifdef SUPPORT_INLINEFILES
     2498#ifdef USE_INLINEFILES
    24822499      if (!inInlineFile) {
    24832500#endif
     
    24912508        }
    24922509        *ep = 0;
    2493 #ifdef SUPPORT_INLINEFILES
     2510#ifdef USE_INLINEFILES
    24942511      }
    24952512#endif
     
    26042621
    26052622    inLine = FALSE;
    2606     #if defined(NMAKE) || defined(KMK)
     2623    #if defined(USE_INLINEFILES)
    26072624    inInlineFile = FALSE;
    26082625    #endif
     
    26522669            }
    26532670
    2654             #ifdef SUPPORT_INLINEFILES
     2671            #ifdef USE_INLINEFILES
    26552672            if (inInlineFile)
    26562673            {
     
    27022719                 * a creation command.
    27032720                 */
    2704 #if !defined(POSIX) || defined(NMAKE)
     2721#if !defined(POSIX) || defined(USE_NO_STUPID_TABS)
    27052722            shellCommand:
    27062723#endif
     
    27102727                if (*cp) {
    27112728                    if (inLine) {
    2712                         #ifdef SUPPORT_INLINEFILES
     2729                        #ifdef USE_INLINEFILES
    27132730                        if (ParseCmdIsComponent(cp, "<<"))
    27142731                        {
     
    27572774                 * and add it to the current list of targets.
    27582775                 */
    2759 #if !defined(POSIX) || defined(NMAKE) || defined(KMK)
     2776#if !defined(POSIX) || defined(USE_NO_STUPID_TABS)
    27602777                Boolean nonSpace = FALSE;
    27612778#endif
     
    27692786                        goto nextLine;
    27702787                    }
    2771 #if !defined(POSIX) || defined(NMAKE) || defined(KMK)
     2788#if !defined(POSIX) || defined(USE_NO_STUPID_TABS)
    27722789                    while ((*cp != ':') && (*cp != '!') && (*cp != '\0')) {
    27732790                        nonSpace = TRUE;
     
    27772794                }
    27782795
    2779 #if !defined(POSIX) || defined(NMAKE) || defined(KMK)
     2796#if !defined(POSIX) || defined(USE_NO_STUPID_TABS)
    27802797                if (*cp == '\0') {
    27812798                    if (inLine) {
    2782 #if !defined(NMAKE) && !defined(KMK)
     2799#if !defined(USE_NO_STUPID_TABS)
    27832800                        Parse_Error (PARSE_WARNING,
    27842801                                     "Shell command needs a leading tab");
     
    28062823
    28072824                    ParseDoDependency (line);
    2808 #if !defined(POSIX) || defined(NMAKE) || defined(KMK)
     2825#if !defined(POSIX) || defined(USE_NO_STUPID_TABS)
    28092826                }
    28102827#endif
Note: See TracChangeset for help on using the changeset viewer.