Changeset 45 for trunk/src/kmk
- Timestamp:
- Apr 3, 2003, 4:23:37 AM (22 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 3 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/cond.c
r35 r45 532 532 #ifdef NMAKE 533 533 case '[': 534 //@todo execute this command!!! 534 /* @todo execute this command!!! */ 535 Parse_Error(PARSE_WARNING, "Unsupported NMAKE construct ([])"); 535 536 t = False; 536 537 condExpr += strlen(condExpr); … … 598 599 599 600 #ifdef NMAKE 601 //@todo entirely support escaped quotes and such nitty pick. 600 602 for (;*condExpr && (fQuoted ? *condExpr != '"' : !isspace((unsigned char) *condExpr)); condExpr++) 603 Buf_AddByte(buf, (Byte)*condExpr); 604 if (fQuoted && *condExpr == '"') 605 condExpr++; 601 606 #else 602 607 for (;*condExpr && !isspace((unsigned char) *condExpr); condExpr++) 608 Buf_AddByte(buf, (Byte)*condExpr); 603 609 #endif 604 Buf_AddByte(buf, (Byte)*condExpr);605 610 606 611 Buf_AddByte(buf, (Byte)'\0'); -
trunk/src/kmk/job.c
r35 r45 46 46 #endif /* not lint */ 47 47 48 #if def NMAKE48 #if defined(NMAKE) || defined(KMK) 49 49 #define OLD_JOKE 1 50 50 #endif … … 190 190 static char tfile[sizeof(TMPPAT)]; 191 191 192 192 #ifndef KMK 193 193 /* 194 194 * Descriptions for various shells. … … 237 237 * executable image */ 238 238 *shellName; /* last component of shell */ 239 #endif /*!KMK*/ 239 240 240 241 … … 326 327 static void JobExec __P((Job *, char **)); 327 328 #endif 329 #ifndef KMK 328 330 static void JobMakeArgv __P((Job *, char **)); 331 #endif 329 332 static void JobRestart __P((Job *)); 330 333 static int JobStart __P((GNode *, int, Job *)); … … 594 597 cmd++; 595 598 599 #ifndef KMK 596 600 if (shutUp) { 597 601 if (!(job->flags & JOB_SILENT) && !noSpecials && … … 602 606 } 603 607 } 608 #endif 604 609 605 610 if (errOff) { 606 611 if ( !(job->flags & JOB_IGNERR) && !noSpecials) { 612 #ifdef KMK 613 errOff = FALSE; 614 #else 607 615 if (commandShell->hasErrCtl) { 608 616 /* … … 650 658 errOff = FALSE; 651 659 } 660 #endif 652 661 } else { 653 662 errOff = FALSE; … … 657 666 DBPRINTF(cmdTemplate, cmd); 658 667 668 #ifndef KMK /*todo*/ 659 669 if (errOff) { 660 670 /* … … 672 682 DBPRINTF("%s\n", commandShell->echoOn); 673 683 } 684 #endif 674 685 return 0; 675 686 } … … 1150 1161 if (strcmp(gn->name,"love") == 0) 1151 1162 (*abortProc)("Not war."); 1152 #if def NMAKE1163 #if defined(NMAKE) || defined(KMK) 1153 1164 else if (strcmp(gn->name,"fire") == 0) 1154 1165 (*abortProc)("No match."); … … 1302 1313 } else 1303 1314 #endif /* REMOTE */ 1315 #ifdef KMK 1316 (void) execv(argv[0], argv); 1317 #else 1304 1318 (void) execv(shellPath, argv); 1319 #endif 1305 1320 1306 1321 (void) write(2, "Could not execute shell\n", … … 1362 1377 } 1363 1378 1379 1364 1380 /*- 1365 1381 *----------------------------------------------------------------------- … … 1382 1398 static char args[10]; /* For merged arguments */ 1383 1399 1400 #ifndef _PATH_DEFSHELLDIR 1401 /* @todo! */ 1402 argv[0] = "c:\\os2\\cmd.exe"; 1403 argc = 1; 1404 #else 1384 1405 argv[0] = shellName; 1385 1406 argc = 1; … … 1415 1436 } 1416 1437 argv[argc] = NULL; 1438 #endif 1417 1439 } 1440 1418 1441 1419 1442 /*- … … 1988 2011 register char *ecp; 1989 2012 2013 #ifndef KMK /* @Todo */ 1990 2014 if (commandShell->noPrint) { 1991 2015 ecp = Str_FindSubstring(cp, commandShell->noPrint); … … 2023 2047 } 2024 2048 } 2049 #endif /*!KMK*/ 2025 2050 return cp; 2026 2051 } … … 2462 2487 } 2463 2488 2489 #ifndef KMK 2464 2490 if (shellPath == NULL) { 2465 2491 /* … … 2480 2506 commandShell->echo = ""; 2481 2507 } 2508 #endif 2482 2509 2483 2510 /* … … 2588 2615 } 2589 2616 2617 #ifndef KMK 2590 2618 /*- 2591 2619 *----------------------------------------------------------------------- … … 2629 2657 return(match == NULL ? sh : match); 2630 2658 } 2631 2659 #endif /*!KMK*/ 2660 2661 #ifndef KMK 2632 2662 /*- 2633 2663 *----------------------------------------------------------------------- … … 2793 2823 return SUCCESS; 2794 2824 } 2825 #endif /*!KMK*/ 2795 2826 2796 2827 /*- -
trunk/src/kmk/main.c
r40 r45 79 79 */ 80 80 81 #if defined(USE_KLIB) || defined(KMK)81 #if defined(USE_KLIB) //|| defined(KMK) 82 82 #define KLIB_INSTRICT 83 83 #include <kLib/kLib.h> … … 533 533 char *cp = NULL, *start; 534 534 /* avoid faults on read-only strings */ 535 #ifndef KMK 535 536 static char syspath[] = _PATH_DEFSYSPATH; 537 #endif 536 538 537 539 #ifdef RLIMIT_NOFILE … … 634 636 } 635 637 638 #ifdef KMK 639 /* @todo figure out how to set object directory! */ 640 #else 636 641 /* 637 642 * The object directory location is determined using the … … 675 680 objdir = curdir; 676 681 } 682 #endif 677 683 678 684 #ifdef WANT_ENV_PWD … … 794 800 795 801 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 796 828 /* 797 829 * If no user-supplied system path was given (through the -m option) … … 811 843 } 812 844 } 845 #endif 813 846 814 847 /* -
trunk/src/kmk/make.c
r25 r45 624 624 625 625 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 */ 638 static int 639 MakeAddParents (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 626 665 /*- 627 666 *----------------------------------------------------------------------- … … 651 690 { 652 691 Lst_ForEach (gn->children, MakeAddAllSrc, (ClientData) gn); 692 #ifdef KMK 693 Lst_ForEach (gn->parents, MakeAddParents, (ClientData) gn); 694 #endif 653 695 654 696 if (!Var_Exists (OODATE, gn)) { -
trunk/src/kmk/make.h
r40 r45 291 291 #define IMPSRC "<" /* Source implied by transformation */ 292 292 #define PREFIX "*" /* Common prefix */ 293 #ifdef KMK 294 #define PARENTS "^" /* Parent of this target (if any) (long name .PARENTS) */ 295 #endif 293 296 #define ARCHIVE "!" /* Archive in "archive(member)" syntax */ 294 297 #define MEMBER "%" /* Member in "archive(member)" syntax */ -
trunk/src/kmk/parse.c
r42 r45 1088 1088 *line = '\0'; 1089 1089 } else if (specType == ExShell) { 1090 #ifdef KMK 1091 Parse_Error(PARSE_FATAL, "specification not supported by kMk!"); 1092 return; 1093 #else 1090 1094 if (Job_ParseShell (line) != SUCCESS) { 1091 1095 Parse_Error (PARSE_FATAL, "improper shell specification"); 1092 1096 return; 1093 1097 } 1098 #endif 1094 1099 *line = '\0'; 1095 1100 } else if ((specType == NotParallel) || (specType == SingleShell)) { -
trunk/src/kmk/pathnames.h
r25 r45 35 35 */ 36 36 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 37 45 #ifndef _PATH_OBJDIR 38 46 #define _PATH_OBJDIR "obj" … … 50 58 #define _PATH_DEFSYSPATH "/usr/share/mk" 51 59 #endif /* ! _PATH_DEFSYSPATH */ 60 #endif -
trunk/src/kmk/testcase/nmakecond.mak
r36 r45 1 1 !ifndef MAKE 2 !error "MAKE not defined!" 3 !endif 4 5 !if "$(MAKE)" == "" 2 6 !error "MAKE not defined!" 3 7 !endif … … 8 12 #!endif 9 13 10 !if "$(MAKE)" == ""11 !error "MAKE not defined!"12 !endif13 14 14 15 … … 32 33 33 34 34 35 36 35 all: #comment 36 # nothing -
trunk/src/kmk/var.c
r43 r45 306 306 if (!strcmp(name, ".PREFIX")) 307 307 name = PREFIX; 308 #ifdef KMK 309 else if (!strcmp(name, ".PARENTS")) 310 name = PARENTS; 311 #endif 308 312 break; 309 313 case 'T': … … 1622 1626 case '!': 1623 1627 return("$(.MEMBER)"); 1628 #ifdef KMK 1629 case '^': 1630 return("$(.PARENTS)"); 1631 #endif 1624 1632 } 1625 1633 } … … 1772 1780 case '*': 1773 1781 case '!': 1782 #ifdef KMK 1783 case '^': 1784 #endif 1774 1785 dynamic = TRUE; 1775 1786 break; … … 1785 1796 (strncmp(str, ".ARCHIVE", len) == 0) || 1786 1797 (strncmp(str, ".PREFIX", len) == 0) || 1798 #ifdef KMK 1799 (strncmp(str, ".PARENTS", len) == 0) || 1800 #endif 1787 1801 (strncmp(str, ".MEMBER", len) == 0)) 1788 1802 {
Note:
See TracChangeset
for help on using the changeset viewer.