Changeset 45 for trunk/src/kmk


Ignore:
Timestamp:
Apr 3, 2003, 4:23:37 AM (22 years ago)
Author:
bird
Message:

KMK changes..

Location:
trunk/src/kmk
Files:
3 added
9 edited

Legend:

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

    r35 r45  
    532532            #ifdef NMAKE
    533533            case '[':
    534                 //@todo execute this command!!!
     534                /* @todo execute this command!!! */
     535                Parse_Error(PARSE_WARNING, "Unsupported NMAKE construct ([])");
    535536                t = False;
    536537                condExpr += strlen(condExpr);
     
    598599
    599600                    #ifdef NMAKE
     601                    //@todo entirely support escaped quotes and such nitty pick.
    600602                    for (;*condExpr && (fQuoted ? *condExpr != '"' : !isspace((unsigned char) *condExpr)); condExpr++)
     603                        Buf_AddByte(buf, (Byte)*condExpr);
     604                    if (fQuoted && *condExpr == '"')
     605                        condExpr++;
    601606                    #else
    602607                    for (;*condExpr && !isspace((unsigned char) *condExpr); condExpr++)
     608                        Buf_AddByte(buf, (Byte)*condExpr);
    603609                    #endif
    604                         Buf_AddByte(buf, (Byte)*condExpr);
    605610
    606611                    Buf_AddByte(buf, (Byte)'\0');
  • trunk/src/kmk/job.c

    r35 r45  
    4646#endif /* not lint */
    4747
    48 #ifdef NMAKE
     48#if defined(NMAKE) || defined(KMK)
    4949#define OLD_JOKE 1
    5050#endif
     
    190190static char     tfile[sizeof(TMPPAT)];
    191191
    192 
     192#ifndef KMK
    193193/*
    194194 * Descriptions for various shells.
     
    237237                                                   * executable image */
    238238                *shellName;                       /* last component of shell */
     239#endif /*!KMK*/
    239240
    240241
     
    326327static void JobExec __P((Job *, char **));
    327328#endif
     329#ifndef KMK
    328330static void JobMakeArgv __P((Job *, char **));
     331#endif
    329332static void JobRestart __P((Job *));
    330333static int JobStart __P((GNode *, int, Job *));
     
    594597        cmd++;
    595598
     599    #ifndef KMK
    596600    if (shutUp) {
    597601        if (!(job->flags & JOB_SILENT) && !noSpecials &&
     
    602606        }
    603607    }
     608    #endif
    604609
    605610    if (errOff) {
    606611        if ( !(job->flags & JOB_IGNERR) && !noSpecials) {
     612            #ifdef KMK
     613            errOff = FALSE;
     614            #else
    607615            if (commandShell->hasErrCtl) {
    608616                /*
     
    650658                errOff = FALSE;
    651659            }
     660            #endif
    652661        } else {
    653662            errOff = FALSE;
     
    657666    DBPRINTF(cmdTemplate, cmd);
    658667
     668    #ifndef KMK /*todo*/
    659669    if (errOff) {
    660670        /*
     
    672682        DBPRINTF("%s\n", commandShell->echoOn);
    673683    }
     684    #endif
    674685    return 0;
    675686}
     
    11501161                if (strcmp(gn->name,"love") == 0)
    11511162                    (*abortProc)("Not war.");
    1152 #ifdef NMAKE
     1163#if defined(NMAKE) || defined(KMK)
    11531164        else if (strcmp(gn->name,"fire") == 0)
    11541165                    (*abortProc)("No match.");
     
    13021313        } else
    13031314#endif /* REMOTE */
     1315#ifdef KMK
     1316           (void) execv(argv[0], argv);
     1317#else
    13041318           (void) execv(shellPath, argv);
     1319#endif
    13051320
    13061321        (void) write(2, "Could not execute shell\n",
     
    13621377}
    13631378
     1379
    13641380/*-
    13651381 *-----------------------------------------------------------------------
     
    13821398    static char   args[10];     /* For merged arguments */
    13831399
     1400#ifndef _PATH_DEFSHELLDIR
     1401    /* @todo! */
     1402    argv[0] = "c:\\os2\\cmd.exe";
     1403    argc = 1;
     1404#else
    13841405    argv[0] = shellName;
    13851406    argc = 1;
     
    14151436    }
    14161437    argv[argc] = NULL;
     1438#endif
    14171439}
     1440
    14181441
    14191442/*-
     
    19882011    register char *ecp;
    19892012
     2013    #ifndef KMK /* @Todo */
    19902014    if (commandShell->noPrint) {
    19912015        ecp = Str_FindSubstring(cp, commandShell->noPrint);
     
    20232047        }
    20242048    }
     2049    #endif /*!KMK*/
    20252050    return cp;
    20262051}
     
    24622487    }
    24632488
     2489#ifndef KMK
    24642490    if (shellPath == NULL) {
    24652491        /*
     
    24802506        commandShell->echo = "";
    24812507    }
     2508#endif
    24822509
    24832510    /*
     
    25882615}
    25892616
     2617#ifndef KMK
    25902618/*-
    25912619 *-----------------------------------------------------------------------
     
    26292657    return(match == NULL ? sh : match);
    26302658}
    2631 
     2659#endif /*!KMK*/
     2660
     2661#ifndef KMK
    26322662/*-
    26332663 *-----------------------------------------------------------------------
     
    27932823    return SUCCESS;
    27942824}
     2825#endif /*!KMK*/
    27952826
    27962827/*-
  • trunk/src/kmk/main.c

    r40 r45  
    7979 */
    8080
    81 #if defined(USE_KLIB) || defined(KMK)
     81#if defined(USE_KLIB) //|| defined(KMK)
    8282    #define KLIB_INSTRICT
    8383    #include <kLib/kLib.h>
     
    533533        char *cp = NULL, *start;
    534534                                        /* avoid faults on read-only strings */
     535        #ifndef KMK
    535536        static char syspath[] = _PATH_DEFSYSPATH;
     537        #endif
    536538
    537539#ifdef RLIMIT_NOFILE
     
    634636        }
    635637       
     638        #ifdef KMK
     639        /* @todo figure out how to set object directory! */
     640        #else
    636641        /*
    637642         * The object directory location is determined using the
     
    675680                        objdir = curdir;
    676681        }
     682        #endif
    677683
    678684#ifdef WANT_ENV_PWD
     
    794800
    795801
     802        #ifdef KMK
     803        /*
     804         * Add current directory tree to system include path all levels up to the root.
     805         * ASSUMES that curdir is absolute.
     806         */
     807        {
     808            char *  psz = estrdup(curdir);
     809            char *  pszEnd = psz + strlen(psz);
     810            while (psz < pszEnd)
     811            {
     812                Dir_AddDir(sysIncPath, psz);
     813
     814                /* Trim of the last directory component. */
     815                while (pszEnd-- > psz)
     816                    if (*pszEnd == '/' || *pszEnd == ':')
     817                    {
     818                        if (*pszEnd == ':') /*Drive letter means end of story */
     819                            pszEnd = psz;
     820                        *pszEnd = '\0';
     821                        break;
     822                    }
     823            }
     824            efree(psz);
     825        }
     826
     827        #else
    796828        /*
    797829         * If no user-supplied system path was given (through the -m option)
     
    811843                }
    812844        }
     845        #endif
    813846
    814847        /*
  • trunk/src/kmk/make.c

    r25 r45  
    624624
    625625
     626#ifdef KMK
     627/*-
     628 *-----------------------------------------------------------------------
     629 * MakeAddAllSrc --
     630 *
     631 * Results:
     632 *      Always returns 0
     633 *
     634 * Side Effects:
     635 *      The PARENTS variable for the given node is extended.
     636 *-----------------------------------------------------------------------
     637 */
     638static int
     639MakeAddParents (cgnp, pgnp)
     640    ClientData  pgnp;   /* The parent to add to add */
     641    ClientData  cgnp;   /* The child to whose PARENTS variable it should be */
     642{
     643    GNode       *pgn = (GNode *) pgnp;
     644    GNode       *cgn = (GNode *) cgnp;
     645    if ((pgn->type & (OP_EXEC|OP_USE|OP_INVISIBLE)) == 0) {
     646        char *parent;
     647        char *p1 = NULL;
     648
     649        if (OP_NOP(pgn->type)) {
     650            /*
     651             * this node is only source; use the specific pathname for it
     652             */
     653            parent = pgn->path ? pgn->path : pgn->name;
     654        }
     655        else
     656            parent = Var_Value(TARGET, pgn, &p1);
     657        Var_Append(PARENTS, parent, cgn);
     658        efree(p1);
     659    }
     660    return (0);
     661}
     662#endif
     663
     664
    626665/*-
    627666 *-----------------------------------------------------------------------
     
    651690{
    652691    Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
     692    #ifdef KMK
     693    Lst_ForEach (gn->parents, MakeAddParents, (ClientData) gn);
     694    #endif
    653695
    654696    if (!Var_Exists (OODATE, gn)) {
  • trunk/src/kmk/make.h

    r40 r45  
    291291#define IMPSRC            "<"   /* Source implied by transformation */
    292292#define PREFIX            "*"   /* Common prefix */
     293#ifdef KMK
     294#define PARENTS           "^"   /* Parent of this target (if any) (long name .PARENTS) */
     295#endif
    293296#define ARCHIVE           "!"   /* Archive in "archive(member)" syntax */
    294297#define MEMBER            "%"   /* Member in "archive(member)" syntax */
  • trunk/src/kmk/parse.c

    r42 r45  
    10881088        *line = '\0';
    10891089    } else if (specType == ExShell) {
     1090    #ifdef KMK
     1091        Parse_Error(PARSE_FATAL, "specification not supported by kMk!");
     1092        return;
     1093    #else
    10901094        if (Job_ParseShell (line) != SUCCESS) {
    10911095            Parse_Error (PARSE_FATAL, "improper shell specification");
    10921096            return;
    10931097        }
     1098    #endif
    10941099        *line = '\0';
    10951100    } else if ((specType == NotParallel) || (specType == SingleShell)) {
  • trunk/src/kmk/pathnames.h

    r25 r45  
    3535 */
    3636
     37#ifdef KMK
     38    #undef _PATH_OBJDIR
     39    #undef _PATH_OBJDIRPREFIX
     40    #undef _PATH_DEFSHELLDIR
     41    #define _PATH_DEFSYSMK      "Config.kMk"
     42    #undef _PATH_DEFSYSPATH
     43
     44#else
    3745#ifndef _PATH_OBJDIR
    3846#define _PATH_OBJDIR            "obj"
     
    5058#define _PATH_DEFSYSPATH        "/usr/share/mk"
    5159#endif /* ! _PATH_DEFSYSPATH */
     60#endif
  • trunk/src/kmk/testcase/nmakecond.mak

    r36 r45  
    11!ifndef MAKE
     2!error "MAKE not defined!"
     3!endif
     4
     5!if "$(MAKE)" == ""
    26!error "MAKE not defined!"
    37!endif
     
    812#!endif
    913
    10 !if "$(MAKE)" == ""
    11 !error "MAKE not defined!"
    12 !endif
    1314
    1415
     
    3233
    3334
    34 
    35 
    36 
     35all: #comment
     36# nothing
  • trunk/src/kmk/var.c

    r43 r45  
    306306                        if (!strcmp(name, ".PREFIX"))
    307307                                name = PREFIX;
     308                        #ifdef KMK
     309                        else if (!strcmp(name, ".PARENTS"))
     310                                name = PARENTS;
     311                        #endif
    308312                        break;
    309313                case 'T':
     
    16221626                    case '!':
    16231627                        return("$(.MEMBER)");
     1628                    #ifdef KMK
     1629                    case '^':
     1630                        return("$(.PARENTS)");
     1631                    #endif
    16241632                }
    16251633            }
     
    17721780                    case '*':
    17731781                    case '!':
     1782                    #ifdef KMK
     1783                    case '^':
     1784                    #endif
    17741785                        dynamic = TRUE;
    17751786                        break;
     
    17851796                    (strncmp(str, ".ARCHIVE", len) == 0) ||
    17861797                    (strncmp(str, ".PREFIX", len) == 0) ||
     1798                    #ifdef KMK
     1799                    (strncmp(str, ".PARENTS", len) == 0) ||
     1800                    #endif
    17871801                    (strncmp(str, ".MEMBER", len) == 0))
    17881802                {
Note: See TracChangeset for help on using the changeset viewer.