Changeset 8083 for trunk/tools
- Timestamp:
- Mar 14, 2002, 2:31:10 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/fastdep/fastdep.c
r7990 r8083 1 /* $Id: fastdep.c,v 1.3 5 2002-02-22 23:48:52bird Exp $1 /* $Id: fastdep.c,v 1.36 2002-03-14 13:31:10 bird Exp $ 2 2 * 3 3 * Fast dependents. (Fast = Quick and Dirty!) 4 4 * 5 * Copyright (c) 1999-200 1 knut st. osmundsen5 * Copyright (c) 1999-2002 knut st. osmundsen (bird@anduin.net) 6 6 * 7 7 * PH 2001-03-01 added optional support for a super-dependency … … 53 53 54 54 #include "avl.h" 55 56 #ifdef __WIN32OS2__ 57 # define WIN32API 58 # include <odinbuild.h> 59 #else 60 # define ODIN32_BUILD_NR -1 61 #endif 55 62 56 63 #ifndef INLINE … … 876 883 { 877 884 printf( 878 "FastDep v0.4 1\n"885 "FastDep v0.42 (build %d)\n" 879 886 "Dependency scanner. Creates a makefile readable depend file.\n" 880 887 " - was quick and dirty, now it's just quick -\n" … … 920 927 "\n" 921 928 "Options and files could be mixed.\n" 922 " copyright (c) 1999-2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)\n", 929 " copyright (c) 1999-2002 knut st. osmundsen (bird@anduin.net)\n", 930 ODIN32_BUILD_NR, 923 931 pszDefaultDepFile 924 932 ); … … 1157 1165 { 1158 1166 if (options.fExcludeAll || pathlistFindFile2(options.pszExclude, szBuffer)) 1159 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1167 { /* #include <sys/stats.h> makes trouble, check for '/' and '\'. */ 1168 if (!strchr(szFullname, '/') && !strchr(szFullname, '\\')) 1169 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1170 else 1171 fprintf(stderr, "%s(%d): warning include '%s' is ignored.\n", 1172 pszFilename, iLine, szFullname); 1173 } 1160 1174 else 1161 1175 depAddDepend(pvRule, szBuffer, options.fCheckCyclic); … … 1402 1416 { 1403 1417 if (options.fExcludeAll || pathlistFindFile2(options.pszExclude, szBuffer)) 1404 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1418 { /* include sys/stats.inc makes trouble, check for '/' and '\'. */ 1419 if (!strchr(szFullname, '/') && !strchr(szFullname, '\\')) 1420 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1421 else 1422 fprintf(stderr, "%s(%d): warning include '%s' is ignored.\n", 1423 pszFilename, iLine, szFullname); 1424 } 1405 1425 else 1406 1426 depAddDepend(pvRule, szBuffer, options.fCheckCyclic); … … 1570 1590 { 1571 1591 if (options.fExcludeAll || pathlistFindFile2(options.pszExclude, szBuffer)) 1572 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1592 { /* #include <sys/stats.h> makes trouble, check for '/' and '\'. */ 1593 if (!strchr(szFullname, '/') && !strchr(szFullname, '\\')) 1594 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1595 else 1596 fprintf(stderr, "%s(%d): warning include '%s' is ignored.\n", 1597 pszFilename, iLine, szFullname); 1598 } 1573 1599 else 1574 1600 depAddDepend(pvRule, szBuffer, options.fCheckCyclic); … … 1748 1774 { 1749 1775 if (options.fExcludeAll || pathlistFindFile2(options.pszExclude, szBuffer)) 1750 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1776 { /* #include <sys/stats.h> makes trouble, check for '/' and '\'. */ 1777 if (!strchr(szFullname, '/') && !strchr(szFullname, '\\')) 1778 depAddDepend(pvRule, szFullname, options.fCheckCyclic); 1779 else 1780 fprintf(stderr, "%s(%d): warning include '%s' is ignored.\n", 1781 pszFilename, iLine, szFullname); 1782 } 1751 1783 else 1752 1784 depAddDepend(pvRule, szBuffer, options.fCheckCyclic); … … 1850 1882 */ 1851 1883 char szLine[1024]; 1852 char * pszFile name;1884 char * pszFile; 1853 1885 char chQuote = ' '; 1854 1886 1855 1887 PreProcessLine(szLine, &szBuffer[i]); 1856 1888 1857 pszFile name= &szLine[strlen(szLine)-1];1858 if (*pszFile name == '\"' || *pszFilename == '\'')1859 { 1860 chQuote = *pszFile name;1861 *pszFile name-- = '\0';1862 } 1863 while (*pszFile name!= chQuote)1864 pszFile name--;1865 *pszFile name++ = '\0'; /* We now have extracted the filename - pszFilename. */1866 strlwr(pszFile name);1889 pszFile = &szLine[strlen(szLine)-1]; 1890 if (*pszFile == '\"' || *pszFile == '\'') 1891 { 1892 chQuote = *pszFile; 1893 *pszFile-- = '\0'; 1894 } 1895 while (*pszFile != chQuote) 1896 pszFile--; 1897 *pszFile++ = '\0'; /* We now have extracted the filename - pszFile. */ 1898 strlwr(pszFile); 1867 1899 1868 1900 /* Add filename to the dependencies. */ 1869 1901 if (i1) 1870 depAddDepend(pvRule, pszFile name, options.fCheckCyclic);1902 depAddDepend(pvRule, pszFile, options.fCheckCyclic); 1871 1903 else 1872 1904 { 1873 1905 char *psz; 1874 1906 /* find include file! */ 1875 psz = pathlistFindFile(options.pszInclude, pszFile name, szFullname);1907 psz = pathlistFindFile(options.pszInclude, pszFile, szFullname); 1876 1908 if (psz == NULL) 1877 psz = pathlistFindFile(pszIncludeEnv, pszFile name, szFullname);1909 psz = pathlistFindFile(pszIncludeEnv, pszFile, szFullname); 1878 1910 1879 1911 /* did we find the include? */ … … 1881 1913 { 1882 1914 if (options.fExcludeAll || pathlistFindFile2(options.pszExclude, szFullname)) 1883 depAddDepend(pvRule, pszFilename, options.fCheckCyclic); 1915 { /* #include <sys/stats.h> makes trouble, check for '/' and '\'. */ 1916 if (!strchr(pszFile, '/') && !strchr(pszFile, '\\')) 1917 depAddDepend(pvRule, pszFile, options.fCheckCyclic); 1918 else 1919 fprintf(stderr, "%s(%d): warning include '%s' is ignored.\n", 1920 pszFilename, iLine, pszFile); 1921 } 1884 1922 else 1885 1923 depAddDepend(pvRule, szFullname, options.fCheckCyclic); … … 1888 1926 { 1889 1927 fprintf(stderr, "%s(%d): warning include file '%s' not found!\n", 1890 pszFilename, iLine, pszFile name);1928 pszFilename, iLine, pszFile); 1891 1929 depMarkNotFound(pvRule); 1892 1930 } … … 2081 2119 2082 2120 /* add extention .cpy - hardcoded for the moment. */ 2083 strcpy(&szFullname[j], ".c py");2121 strcpy(&szFullname[j], ".cbl"); 2084 2122 2085 2123 /* find include file! */ … … 2087 2125 if (!psz) 2088 2126 { 2089 strcpy(&szFullname[j], ".c bl");2127 strcpy(&szFullname[j], ".cpy"); 2090 2128 psz = pathlistFindFile(options.pszInclude, szFullname, szBuffer); 2091 2129 } … … 2220 2258 if (j >= CCHMAXPATH) 2221 2259 { 2222 fprintf(stderr, "%s(%d) warning: Filename too long ignored ", pszFilename, iLine);2260 fprintf(stderr, "%s(%d) warning: Filename too long ignored.\n", pszFilename, iLine); 2223 2261 continue; 2224 2262 } … … 2266 2304 * @param pszS2 String 2 2267 2305 * @param cch Length to compare (relative to string 1) 2268 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)2306 * @author knut st. osmundsen (bird@anduin.net) 2269 2307 */ 2270 2308 int strnicmpwords(const char *pszS1, const char *pszS2, int cch) … … 2919 2957 * @returns Pointer to the first char after word. 2920 2958 * @param psz Where to start. 2921 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)2959 * @author knut st. osmundsen (bird@anduin.net) 2922 2960 */ 2923 2961 char *findEndOfWord(char *psz) … … 2943 2981 * @param psz Where to start. 2944 2982 * @param pszStart Where to stop. 2945 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)2983 * @author knut st. osmundsen (bird@anduin.net) 2946 2984 */ 2947 2985 char *findStartOfWord(const char *psz, const char *pszStart) … … 2990 3028 * @param psz Pointer to the string which is to be trimmed. 2991 3029 * @status completely implmented. 2992 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)3030 * @author knut st. osmundsen (bird@anduin.net) 2993 3031 */ 2994 3032 INLINE char *trim(char *psz) … … 3012 3050 * @param psz Pointer to the string which is to be right trimmed. 3013 3051 * @status completely implmented. 3014 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)3052 * @author knut st. osmundsen (bird@anduin.net) 3015 3053 */ 3016 3054 INLINE char *trimR(char *psz) … … 3032 3070 * @param psz Pointer to the string which is to be quote-trimmed. 3033 3071 * @status completely implmented. 3034 * @author knut st. osmundsen ( knut.stange.osmundsen@pmsc.no)3072 * @author knut st. osmundsen (bird@anduin.net) 3035 3073 */ 3036 3074 INLINE char *trimQuotes(char *psz) … … 3056 3094 * @param pszOut Ouput (preprocessed) string. 3057 3095 * @param pszIn Input string. 3058 * @author knut st. osmundsen ( knut.stange.osmundsen@mynd.no)3096 * @author knut st. osmundsen (bird@anduin.net) 3059 3097 */ 3060 3098 char *PreProcessLine(char *pszOut, const char *pszIn)
Note:
See TracChangeset
for help on using the changeset viewer.