Changeset 3129
- Timestamp:
- Mar 16, 2000, 10:10:11 PM (25 years ago)
- Location:
- trunk/tools/fastdep
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/tools/fastdep/fastdep.c ¶
r3123 r3129 1 /* $Id: fastdep.c,v 1. 8 2000-03-16 15:27:08bird Exp $1 /* $Id: fastdep.c,v 1.9 2000-03-16 21:10:11 bird Exp $ 2 2 * 3 3 * Fast dependents. (Fast = Quick and Dirty!) … … 23 23 #include <string.h> 24 24 #include <stdlib.h> 25 26 #include "avl.h" 27 28 #ifndef INLINE 29 # if defined(__IBMC__) 30 # define INLINE _Inline 31 # elif defined(__IBMCPP__) 32 # define INLINE inline 33 # else 34 # error "unknown compiler - inline keyword unknown!" 35 # endif 36 #endif 25 37 26 38 /* … … 86 98 * Language specific analysis functions type. 87 99 */ 88 typedef int ( _FNLANG) (const char *pszFilename, FILE *phFile,100 typedef int ( _FNLANG) (const char *pszFilename, void *pvFile, 89 101 BOOL fHeader, POPTIONS pOptions); 90 102 typedef _FNLANG *PFNLANG; … … 117 129 118 130 131 /** 132 * Filename cache entry. 133 */ 134 #define FCACHEENTRY AVLNODECORE 135 #define PFCACHEENTRY PAVLNODECORE 136 137 119 138 /******************************************************************************* 120 139 * Internal Functions * … … 123 142 static int makeDependent(const char *pszFilename, POPTIONS pOptions); 124 143 125 int langC_CPP(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions);126 int langAsm(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions);127 int langRC(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions);128 int langCOBOL(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions);144 int langC_CPP(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions); 145 int langAsm(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions); 146 int langRC(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions); 147 int langCOBOL(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions); 129 148 130 149 … … 139 158 char *fileExt(const char *pszFilename, char *pszBuffer); 140 159 160 /* filecache operations */ 161 static BOOL filecacheAdd(const char *pszFilename); 162 static BOOL filecacheFind(const char *pszFilename); 163 141 164 /* pathlist operations */ 142 char *pathlistFindFile(const char *pszPathList, const char *pszFilename, char *pszBuffer);165 static char *pathlistFindFile(const char *pszPathList, const char *pszFilename, char *pszBuffer); 143 166 144 167 /* word operations */ … … 152 175 153 176 /* text helpers */ 154 staticchar *trim(char *psz);155 staticchar *trimR(char *psz);177 INLINE char *trim(char *psz); 178 INLINE char *trimR(char *psz); 156 179 157 180 /* textbuffer */ … … 159 182 static void textbufferDestroy(void *pvBuffer); 160 183 static char *textbufferNextLine(void *pvBuffer, char *psz); 184 static char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer); 161 185 162 186 /* depend workers */ … … 166 190 static void *depAddRule(const char *pszRulePath, const char *pszName, const char *pszExt); 167 191 static BOOL depAddDepend(void *pvRule, const char *pszDep); 168 192 #if 0 /* not used */ 169 193 static BOOL depCleanFile(const char *pszFilename); 194 #endif 170 195 171 196 … … 173 198 * Global Variables * 174 199 *******************************************************************************/ 200 /* 201 * Pointer to the list of dependencies. 202 */ 175 203 static PDEPRULE pdepList = NULL; 176 204 205 /* 206 * Filecache - tree starts here. 207 */ 208 static PFCACHEENTRY pfcTree = NULL; 209 static unsigned cfcNodes = 0; 210 211 212 /* 213 * Configuration stuff. 214 */ 177 215 static const char pszDefaultDepFile[] = ".depend"; 178 216 static const char *apszExtC_CPP[] = {"c", "sqc", "cpp", "h", "hpp", NULL}; … … 422 460 423 461 /* 462 * If append option is specified we'll have to read the existing dep file 463 * before starting adding new dependencies. 464 */ 465 if (pdepList == NULL && options.fAppend) 466 depReadFile(pszDepFile); 467 468 /* 424 469 * Search for the files specified. 425 470 */ … … 461 506 if (!depWriteFile(pszDepFile)) 462 507 fprintf(stderr, "error: failed to write dependencies file!\n"); 508 #if 0 509 printf("cfcNodes=%d\n", cfcNodes); 510 #endif 463 511 464 512 return rc; … … 518 566 { 519 567 int rc = -1; 520 FILE *phFile;521 522 p hFile = fopen(pszFilename, "r");523 if (p hFile != NULL)568 void * pvFile; 569 570 pvFile = textbufferCreate(pszFilename); 571 if (pvFile != NULL) 524 572 { 525 573 char szExt[CCHMAXPATH]; … … 546 594 /* Found? */ 547 595 if (pCfg->papszExts != NULL) 548 rc = (*pCfg->pfn)(pszFilename, p hFile, fHeader, pOptions);596 rc = (*pCfg->pfn)(pszFilename, pvFile, fHeader, pOptions); 549 597 else 550 598 { … … 554 602 } 555 603 556 fclose(phFile);604 textbufferDestroy(pvFile); 557 605 } 558 606 else … … 569 617 * !0 on error. 570 618 * @param pszFilename Pointer to source filename. 571 * @param p hFile Pointer to source file handle.619 * @param pvFile Pointer to file textbuffer. 572 620 * @param pOptions Pointer to options struct. 573 621 * @status completely implemented. 574 622 * @author knut st. osmundsen 575 623 */ 576 int langC_CPP(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions)624 int langC_CPP(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions) 577 625 { 578 626 void * pvRule; /* Handle to the current rule. */ 627 char szBuffer[4096]; /* Max line length is 4096... should not be a problem. */ 579 628 int iLine; /* Linenumber. */ 580 char szBuffer[4096]; /* Max line length is 4096... should not be a problem. */629 void * pv = NULL; /* An index used by textbufferGetNextLine. */ 581 630 BOOL fComment; /* TRUE when within a multiline comment. */ 582 631 /* FALSE when not within a multiline comment. */ … … 630 679 fComment = FALSE; 631 680 iLine = 0; 632 while (!feof(phFile)) /* line loop */ 633 { 634 if (fgets(szBuffer, sizeof(szBuffer), phFile) != NULL) 681 while (textbufferGetNextLine(pvFile, &pv, szBuffer, sizeof(szBuffer)) != NULL) /* line loop */ 682 { 683 /* search for #include */ 684 register char *pszC; 685 int cbLen; 686 int i = 0; 687 iLine++; 688 689 /* skip blank chars */ 690 cbLen = strlen(szBuffer); 691 while (i + 2 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 692 i++; 693 694 /* preprocessor statement? */ 695 if (!fComment && szBuffer[i] == '#') 635 696 { 636 /* search for #include */ 637 register char *pszC; 638 int cbLen; 639 int i = 0; 640 iLine++; 641 642 /* skip blank chars */ 643 cbLen = strlen(szBuffer); 644 while (i + 2 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 697 /* 698 * Preprocessor checks 699 * We known that we have a preprocessor statment (starting with an '#' * at szBuffer[i]). 700 * Depending on the word afterwards we'll take some different actions. 701 * So we'll start of by extracting that word and make a string swich on it. 702 * Note that there might be some blanks between the hash and the word. 703 */ 704 int cchWord; 705 char * pszEndWord; 706 char * pszArgument; 707 i++; /* skip hash ('#') */ 708 while (szBuffer[i] == '\t' || szBuffer[i] == ' ') /* skip blanks */ 645 709 i++; 646 647 /* preprocessor statement? */ 648 if (!fComment && szBuffer[i] == '#') 710 pszArgument = pszEndWord = findEndOfWord(&szBuffer[i]); 711 cchWord = pszEndWord - &szBuffer[i]; 712 713 /* 714 * Find the argument by skipping the blanks. 715 */ 716 while (*pszArgument == '\t' || *pszArgument == ' ') /* skip blanks */ 717 pszArgument++; 718 719 /* 720 * string switch. 721 */ 722 if (strncmp(&szBuffer[i], "include", cchWord) == 0) 649 723 { 650 724 /* 651 * Preprocessor checks 652 * We known that we have a preprocessor statment (starting with an '#' * at szBuffer[i]). 653 * Depending on the word afterwards we'll take some different actions. 654 * So we'll start of by extracting that word and make a string swich on it. 655 * Note that there might be some blanks between the hash and the word. 725 * #include 726 * 727 * Are we in a state where this file is to be included? 656 728 */ 657 int cchWord; 658 char * pszEndWord; 659 char * pszArgument; 660 i++; /* skip hash ('#') */ 661 while (szBuffer[i] == '\t' || szBuffer[i] == ' ') /* skip blanks */ 662 i++; 663 pszArgument = pszEndWord = findEndOfWord(&szBuffer[i]); 664 cchWord = pszEndWord - &szBuffer[i]; 665 729 if (achIfStack[iIfStack].fIncluded) 730 { 731 char szFullname[CCHMAXPATH]; 732 char *psz; 733 BOOL f = FALSE; 734 int j; 735 736 /* extract info between "" or <> */ 737 while (i < cbLen && !(f = (szBuffer[i] == '"' || szBuffer[i] == '<'))) 738 i++; 739 i++; /* skip '"' or '<' */ 740 741 /* if invalid statement then continue with the next line! */ 742 if (!f) continue; 743 744 /* find end */ 745 j = f = 0; 746 while (i + j < cbLen && j < CCHMAXPATH && 747 !(f = (szBuffer[i+j] == '"' || szBuffer[i+j] == '>'))) 748 j++; 749 750 /* if invalid statement then continue with the next line! */ 751 if (!f) continue; 752 753 /* copy filename */ 754 strncpy(szFullname, &szBuffer[i], j); 755 szFullname[j] = '\0'; /* ensure terminatition. */ 756 757 /* find include file! */ 758 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 759 if (psz == NULL) 760 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 761 762 /* did we find the include? */ 763 if (psz != NULL) 764 { 765 char szBuffer2[CCHMAXPATH]; 766 if (pOptions->fExcludeAll || 767 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 768 ) 769 depAddDepend(pvRule, szFullname); 770 else 771 depAddDepend(pvRule, szBuffer); 772 } 773 else 774 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 775 pszFilename, iLine, szFullname); 776 } 777 } 778 else 666 779 /* 667 * Find the argument by skipping the blanks.780 * #if 668 781 */ 669 while (*pszArgument == '\t' || *pszArgument == ' ') /* skip blanks */ 670 pszArgument++; 671 672 /* 673 * string switch. 674 */ 675 if (strncmp(&szBuffer[i], "include", cchWord) == 0) 782 if (strncmp(&szBuffer[i], "if", cchWord) == 0) 783 { /* #if 0 and #if <1-9> are supported */ 784 pszEndWord = findEndOfWord(pszArgument); 785 iIfStack++; 786 if ((pszEndWord - pszArgument) == 1 787 && *pszArgument >= '0' && *pszArgument <= '9') 676 788 { 677 /* 678 * #include 679 * 680 * Are we in a state where this file is to be included? 681 */ 682 if (achIfStack[iIfStack].fIncluded) 683 { 684 char szFullname[CCHMAXPATH]; 685 char *psz; 686 BOOL f = FALSE; 687 int j; 688 689 /* extract info between "" or <> */ 690 while (i < cbLen && !(f = (szBuffer[i] == '"' || szBuffer[i] == '<'))) 691 i++; 692 i++; /* skip '"' or '<' */ 693 694 /* if invalid statement then continue with the next line! */ 695 if (!f) continue; 696 697 /* find end */ 698 j = f = 0; 699 while (i + j < cbLen && j < CCHMAXPATH && 700 !(f = (szBuffer[i+j] == '"' || szBuffer[i+j] == '>'))) 701 j++; 702 703 /* if invalid statement then continue with the next line! */ 704 if (!f) continue; 705 706 /* copy filename */ 707 strncpy(szFullname, &szBuffer[i], j); 708 szFullname[j] = '\0'; /* ensure terminatition. */ 709 710 /* find include file! */ 711 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 712 if (psz == NULL) 713 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 714 715 /* did we find the include? */ 716 if (psz != NULL) 717 { 718 char szBuffer2[CCHMAXPATH]; 719 if (pOptions->fExcludeAll || 720 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 721 ) 722 depAddDepend(pvRule, szFullname); 723 else 724 depAddDepend(pvRule, szBuffer); 725 } 726 else 727 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 728 pszFilename, iLine, szFullname); 729 } 789 if (*pszArgument != '0') 790 achIfStack[iIfStack].fIncluded = TRUE; 791 else 792 achIfStack[iIfStack].fIncluded = FALSE; 730 793 } 731 794 else 732 /* 733 * #if 734 */ 735 if (strncmp(&szBuffer[i], "if", cchWord) == 0) 736 { /* #if 0 and #if <1-9> are supported */ 737 pszEndWord = findEndOfWord(pszArgument); 738 iIfStack++; 739 if ((pszEndWord - pszArgument) == 1 740 && *pszArgument >= '0' && *pszArgument <= '9') 741 { 742 if (*pszArgument != '0') 743 achIfStack[iIfStack].fIncluded = TRUE; 744 else 745 achIfStack[iIfStack].fIncluded = FALSE; 746 } 795 achIfStack[iIfStack].fSupported = FALSE; 796 achIfStack[iIfStack].fIncluded = TRUE; 797 achIfStack[iIfStack].fIf = TRUE; 798 } 799 else 800 /* 801 * #else 802 */ 803 if (strncmp(&szBuffer[i], "else", cchWord) == 0) 804 { 805 if (achIfStack[iIfStack].fSupported) 806 { 807 if (achIfStack[iIfStack].fIncluded) /* ARG!! this'll prevent warning */ 808 achIfStack[iIfStack].fIncluded = FALSE; 747 809 else 748 achIfStack[iIfStack].fSupported = FALSE; 749 achIfStack[iIfStack].fIncluded = TRUE; 750 achIfStack[iIfStack].fIf = TRUE; 810 achIfStack[iIfStack].fIncluded = TRUE; 751 811 } 812 achIfStack[iIfStack].fIf = FALSE; 813 } 814 else 815 /* 816 * #endif 817 */ 818 if (strncmp(&szBuffer[i], "endif", cchWord) == 0) 819 { /* Pop the if-stack. */ 820 if (iIfStack > 0) 821 iIfStack--; 752 822 else 753 /* 754 * #else 755 */ 756 if (strncmp(&szBuffer[i], "else", cchWord) == 0) 757 { 758 if (achIfStack[iIfStack].fSupported) 759 { 760 if (achIfStack[iIfStack].fIncluded) /* ARG!! this'll prevent warning */ 761 achIfStack[iIfStack].fIncluded = FALSE; 762 else 763 achIfStack[iIfStack].fIncluded = TRUE; 764 } 765 achIfStack[iIfStack].fIf = FALSE; 766 } 823 fprintf(stderr, "%s(%d): If-Stack underflow!\n", pszFilename, iLine); 824 } 825 /* 826 * general if<something> and elseif<something> implementations 827 */ 828 else 829 if (strncmp(&szBuffer[i], "elseif", 6) == 0) 830 { 831 achIfStack[iIfStack].fSupported = FALSE; 832 achIfStack[iIfStack].fIncluded = TRUE; 833 } 834 else 835 if (strncmp(&szBuffer[i], "if", 2) == 0) 836 { 837 iIfStack++; 838 achIfStack[iIfStack].fIf = TRUE; 839 achIfStack[iIfStack].fSupported = FALSE; 840 achIfStack[iIfStack].fIncluded = TRUE; 841 } 842 /* The rest of them aren't implemented yet. 843 else if (strncmp(&szBuffer[i], "if") == 0) 844 { 845 } 846 */ 847 } 848 849 /* 850 * Comment checks. 851 * -Start at first non-blank. 852 * -Loop thru the line since we might have more than one 853 * comment statement on a single line. 854 */ 855 pszC = &szBuffer[i]; 856 while (pszC != NULL && *pszC != '\0') 857 { 858 if (fComment) 859 pszC = strstr(pszC, "*/"); /* look for end comment mark. */ 860 else 861 { 862 char *pszLC; 863 pszLC= strstr(pszC, "//"); /* look for single line comment mark. */ 864 pszC = strstr(pszC, "/*"); /* look for start comment mark */ 865 if (pszLC && pszLC < pszC) /* if there is an single line comment mark before the */ 866 break; /* muliline comment mark we'll ignore the multiline mark. */ 867 } 868 869 /* Comment mark found? */ 870 if (pszC != NULL) 871 { 872 fComment = !fComment; 873 pszC += 2; /* skip comment mark */ 874 875 /* debug */ 876 /* 877 if (fComment) 878 fprintf(stderr, "starts at line %d\n", iLine); 767 879 else 768 /* 769 * #endif 770 */ 771 if (strncmp(&szBuffer[i], "endif", cchWord) == 0) 772 { /* Pop the if-stack. */ 773 if (iIfStack > 0) 774 iIfStack--; 775 else 776 fprintf(stderr, "%s(%d): If-Stack underflow!\n", pszFilename, iLine); 777 } 778 /* 779 * general if<something> and elseif<something> implementations 780 */ 781 else 782 if (strncmp(&szBuffer[i], "elseif", 6) == 0) 783 { 784 achIfStack[iIfStack].fSupported = FALSE; 785 achIfStack[iIfStack].fIncluded = TRUE; 786 } 787 else 788 if (strncmp(&szBuffer[i], "if", 2) == 0) 789 { 790 iIfStack++; 791 achIfStack[iIfStack].fIf = TRUE; 792 achIfStack[iIfStack].fSupported = FALSE; 793 achIfStack[iIfStack].fIncluded = TRUE; 794 } 795 /* The rest of them aren't implemented yet. 796 else if (strncmp(&szBuffer[i], "if") == 0) 797 { 798 } 799 */ 800 } 801 802 /* 803 * Comment checks. 804 * -Start at first non-blank. 805 * -Loop thru the line since we might have more than one 806 * comment statement on a single line. 807 */ 808 pszC = &szBuffer[i]; 809 while (pszC != NULL && *pszC != '\0') 810 { 811 if (fComment) 812 pszC = strstr(pszC, "*/"); /* look for end comment mark. */ 813 else 814 { 815 char *pszLC; 816 pszLC= strstr(pszC, "//"); /* look for single line comment mark. */ 817 pszC = strstr(pszC, "/*"); /* look for start comment mark */ 818 if (pszLC && pszLC < pszC) /* if there is an single line comment mark before the */ 819 break; /* muliline comment mark we'll ignore the multiline mark. */ 820 } 821 822 /* Comment mark found? */ 823 if (pszC != NULL) 824 { 825 fComment = !fComment; 826 pszC += 2; /* skip comment mark */ 827 828 /* debug */ 829 /* 830 if (fComment) 831 fprintf(stderr, "starts at line %d\n", iLine); 832 else 833 fprintf(stderr, "ends at line %d\n", iLine); 834 */ 835 } 880 fprintf(stderr, "ends at line %d\n", iLine); 881 */ 836 882 } 837 883 } 838 else839 break;840 884 } /*while*/ 841 885 … … 850 894 * !0 on error. 851 895 * @param pszFilename Pointer to source filename. 852 * @param p hFile Pointer to source file handle.896 * @param pvFile Pointer to file textbuffer. 853 897 * @param pOptions Pointer to options struct. 854 898 * @status completely implemented. 855 899 * @author knut st. osmundsen 856 900 */ 857 int langAsm(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions)901 int langAsm(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions) 858 902 { 859 903 void * pvRule; /* Handle to the current rule. */ 860 904 char szBuffer[4096]; /* Temporary buffer (max line lenght size...) */ 861 905 int iLine; /* current line number */ 906 void * pv = NULL; /* An index used by textbufferGetNextLine. */ 862 907 863 908 … … 891 936 /*******************/ 892 937 iLine = 0; 893 while (!feof(phFile)) /* line loop */ 894 { 895 if (fgets(szBuffer, sizeof(szBuffer), phFile) != NULL) 938 while (textbufferGetNextLine(pvFile, &pv, szBuffer, sizeof(szBuffer)) != NULL) /* line loop */ 939 { 940 /* search for include */ 941 int cbLen; 942 int i = 0; 943 iLine++; 944 945 /* skip blank chars */ 946 cbLen = strlen(szBuffer); 947 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 948 i++; 949 950 /* is this an include? */ 951 if (strnicmp(&szBuffer[i], "include", 7) == 0 952 && (szBuffer[i + 7] == '\t' || szBuffer[i + 7] == ' ') 953 ) 896 954 { 897 /* search for include */ 898 int cbLen; 899 int i = 0; 900 iLine++; 901 902 /* skip blank chars */ 903 cbLen = strlen(szBuffer); 904 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 955 char szFullname[CCHMAXPATH]; 956 char *psz; 957 int j; 958 959 /* skip to first no blank char */ 960 i += 7; 961 while (i < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 905 962 i++; 906 963 907 /* is this an include? */ 908 if (strnicmp(&szBuffer[i], "include", 7) == 0 909 && (szBuffer[i + 7] == '\t' || szBuffer[i + 7] == ' ') 910 ) 911 { 912 char szFullname[CCHMAXPATH]; 913 char *psz; 914 int j; 915 916 /* skip to first no blank char */ 917 i += 7; 918 while (i < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 919 i++; 920 921 /* comment check - if comment found, no filename was given. continue. */ 922 if (szBuffer[i] == ';') continue; 923 924 /* find end */ 925 j = 0; 926 while (i + j < cbLen 927 && j < CCHMAXPATH 928 && szBuffer[i+j] != ' ' && szBuffer[i+j] != '\t' && szBuffer[i+j] != '\n' 929 && szBuffer[i+j] != '\0' && szBuffer[i+j] != ';' && szBuffer[i+j] != '\r' 930 ) 931 j++; 932 933 /* copy filename */ 934 strncpy(szFullname, &szBuffer[i], j); 935 szFullname[j] = '\0'; /* ensure terminatition. */ 936 937 /* find include file! */ 938 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 939 if (psz == NULL) 940 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 941 942 /* Did we find the include? */ 943 if (psz != NULL) 944 { 945 char szBuffer2[CCHMAXPATH]; 946 if (pOptions->fExcludeAll || 947 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 948 ) 949 depAddDepend(pvRule, szFullname); 950 else 951 depAddDepend(pvRule, szBuffer); 952 } 964 /* comment check - if comment found, no filename was given. continue. */ 965 if (szBuffer[i] == ';') continue; 966 967 /* find end */ 968 j = 0; 969 while (i + j < cbLen 970 && j < CCHMAXPATH 971 && szBuffer[i+j] != ' ' && szBuffer[i+j] != '\t' && szBuffer[i+j] != '\n' 972 && szBuffer[i+j] != '\0' && szBuffer[i+j] != ';' && szBuffer[i+j] != '\r' 973 ) 974 j++; 975 976 /* copy filename */ 977 strncpy(szFullname, &szBuffer[i], j); 978 szFullname[j] = '\0'; /* ensure terminatition. */ 979 980 /* find include file! */ 981 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 982 if (psz == NULL) 983 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 984 985 /* Did we find the include? */ 986 if (psz != NULL) 987 { 988 char szBuffer2[CCHMAXPATH]; 989 if (pOptions->fExcludeAll || 990 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 991 ) 992 depAddDepend(pvRule, szFullname); 953 993 else 954 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 955 pszFilename, iLine, szFullname); 956 } 994 depAddDepend(pvRule, szBuffer); 995 } 996 else 997 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 998 pszFilename, iLine, szFullname); 957 999 } 958 else959 break;960 1000 } /*while*/ 961 1001 … … 970 1010 * !0 on error. 971 1011 * @param pszFilename Pointer to source filename. 972 * @param p hFile Pointer to source file handle.1012 * @param pvFile Pointer to file textbuffer. 973 1013 * @param pOptions Pointer to options struct. 974 1014 * @status completely implemented. 975 1015 * @author knut st. osmundsen 976 1016 */ 977 int langRC(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions)1017 int langRC(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions) 978 1018 { 979 1019 void * pvRule; /* Handle to the current rule. */ 980 1020 char szBuffer[4096]; /* Temporary buffer (max line lenght size...) */ 981 1021 int iLine; /* current line number */ 1022 void * pv = NULL; /* An index used by textbufferGetNextLine. */ 982 1023 983 1024 … … 1011 1052 /*******************/ 1012 1053 iLine = 0; 1013 while (!feof(phFile)) /* line loop */ 1014 { 1015 if (fgets(szBuffer, sizeof(szBuffer), phFile) != NULL) 1054 while (textbufferGetNextLine(pvFile, &pv, szBuffer, sizeof(szBuffer)) != NULL) /* line loop */ 1055 { 1056 /* search for #include */ 1057 int cbLen; 1058 int i = 0; 1059 iLine++; 1060 1061 /* skip blank chars */ 1062 cbLen = strlen(szBuffer); 1063 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 1064 i++; 1065 1066 /* is this an include? */ 1067 if ( strncmp(&szBuffer[i], "#include", 8) == 0 1068 || strncmp(&szBuffer[i], "RCINCLUDE", 9) == 0 1069 || strncmp(&szBuffer[i], "DLGINCLUDE", 10) == 0 1070 ) 1016 1071 { 1017 /* search for #include */ 1018 int cbLen; 1019 int i = 0; 1020 iLine++; 1021 1022 /* skip blank chars */ 1023 cbLen = strlen(szBuffer); 1024 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 1072 char szFullname[CCHMAXPATH]; 1073 char *psz; 1074 BOOL f = FALSE; 1075 int j; 1076 1077 /* extract info between "" or <> */ 1078 while (i < cbLen && !(f = (szBuffer[i] == '"' || szBuffer[i] == '<'))) 1025 1079 i++; 1026 1027 /* is this an include? */ 1028 if ( strncmp(&szBuffer[i], "#include", 8) == 0 1029 || strncmp(&szBuffer[i], "RCINCLUDE", 9) == 0 1030 || strncmp(&szBuffer[i], "DLGINCLUDE", 10) == 0 1031 ) 1032 { 1033 char szFullname[CCHMAXPATH]; 1034 char *psz; 1035 BOOL f = FALSE; 1036 int j; 1037 1038 /* extract info between "" or <> */ 1039 while (i < cbLen && !(f = (szBuffer[i] == '"' || szBuffer[i] == '<'))) 1040 i++; 1041 i++; /* skip '"' or '<' */ 1042 1043 /* if invalid statement then continue with the next line! */ 1044 if (!f) continue; 1045 1046 /* find end */ 1047 j = f = 0; 1048 while (i + j < cbLen && j < CCHMAXPATH && 1049 !(f = (szBuffer[i+j] == '"' || szBuffer[i+j] == '>'))) 1050 j++; 1051 1052 /* if invalid statement then continue with the next line! */ 1053 if (!f) continue; 1054 1055 /* copy filename */ 1056 strncpy(szFullname, &szBuffer[i], j); 1057 szFullname[j] = '\0'; /* ensure terminatition. */ 1058 1059 /* find include file! */ 1060 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 1061 if (psz == NULL) 1062 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 1063 1064 /* did we find the include? */ 1065 if (psz != NULL) 1066 { 1067 char szBuffer2[CCHMAXPATH]; 1068 if (pOptions->fExcludeAll || 1069 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 1070 ) 1071 depAddDepend(pvRule, szFullname); 1072 else 1073 depAddDepend(pvRule, szBuffer); 1074 } 1080 i++; /* skip '"' or '<' */ 1081 1082 /* if invalid statement then continue with the next line! */ 1083 if (!f) continue; 1084 1085 /* find end */ 1086 j = f = 0; 1087 while (i + j < cbLen && j < CCHMAXPATH && 1088 !(f = (szBuffer[i+j] == '"' || szBuffer[i+j] == '>'))) 1089 j++; 1090 1091 /* if invalid statement then continue with the next line! */ 1092 if (!f) continue; 1093 1094 /* copy filename */ 1095 strncpy(szFullname, &szBuffer[i], j); 1096 szFullname[j] = '\0'; /* ensure terminatition. */ 1097 1098 /* find include file! */ 1099 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 1100 if (psz == NULL) 1101 psz = pathlistFindFile(getenv("INCLUDE"), szFullname, szBuffer); 1102 1103 /* did we find the include? */ 1104 if (psz != NULL) 1105 { 1106 char szBuffer2[CCHMAXPATH]; 1107 if (pOptions->fExcludeAll || 1108 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 1109 ) 1110 depAddDepend(pvRule, szFullname); 1075 1111 else 1076 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 1077 pszFilename, iLine, szFullname); 1078 } 1112 depAddDepend(pvRule, szBuffer); 1113 } 1114 else 1115 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 1116 pszFilename, iLine, szFullname); 1079 1117 } 1080 else1081 break;1082 1118 } /*while*/ 1083 1119 … … 1092 1128 * !0 on error. 1093 1129 * @param pszFilename Pointer to source filename. 1094 * @param p hFile Pointer to source file handle.1130 * @param pvFile Pointer to file textbuffer. 1095 1131 * @param pOptions Pointer to options struct. 1096 1132 * @status completely implemented. 1097 1133 * @author knut st. osmundsen 1098 1134 */ 1099 int langCOBOL(const char *pszFilename, FILE *phFile, BOOL fHeader, POPTIONS pOptions)1135 int langCOBOL(const char *pszFilename, void *pvFile, BOOL fHeader, POPTIONS pOptions) 1100 1136 { 1101 1137 void * pvRule; /* Handle to the current rule. */ 1102 1138 char szBuffer[4096]; /* Temporary buffer (max line lenght size...) */ 1103 1139 int iLine; /* current line number */ 1140 void * pv = NULL; /* An index used by textbufferGetNextLine. */ 1104 1141 1105 1142 … … 1133 1170 /*******************/ 1134 1171 iLine = 0; 1135 while (!feof(phFile)) /* line loop */ 1136 { 1137 if (fgets(szBuffer, sizeof(szBuffer), phFile) != NULL) 1172 while (textbufferGetNextLine(pvFile, &pv, szBuffer, sizeof(szBuffer)) != NULL) /* line loop */ 1173 { 1174 /* search for #include */ 1175 int cbLen; 1176 int i = 0; 1177 int i1, i2; 1178 iLine++; 1179 1180 /* check for comment mark (column 7) */ 1181 if (szBuffer[6] == '*') 1182 continue; 1183 1184 /* skip blank chars */ 1185 cbLen = strlen(szBuffer); 1186 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 1187 i++; 1188 1189 /* is this an include? */ 1190 if ( (i1 = strnicmp(&szBuffer[i], "COPY", 4)) == 0 1191 || (i2 = strnicmpwords(&szBuffer[i], "EXEC SQL INCLUDE", 16)) == 0 1192 ) 1138 1193 { 1139 /* search for #include */ 1140 int cbLen; 1141 int i = 0; 1142 int i1, i2; 1143 iLine++; 1144 1145 /* check for comment mark (column 7) */ 1146 if (szBuffer[6] == '*') 1194 char szFullname[CCHMAXPATH]; 1195 char *psz; 1196 int j; 1197 1198 /* skip statement */ 1199 i += 4; 1200 if (i1 != 0) 1201 { 1202 int y = 2; /* skip two words */ 1203 do 1204 { 1205 /* skip blanks */ 1206 while (szBuffer[i] == ' ' || szBuffer[i] == '\t') 1207 i++; 1208 /* skip word */ 1209 while (szBuffer[i] != ' ' && szBuffer[i] != '\t' 1210 && szBuffer[i] != '\0' && szBuffer[i] != '\n') 1211 i++; 1212 y--; 1213 } while (y > 0); 1214 } 1215 1216 /* check for blank */ 1217 if (szBuffer[i] != ' ' && szBuffer[i] != '\t') /* no copybook specified... */ 1147 1218 continue; 1148 1219 1149 /* skip blank chars */ 1150 cbLen = strlen(szBuffer); 1151 while (i + 9 < cbLen && (szBuffer[i] == ' ' || szBuffer[i] == '\t')) 1220 /* skip blanks */ 1221 while (szBuffer[i] == ' ' || szBuffer[i] == '\t') 1152 1222 i++; 1153 1223 1154 /* is this an include? */ 1155 if ( (i1 = strnicmp(&szBuffer[i], "COPY", 4)) == 0 1156 || (i2 = strnicmpwords(&szBuffer[i], "EXEC SQL INCLUDE", 16)) == 0 1157 ) 1158 { 1159 char szFullname[CCHMAXPATH]; 1160 char *psz; 1161 int j; 1162 1163 /* skip statement */ 1164 i += 4; 1165 if (i1 != 0) 1166 { 1167 int y = 2; /* skip two words */ 1168 do 1169 { 1170 /* skip blanks */ 1171 while (szBuffer[i] == ' ' || szBuffer[i] == '\t') 1172 i++; 1173 /* skip word */ 1174 while (szBuffer[i] != ' ' && szBuffer[i] != '\t' 1175 && szBuffer[i] != '\0' && szBuffer[i] != '\n') 1176 i++; 1177 y--; 1178 } while (y > 0); 1179 } 1180 1181 /* check for blank */ 1182 if (szBuffer[i] != ' ' && szBuffer[i] != '\t') /* no copybook specified... */ 1183 continue; 1184 1185 /* skip blanks */ 1186 while (szBuffer[i] == ' ' || szBuffer[i] == '\t') 1187 i++; 1188 1189 /* if invalid statement then continue with the next line! */ 1190 if (szBuffer[i] == '\0' || szBuffer[i] == '\n') 1191 continue; 1192 1193 /* find end */ 1194 j = 0; 1195 while (i + j < cbLen && j < CCHMAXPATH 1196 && szBuffer[i+j] != '.' 1197 && szBuffer[i+j] != ' ' && szBuffer[i+j] != '\t' 1198 && szBuffer[i+j] != '\0' && szBuffer[i+j] != '\n' 1199 ) 1200 j++; 1201 1202 /* if invalid statement then continue with the next line! */ 1203 if (szBuffer[i+j] != '.' && szBuffer[i+j] != ' ' && szBuffer[i] != '\t') 1204 continue; 1205 1206 /* copy filename */ 1207 strncpy(szFullname, &szBuffer[i], j); 1208 szFullname[j] = '\0'; /* ensure terminatition. */ 1209 1210 /* add extention .cpy - hardcoded for the moment. */ 1211 strcat(szFullname, ".cpy"); 1212 1213 /* find include file! */ 1214 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 1215 1216 /* did we find the include? */ 1217 if (psz != NULL) 1218 { 1219 char szBuffer2[CCHMAXPATH]; 1220 if (pOptions->fExcludeAll || 1221 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 1222 ) 1223 depAddDepend(pvRule, szFullname); 1224 else 1225 depAddDepend(pvRule, szBuffer); 1226 } 1224 /* if invalid statement then continue with the next line! */ 1225 if (szBuffer[i] == '\0' || szBuffer[i] == '\n') 1226 continue; 1227 1228 /* find end */ 1229 j = 0; 1230 while (i + j < cbLen && j < CCHMAXPATH 1231 && szBuffer[i+j] != '.' 1232 && szBuffer[i+j] != ' ' && szBuffer[i+j] != '\t' 1233 && szBuffer[i+j] != '\0' && szBuffer[i+j] != '\n' 1234 ) 1235 j++; 1236 1237 /* if invalid statement then continue with the next line! */ 1238 if (szBuffer[i+j] != '.' && szBuffer[i+j] != ' ' && szBuffer[i] != '\t') 1239 continue; 1240 1241 /* copy filename */ 1242 strncpy(szFullname, &szBuffer[i], j); 1243 szFullname[j] = '\0'; /* ensure terminatition. */ 1244 1245 /* add extention .cpy - hardcoded for the moment. */ 1246 strcat(szFullname, ".cpy"); 1247 1248 /* find include file! */ 1249 psz = pathlistFindFile(pOptions->pszInclude, szFullname, szBuffer); 1250 1251 /* did we find the include? */ 1252 if (psz != NULL) 1253 { 1254 char szBuffer2[CCHMAXPATH]; 1255 if (pOptions->fExcludeAll || 1256 pathlistFindFile(pOptions->pszExclude, szFullname, szBuffer2) != NULL 1257 ) 1258 depAddDepend(pvRule, szFullname); 1227 1259 else 1228 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 1229 pszFilename, iLine, szFullname); 1230 } 1260 depAddDepend(pvRule, szBuffer); 1261 } 1262 else 1263 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 1264 pszFilename, iLine, szFullname); 1231 1265 } 1232 else1233 break;1234 1266 } /*while*/ 1235 1267 … … 1402 1434 1403 1435 1436 /** 1437 * Adds a file to the cache. 1438 * @returns Success indicator. 1439 * @param pszFilename Name of the file which is to be added. (with path!) 1440 */ 1441 static BOOL filecacheAdd(const char *pszFilename) 1442 { 1443 PFCACHEENTRY pfcNew; 1444 1445 /* allocate new block and fill in data */ 1446 pfcNew = malloc(sizeof(FCACHEENTRY) + strlen(pszFilename) + 1); 1447 if (pfcNew == NULL) 1448 { 1449 fprintf(stderr, "error: out of memory! (line=%d)\n", __LINE__); 1450 return FALSE; 1451 } 1452 pfcNew->Key = (char*)(void*)pfcNew + sizeof(FCACHEENTRY); 1453 strcpy((char*)(unsigned)pfcNew->Key, pszFilename); 1454 if (!AVLInsert(&pfcTree, pfcNew)) 1455 { 1456 free(pfcNew); 1457 return TRUE; 1458 } 1459 1460 cfcNodes++; 1461 1462 return TRUE; 1463 } 1464 1465 1466 1467 /** 1468 * Checks if pszFile is exists in the cache. 1469 * @return TRUE if found. FALSE if not found. 1470 * @param pszFilename Name of the file to be found. (with path!) 1471 */ 1472 static BOOL filecacheFind(const char *pszFilename) 1473 { 1474 return AVLGet(&pfcTree, (AVLKEY)pszFilename) != NULL; 1475 } 1476 1404 1477 1405 1478 … … 1414 1487 * @status completely implemented. 1415 1488 * @author knut st. osmundsen 1416 */ 1417 char *pathlistFindFile(const char *pszPathList, const char *pszFilename, char *pszBuffer) 1489 * @remark need substantial optimizations. 95% of execution is spend here. 1490 */ 1491 static char *pathlistFindFile(const char *pszPathList, const char *pszFilename, char *pszBuffer) 1418 1492 { 1419 1493 const char *psz = pszPathList; … … 1434 1508 if (pszNext - psz > 0) 1435 1509 { 1436 HDIR hDir = HDIR_CREATE;1437 ULONG cFiles = 1UL;1438 FILEFINDBUF3 FileFindBuf;1439 1510 APIRET rc; 1440 1511 char szFile[CCHMAXPATH]; … … 1447 1518 strcat(szFile, pszFilename); 1448 1519 1449 /* search for file */ 1450 rc = DosFindFirst(szFile, &hDir, FILE_NORMAL, &FileFindBuf, sizeof(FileFindBuf), 1451 &cFiles, FIL_STANDARD); 1452 DosFindClose(hDir); 1520 /* 1521 * Search for the file in this directory. 1522 * Search cache first 1523 */ 1524 if (!filecacheFind(szFile)) 1525 { 1526 FILESTATUS3 fsts3; 1527 1528 /* ask the OS */ 1529 rc = DosQueryPathInfo(szFile, FIL_STANDARD, &fsts3, sizeof(fsts3)); 1530 if (rc == NO_ERROR) 1531 { /* add file to cache. */ 1532 filecacheAdd(szFile); 1533 } 1534 } 1535 else 1536 rc = NO_ERROR; 1537 1538 /* did we find it? */ 1453 1539 if (rc == NO_ERROR) 1454 1540 { … … 1549 1635 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 1550 1636 */ 1551 staticchar *trim(char *psz)1637 INLINE char *trim(char *psz) 1552 1638 { 1553 1639 int i; … … 1571 1657 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 1572 1658 */ 1573 staticchar *trimR(char *psz)1659 INLINE char *trimR(char *psz) 1574 1660 { 1575 1661 int i; … … 1598 1684 { 1599 1685 signed long cbFile = fsize(phFile); 1600 if (cbFile != -1)1686 if (cbFile > 0) 1601 1687 { 1602 1688 pvFile = malloc(cbFile + 1); … … 1610 1696 } 1611 1697 } 1698 else 1699 fprintf(stderr, "warning/error: failed to open file %s\n", pszFilename); 1612 1700 } 1613 1701 fclose(phFile); … … 1654 1742 1655 1743 return psz; 1744 } 1745 1746 1747 /** 1748 * Gets the next line from an textbuffer. 1749 * (fgets for textbuffer) 1750 * @returns Pointer to pszOutBuffer. NULL when end of file. 1751 * @param pvBuffer Buffer handle. 1752 * @param ppv Pointer to a buffer index pointer. (holds the current buffer index) 1753 * Pointer to a null pointer is passed in to get the first line. 1754 * @param pszLineBuffer Output line buffer. (!= NULL) 1755 * @param cchLineBuffer Size of the output line buffer. (> 0) 1756 * @remark '\n' and '\r' are removed! 1757 */ 1758 static char *textbufferGetNextLine(void *pvBuffer, void **ppv, char *pszLineBuffer, int cchLineBuffer) 1759 { 1760 char * pszLine = pszLineBuffer; 1761 char * psz = *(char**)(void*)ppv; 1762 register char ch; 1763 1764 /* first line? */ 1765 if (psz == NULL) 1766 psz = pvBuffer; 1767 1768 /* Copy to end of the line or end of the linebuffer. */ 1769 ch = *psz; 1770 cchLineBuffer--; /* reserve space for '\0' */ 1771 while (cchLineBuffer > 0 && ch != '\0' && ch != '\n' && ch != '\r') 1772 { 1773 *pszLine++ = ch; 1774 ch = *++psz; 1775 } 1776 *pszLine = '\0'; 1777 1778 /* skip line end */ 1779 if (ch == '\n') 1780 ch = *++psz; 1781 if (ch == '\r') 1782 psz++; 1783 1784 /* check if position has changed - if unchanged it's the end of file! */ 1785 if (*ppv == (void*)psz) 1786 pszLineBuffer = NULL; 1787 1788 /* store current position */ 1789 *ppv = (void*)psz; 1790 1791 return pszLineBuffer; 1656 1792 } 1657 1793 … … 1772 1908 char szBuffer[4096]; 1773 1909 int iBuffer = 0; 1910 int cch; 1774 1911 PDEPRULE pdep = pdepList; 1775 1912 … … 1777 1914 { 1778 1915 /* Write rule. Flush the buffer first if necessary. */ 1779 if (iBuffer + 2 >= sizeof(szBuffer)) 1916 cch = strlen(pdep->pszRule); 1917 if (iBuffer + cch + 2 >= sizeof(szBuffer)) 1780 1918 { 1781 1919 fwrite(szBuffer, iBuffer, 1, phFile); 1782 1920 iBuffer = 0; 1783 1921 } 1784 iBuffer += sprintf(szBuffer + iBuffer, "%s:", pdep->pszRule); 1922 strcpy(szBuffer + iBuffer, pdep->pszRule); 1923 iBuffer += cch; 1924 strcpy(szBuffer + iBuffer++, ":"); 1785 1925 1786 1926 /* write rule dependants. */ … … 1914 2054 pdepPrev->pNext = pNew; 1915 2055 2056 _heap_check(); 1916 2057 return pNew; 1917 2058 } … … 1930 2071 1931 2072 /* allocate more array space */ 1932 if ( pdep->cDeps == 0 || ((pdep->cDeps + 2) % 32) == 0)1933 { 1934 pdep->papszDep = realloc(pdep->papszDep, sizeof(char*) * (pdep->cDeps + 32));2073 if (((pdep->cDeps) % 48) == 0) 2074 { 2075 pdep->papszDep = realloc(pdep->papszDep, sizeof(char*) * (pdep->cDeps + 50)); 1935 2076 if (pdep->papszDep == NULL) 1936 2077 { … … 1949 2090 1950 2091 /* successful! */ 2092 _heap_check(); 1951 2093 return TRUE; 1952 2094 } 1953 2095 1954 1955 1956 /**1957 * Removes double dependencies.1958 * @returns Success indicator.1959 * @param pszFilename Depend filename.1960 */1961 static BOOL depCleanFile(const char *pszFilename)1962 {1963 if (depReadFile(pszFilename))1964 return depWriteFile(pszFilename);1965 return FALSE;1966 }1967 2096 1968 2097 … … 1972 2101 #include <os2.h> 1973 2102 2103 2104 -
TabularUnified trunk/tools/fastdep/makefile ¶
r3091 r3129 1 # $Id: makefile,v 1. 3 2000-03-11 18:07:48bird Exp $1 # $Id: makefile,v 1.4 2000-03-16 21:10:10 bird Exp $ 2 2 3 3 # … … 15 15 # Addjust common definitions 16 16 !ifdef DEBUG 17 CFLAGS = $(CFLAGS) -Ge+ -Tx+ -I$(PDWIN32_INCLUDE) -I..\common \ 18 -W3 -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -O+ 17 CFLAGS = $(CFLAGS) -Ge+ -Tx+ -I..\common \ 18 -W3 -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -O+ -Tm- 19 # -W3 -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- -Gh+ 19 20 LDFLAGS = $(LDFLAGS) -Ge+ -Fe$@ /B"/MAP:full" 20 21 !else 21 CFLAGS = $(CFLAGS) -Ge+ -Tx+ -I $(PDWIN32_INCLUDE) -I..\common \22 CFLAGS = $(CFLAGS) -Ge+ -Tx+ -I..\common \ 22 23 -W3 -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- 23 24 LDFLAGS = $(LDFLAGS) -Ge+ -Fe$@ /B"/MAP:full" … … 29 30 30 31 31 fastdep.exe: fastdep.obj 32 $(LD) $(LDFLAGS) $** $(RTLLIB) os2386.lib 32 fastdep.exe: fastdep.obj avl.obj 33 $(LD) $(LDFLAGS) $** $(RTLLIB) os2386.lib 34 # $(LD) $(LDFLAGS) $** CPPOPA3.OBJ $(RTLLIB) os2386.lib 33 35 34 36 ..\bin\fastdep.exe: fastdep.exe 35 37 $(CP) $** $@ 36 38 39 37 40 dep: # dummy rule 38 41 42 39 43 clean: 40 -@$(RM) *.obj 41 -@$(RM) *.exe 42 -@$(RM) *.map 43 -@$(RM) *.pch 44 -@$(RM) *.log 44 -@$(RM) *.obj *.exe *.map *.pch *.log ..\bin\fastdep.exe
Note:
See TracChangeset
for help on using the changeset viewer.