Changeset 46 for trunk/src


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.

Location:
trunk/src/kmk
Files:
16 edited

Legend:

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

    r35 r46  
    117117# endif
    118118#endif
     119
     120#ifdef USE_ARCHIVES
     121
    119122
    120123static Lst        archives;   /* Lst of archives we've already examined */
     
    12531256    Lst_Destroy(archives, ArchFree);
    12541257}
     1258
     1259#endif /* USE_ARCHIVES */
  • trunk/src/kmk/config.h

    r25 r46  
    120120# endif
    121121#endif
     122
     123
     124
     125
     126
     127/*
     128 * Inline file support.
     129 */
     130#if defined(NMAKE) || defined(KMK)
     131#define USE_INLINEFILES 1
     132#endif
     133
     134
     135/*
     136 * No requirement to use tabs in front of commands.
     137 */
     138#if defined(NMAKE) || defined(KMK)
     139#define USE_NO_STUPID_TABS 1
     140#endif
     141
     142
     143/*
     144 * Use the archive stuff.
     145 */
     146#if !defined(NMAKE) && !defined(KMK)
     147#define USE_ARCHIVES 1
     148#endif
     149
     150
     151/*
     152 * USE_PARENTS
     153 *      If defined .PARENTS (^) is defined a local variable.
     154 */
     155#if defined(KMK)
     156#define USE_PARENTS 1
     157#endif
     158
     159
     160/*
     161 * MAKE_NAME
     162 *      The name of the make program as shown in the messages.
     163 */
     164#if defined(KMK)
     165#define MAKE_NAME "kMk"
     166#else
     167#define MAKE_NAME "make"
     168#endif
     169
     170
     171
  • trunk/src/kmk/dir.c

    r35 r46  
    978978    Hash_Entry    *entry;
    979979
     980    #ifdef USE_ARCHIVES
    980981    if (gn->type & OP_ARCHV) {
    981982        return Arch_MTime (gn);
    982     } else if (gn->path == (char *)NULL) {
     983    } else
     984    #endif
     985        if (gn->path == (char *)NULL) {
    983986        fullName = Dir_FindFile (gn->name, dirSearchPath);
    984987    } else {
     
    10041007        Hash_DeleteEntry(&mtimes, entry);
    10051008    } else if (stat (fullName, &stb) < 0) {
     1009        #ifdef USE_ARCHIVES
    10061010        if (gn->type & OP_MEMBER) {
    10071011            if (fullName != gn->path)
    10081012                efree(fullName);
    10091013            return Arch_MemMTime (gn);
    1010         } else {
     1014        } else
     1015        #endif
    10111016            stb.st_mtime = 0;
    1012         }
    10131017    }
    10141018    if (fullName && gn->path == (char *)NULL) {
  • trunk/src/kmk/job.c

    r45 r46  
    10671067    }
    10681068
     1069#ifdef USE_ARCHIVES
    10691070    if (gn->type & OP_ARCHV) {
    10701071        Arch_Touch(gn);
     
    10721073        Arch_TouchLib(gn);
    10731074    } else {
     1075#else
     1076    {
     1077#endif
     1078
    10741079        char    *file = gn->path ? gn->path : gn->name;
    10751080
     
    11201125                        /* Function to abort with message */
    11211126{
    1122     if (OP_NOP(gn->type) && Lst_IsEmpty(gn->commands) &&
    1123         (gn->type & OP_LIB) == 0) {
     1127    if (OP_NOP(gn->type) && Lst_IsEmpty(gn->commands)
     1128#ifdef USE_ARCHIVES
     1129        && (gn->type & OP_LIB) == 0
     1130#endif
     1131        )
     1132    {
    11241133        /*
    11251134         * No commands. Look for .DEFAULT rule from which we might infer
     
    11481157             * this node's parents so they never get examined.
    11491158             */
    1150             static const char msg[] = "make: don't know how to make";
     1159            static const char msg[] = MAKE_NAME ": don't know how to make";
    11511160
    11521161            if (gn->type & OP_OPTIONAL) {
     
    11621171                    (*abortProc)("Not war.");
    11631172#if defined(NMAKE) || defined(KMK)
    1164         else if (strcmp(gn->name,"fire") == 0)
     1173                else if (strcmp(gn->name,"fire") == 0)
    11651174                    (*abortProc)("No match.");
    11661175#endif
    1167         else
     1176                else
    11681177#endif
    11691178                    (*abortProc)("%s %s. Stop", msg, gn->name);
  • trunk/src/kmk/kMk-emx.mak

    r45 r46  
    33
    44CC = gcc
    5 #CC = gcc -Zomf
     5CC = gcc -Zomf
    66CFLAGS = -g -I. -I./include -I../kLib/Generic/include \
    77#                -DUSE_KLIB \
    88         -Dregister= \
    99                 -DKMK \
    10          -DOS2 -D__i386__ -D__32BIT__ -DNMAKE -DMACHINE=\"ibmos2\" -DMACHINE_ARCH=\"x86\" -DMACHINE_CPU=\"386\" \
     10#                -DNMAKE \
     11         -DOS2 -D__i386__ -D__32BIT__ -DMACHINE=\"ibmos2\" -DMACHINE_ARCH=\"x86\" -DMACHINE_CPU=\"386\" \
    1112
    1213OBJDIR=obj.ke
  • trunk/src/kmk/main.c

    r45 r46  
    275275                                        break;
    276276                                case 'a':
     277#ifdef USE_ARCHIVES
    277278                                        debug |= DEBUG_ARCH;
     279#endif /* else ignore */
    278280                                        break;
    279281                                case 'c':
     
    606608
    607609            if (uname(&utsname) == -1) {
    608                     perror("make: uname");
     610                    perror(MAKE_NAME ": uname");
    609611                    exit(2);
    610612            }
     
    775777         * parsing the makefile(s)
    776778         */
     779#ifdef USE_ARCHIVES
    777780        Arch_Init();
     781#endif
    778782        Targ_Init();
    779783        Suff_Init();
     
    855859                sysMkPath = Lst_Init (FALSE);
    856860                Dir_Expand (_PATH_DEFSYSMK, sysIncPath, sysMkPath);
    857                 #ifdef NMAKE
     861#ifdef NMAKE
    858862                if (!Lst_IsEmpty(sysMkPath))
    859863                {
    860864                    ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
    861865                    if (ln != NILLNODE)
    862                             Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
     866                            Fatal(MAKE_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
    863867                }
    864                 /* Fatal("make: no system rules (%s).", _PATH_DEFSYSMK); */
    865                 #else
     868
     869#elif defined(KMK)
     870                if (!Lst_IsEmpty(sysMkPath))
     871                {
     872                    ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
     873                    if (ln != NILLNODE)
     874                            Fatal(MAKE_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
     875
     876                }
     877                Error(MAKE_NAME ": no config rules (%s).", _PATH_DEFSYSMK);
     878#else
    866879                if (Lst_IsEmpty(sysMkPath))
    867                         Fatal("make: no system rules (%s).", _PATH_DEFSYSMK);
     880                        Fatal(MAKE_NAME ": no system rules (%s).", _PATH_DEFSYSMK);
    868881                ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
    869882                if (ln != NILLNODE)
    870                         Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
    871                 #endif
     883                        Fatal(MAKE_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
     884#endif
    872885        }
    873886
     
    877890                ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
    878891                if (ln != NILLNODE)
    879                         Fatal("make: cannot open %s.", (char *)Lst_Datum(ln));
     892                        Fatal(MAKE_NAME ": cannot open %s.", (char *)Lst_Datum(ln));
    880893        } else
    881894            #ifdef KMK
     
    10251038        Suff_End();
    10261039        Targ_End();
     1040#ifdef USE_ARCHIVES
    10271041        Arch_End();
     1042#endif
    10281043        str_end();
    10291044        Var_End();
     
    13571372#endif
    13581373
    1359         (void)fprintf(stderr, "make: ");
     1374        (void)fprintf(stderr, MAKE_NAME ": ");
    13601375        (void)vfprintf(stderr, fmt, ap);
    13611376        va_end(ap);
     
    15031518        (void)fprintf(stderr, "%s\n%s\n%s\n"
    15041519#ifdef NMAKE
     1520"%s\n"
     1521#endif
     1522#ifdef KMK
    15051523"%s\n"
    15061524#endif
     
    15111529#ifdef NMAKE
    15121530,"NMAKE compatible mode enabled."
    1513 
     1531#endif
     1532#ifdef KMK
     1533,"kMk extensions enabled."
    15141534#endif
    15151535);
  • trunk/src/kmk/make.c

    r45 r46  
    194194        }
    195195        oodate = FALSE;
     196#ifdef USE_ARCHIVES
    196197    } else if (gn->type & OP_LIB) {
    197198        if (DEBUG(MAKE)) {
     
    205206        oodate = Arch_LibOODate (gn) ||
    206207            ((gn->cmtime == 0) && (gn->type & OP_DOUBLEDEP));
     208#endif
    207209    } else if (gn->type & OP_JOIN) {
    208210        /*
     
    624626
    625627
    626 #ifdef KMK
     628#ifdef USE_PARENTS
    627629/*-
    628630 *-----------------------------------------------------------------------
     
    637639 */
    638640static int
    639 MakeAddParents (cgnp, pgnp)
     641MakeAddParents (pgnp, cgnp)
    640642    ClientData  pgnp;   /* The parent to add to add */
    641643    ClientData  cgnp;   /* The child to whose PARENTS variable it should be */
     
    647649        char *p1 = NULL;
    648650
    649         if (OP_NOP(pgn->type)) {
    650             /*
    651              * this node is only source; use the specific pathname for it
    652              */
     651
     652        if (OP_NOP(pgn->type) || !(parent = Var_Value(TARGET, pgn, &p1))) {
     653            /* this node is only source; use the specific pathname for it */
    653654            parent = pgn->path ? pgn->path : pgn->name;
    654         }
    655         else
    656             parent = Var_Value(TARGET, pgn, &p1);
     655        }
    657656        Var_Append(PARENTS, parent, cgn);
    658657        efree(p1);
     
    690689{
    691690    Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn);
    692     #ifdef KMK
     691#ifdef USE_PARENTS
    693692    Lst_ForEach (gn->parents, MakeAddParents, (ClientData) gn);
    694     #endif
     693#endif
    695694
    696695    if (!Var_Exists (OODATE, gn)) {
  • trunk/src/kmk/make.h

    r45 r46  
    218218/* Attributes applied by PMake */
    219219#define OP_TRANSFORM    0x80000000  /* The node is a transformation rule */
     220#ifdef USE_ARCHIVES
    220221#define OP_MEMBER       0x40000000  /* Target is a member of an archive */
    221222#define OP_LIB          0x20000000  /* Target is a library */
    222223#define OP_ARCHV        0x10000000  /* Target is an archive construct */
     224#endif
    223225#define OP_HAS_COMMANDS 0x08000000  /* Target has all the commands it should.
    224226                                     * Used when parsing to catch multiple
     
    294296#define PARENTS           "^"   /* Parent of this target (if any) (long name .PARENTS) */
    295297#endif
     298#ifdef USE_ARCHIVES
    296299#define ARCHIVE           "!"   /* Archive in "archive(member)" syntax */
    297300#define MEMBER            "%"   /* Member in "archive(member)" syntax */
     301#endif
    298302
    299303#define FTARGET           "@F"  /* file part of TARGET */
     
    361365 */
    362366extern int debug;
     367#ifdef USE_ARCHIVES
    363368#define DEBUG_ARCH      0x0001
     369#endif
    364370#define DEBUG_COND      0x0002
    365371#define DEBUG_DIR       0x0004
  • trunk/src/kmk/nonints.h

    r35 r46  
    4141
    4242/* arch.c */
     43#ifdef USE_ARCHIVES
    4344ReturnStatus Arch_ParseArchive __P((char **, Lst, GNode *));
    4445void Arch_Touch __P((GNode *));
     
    5051void Arch_Init __P((void));
    5152void Arch_End __P((void));
     53#endif
    5254
    5355/* compat.c */
     
    110112void Suff_DoPaths __P((void));
    111113void Suff_AddInclude __P((char *));
     114#ifdef USE_ARCHIVES
    112115void Suff_AddLib __P((char *));
     116#endif
    113117void Suff_FindDeps __P((GNode *));
    114118void Suff_SetNull __P((char *));
  • 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
  • trunk/src/kmk/pathnames.h

    r45 r46  
    3636
    3737#ifdef KMK
    38     #undef _PATH_OBJDIR
     38    #define _PATH_OBJDIR        "obj"
    3939    #undef _PATH_OBJDIRPREFIX
    4040    #undef _PATH_DEFSHELLDIR
    41     #define _PATH_DEFSYSMK      "Config.kMk"
     41    #define _PATH_DEFSYSMK      "config.kMk"
    4242    #undef _PATH_DEFSYSPATH
    4343
  • trunk/src/kmk/suff.c

    r35 r46  
    117117    short        flags;         /* Type of suffix */
    118118#define SUFF_INCLUDE      0x01      /* One which is #include'd */
     119#ifdef USE_ARCHIVES
    119120#define SUFF_LIBRARY      0x02      /* One which contains a library */
     121#endif
    120122#define SUFF_NULL         0x04      /* The empty suffix */
    121123    Lst          searchPath;    /* The path along which files of this suffix
     
    177179static Boolean SuffApplyTransform __P((GNode *, GNode *, Suff *, Suff *));
    178180static void SuffFindDeps __P((GNode *, Lst));
     181#ifdef USE_ARCHIVES
    179182static void SuffFindArchiveDeps __P((GNode *, Lst));
     183#endif
    180184static void SuffFindNormalDeps __P((GNode *, Lst));
    181185static int SuffPrintName __P((ClientData, ClientData));
     
    892896            }
    893897#endif /* INCLUDES */
     898#ifdef USE_ARCHIVES
    894899#ifdef LIBRARIES
    895900            if (s->flags & SUFF_LIBRARY) {
     
    897902            }
    898903#endif /* LIBRARIES */
     904#endif
    899905            Dir_Concat(s->searchPath, dirSearchPath);
    900906        } else {
     
    944950}
    945951
     952#ifdef USE_ARCHIVES
    946953/*-
    947954 *-----------------------------------------------------------------------
     
    973980    }
    974981}
     982#endif /* USE_ARCHIVES */
    975983
    976984          /********** Implicit Source Search Functions *********/
     
    13471355            Lst     members = Lst_Init(FALSE);
    13481356
     1357#ifdef USE_ARCHIVES
    13491358            if (cgn->type & OP_ARCHV) {
    13501359                /*
     
    13561365
    13571366                (void)Arch_ParseArchive(&sacrifice, members, pgn);
    1358             } else {
     1367            } else
     1368#endif
     1369            {
    13591370                /*
    13601371                 * Break the result into a vector of strings whose nodes
     
    16491660
    16501661
     1662#ifdef USE_ARCHIVES
    16511663/*-
    16521664 *-----------------------------------------------------------------------
     
    17851797    mem->type |= OP_MEMBER;
    17861798}
     1799#endif /* USE_ARCHIVES */
    17871800
    17881801/*-
     
    20562069    }
    20572070
     2071#ifdef USE_ARCHIVES
    20582072    /*
    20592073     * If the suffix indicates that the target is a library, mark that in
     
    20632077        gn->type |= OP_LIB;
    20642078    }
     2079#endif
    20652080
    20662081    /*
     
    22262241    }
    22272242
     2243#ifdef USE_ARCHIVES
    22282244    if (gn->type & OP_ARCHV) {
    22292245        SuffFindArchiveDeps(gn, slst);
     
    22572273         */
    22582274        Var_Set(PREFIX, "", gn);
    2259     } else {
     2275    } else
     2276#endif /* USE_ARCHIVES */
    22602277        SuffFindNormalDeps(gn, slst);
    2261     }
    22622278}
    22632279
     
    24042420                    printf ("INCLUDE");
    24052421                    break;
     2422#ifdef USE_ARCHIVES
    24062423                case SUFF_LIBRARY:
    24072424                    printf ("LIBRARY");
    24082425                    break;
     2426#endif
    24092427            }
    24102428            fputc(flags ? '|' : ')', stdout);
  • trunk/src/kmk/targ.c

    r35 r46  
    166166    gn->name = estrdup (name);
    167167    gn->path = (char *) 0;
     168#ifdef USE_ARCHIVES
    168169    if (name[0] == '-' && name[1] == 'l') {
    169170        gn->type = OP_LIB;
     
    171172        gn->type = 0;
    172173    }
     174#else
     175    gn->type = 0;
     176#endif
    173177    gn->unmade =        0;
    174178    gn->make =          FALSE;
     
    517521            PRINTBIT(INVISIBLE);
    518522            PRINTBIT(NOTMAIN);
     523#ifdef USE_ARCHIVES
    519524            PRINTDBIT(LIB);
    520             /*XXX: MEMBER is defined, so CONCAT(OP_,MEMBER) gives OP_"%" */
     525            /*XXX: MEMBER is defined, so CONCAT(OP_,MEMBER) gives OP_"%" */
    521526            case OP_MEMBER: if (DEBUG(TARG)) printf(".MEMBER "); break;
    522527            PRINTDBIT(ARCHV);
     528#endif
    523529        }
    524530    }
  • trunk/src/kmk/testcase/parent.kMk

    r45 r46  
     1# infernece rules.
     2.SUFFIXES: .c .o .obj
     3.c.obj:
     4        echo compiling $< into $@ for $(.PARENTS) while .IMPSRC is $(.IMPSRC)
    15
     6# the rules/targets.
    27all: parent
    38
     9parent: child child2
     10    echo "parent: $(.PARENTS)"
    411
    5 parent: child
    6     echo parent: ${.PARENTS}
     12child: arch.obj
     13        echo "child: .PARENTS = $(.PARENTS)"
     14        echo "child: .TARGET  = $(.TARGET)"
     15        echo "child: .IMPSRC  = $(.IMPSRC)"
    716
    817
    9 child:
    10     echo child: ${.PARENTS}
    11 
    12 
     18child2: arch.obj hash.obj
     19        echo "child2: .PARENTS = $(.PARENTS)"
     20        echo "child2: .TARGET  = $(.TARGET)"
     21        echo "child2: .IMPSRC  = $(.IMPSRC)"
     22               
  • trunk/src/kmk/testcase/smoketest.kMk

    r45 r46  
    22
    33
    4 notall: # comment
     4notall:     # comment
    55    echo notall, but it's the first rule.
    66
     7
     8#.MAIN: all
    79
    810all:
  • trunk/src/kmk/var.c

    r45 r46  
    288288                        if (!strcmp(name, ".ALLSRC"))
    289289                                name = ALLSRC;
     290#ifdef USE_ARCHIVES
    290291                        if (!strcmp(name, ".ARCHIVE"))
    291292                                name = ARCHIVE;
     293#endif
    292294                        break;
    293295                case 'I':
     
    295297                                name = IMPSRC;
    296298                        break;
     299#ifdef USE_ARCHIVES
    297300                case 'M':
    298301                        if (!strcmp(name, ".MEMBER"))
    299302                                name = MEMBER;
    300303                        break;
     304#endif
    301305                case 'O':
    302306                        if (!strcmp(name, ".OODATE"))
     
    306310                        if (!strcmp(name, ".PREFIX"))
    307311                                name = PREFIX;
    308                         #ifdef KMK
     312                        #ifdef USE_PARENTS
    309313                        else if (!strcmp(name, ".PARENTS"))
    310314                                name = PARENTS;
     
    16261630                    case '!':
    16271631                        return("$(.MEMBER)");
    1628                     #ifdef KMK
     1632                    #ifdef USE_PARENTS
    16291633                    case '^':
    16301634                        return("$(.PARENTS)");
     
    17801784                    case '*':
    17811785                    case '!':
    1782                     #ifdef KMK
     1786                    #ifdef USE_PARENTS
    17831787                    case '^':
    17841788                    #endif
     
    17961800                    (strncmp(str, ".ARCHIVE", len) == 0) ||
    17971801                    (strncmp(str, ".PREFIX", len) == 0) ||
    1798                     #ifdef KMK
     1802                    #ifdef USE_PARENTS
    17991803                    (strncmp(str, ".PARENTS", len) == 0) ||
    18001804                    #endif
Note: See TracChangeset for help on using the changeset viewer.