Changeset 8083 for trunk/tools


Ignore:
Timestamp:
Mar 14, 2002, 2:31:10 PM (23 years ago)
Author:
bird
Message:

Correction for the -Eall and -E<> options.
Things like #include <sys/stats.h> was troublesome and must be ignored.
Added build no. to syntax();
Corrected emails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/fastdep/fastdep.c

    r7990 r8083  
    1 /* $Id: fastdep.c,v 1.35 2002-02-22 23:48:52 bird Exp $
     1/* $Id: fastdep.c,v 1.36 2002-03-14 13:31:10 bird Exp $
    22 *
    33 * Fast dependents. (Fast = Quick and Dirty!)
    44 *
    5  * Copyright (c) 1999-2001 knut st. osmundsen
     5 * Copyright (c) 1999-2002 knut st. osmundsen (bird@anduin.net)
    66 *
    77 * PH 2001-03-01 added optional support for a super-dependency
     
    5353
    5454#include "avl.h"
     55
     56#ifdef __WIN32OS2__
     57#   define WIN32API
     58#   include <odinbuild.h>
     59#else
     60#   define ODIN32_BUILD_NR -1
     61#endif
    5562
    5663#ifndef INLINE
     
    876883{
    877884    printf(
    878         "FastDep v0.41\n"
     885        "FastDep v0.42 (build %d)\n"
    879886        "Dependency scanner. Creates a makefile readable depend file.\n"
    880887        " - was quick and dirty, now it's just quick -\n"
     
    920927        "\n"
    921928        "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,
    923931        pszDefaultDepFile
    924932        );
     
    11571165                    {
    11581166                        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                        }
    11601174                        else
    11611175                            depAddDepend(pvRule, szBuffer, options.fCheckCyclic);
     
    14021416            {
    14031417                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                }
    14051425                else
    14061426                    depAddDepend(pvRule, szBuffer, options.fCheckCyclic);
     
    15701590            {
    15711591                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                }
    15731599                else
    15741600                    depAddDepend(pvRule, szBuffer, options.fCheckCyclic);
     
    17481774                    {
    17491775                        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                        }
    17511783                        else
    17521784                            depAddDepend(pvRule, szBuffer, options.fCheckCyclic);
     
    18501882             */
    18511883            char    szLine[1024];
    1852             char *  pszFilename;
     1884            char *  pszFile;
    18531885            char    chQuote = ' ';
    18541886
    18551887            PreProcessLine(szLine, &szBuffer[i]);
    18561888
    1857             pszFilename = &szLine[strlen(szLine)-1];
    1858             if (*pszFilename == '\"' || *pszFilename == '\'')
    1859             {
    1860                 chQuote = *pszFilename;
    1861                 *pszFilename-- = '\0';
    1862             }
    1863             while (*pszFilename != chQuote)
    1864                 pszFilename--;
    1865             *pszFilename++ = '\0'; /* We now have extracted the filename - pszFilename. */
    1866             strlwr(pszFilename);
     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);
    18671899
    18681900            /* Add filename to the dependencies. */
    18691901            if (i1)
    1870                 depAddDepend(pvRule, pszFilename, options.fCheckCyclic);
     1902                depAddDepend(pvRule, pszFile, options.fCheckCyclic);
    18711903            else
    18721904            {
    18731905                char *psz;
    18741906                /* find include file! */
    1875                 psz = pathlistFindFile(options.pszInclude, pszFilename, szFullname);
     1907                psz = pathlistFindFile(options.pszInclude, pszFile, szFullname);
    18761908                if (psz == NULL)
    1877                     psz = pathlistFindFile(pszIncludeEnv, pszFilename, szFullname);
     1909                    psz = pathlistFindFile(pszIncludeEnv, pszFile, szFullname);
    18781910
    18791911                /* did we find the include? */
     
    18811913                {
    18821914                    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                    }
    18841922                    else
    18851923                        depAddDepend(pvRule, szFullname, options.fCheckCyclic);
     
    18881926                {
    18891927                    fprintf(stderr, "%s(%d): warning include file '%s' not found!\n",
    1890                             pszFilename, iLine, pszFilename);
     1928                            pszFilename, iLine, pszFile);
    18911929                    depMarkNotFound(pvRule);
    18921930                }
     
    20812119
    20822120            /* add extention .cpy - hardcoded for the moment. */
    2083             strcpy(&szFullname[j], ".cpy");
     2121            strcpy(&szFullname[j], ".cbl");
    20842122
    20852123            /* find include file! */
     
    20872125            if (!psz)
    20882126            {
    2089                 strcpy(&szFullname[j], ".cbl");
     2127                strcpy(&szFullname[j], ".cpy");
    20902128                psz = pathlistFindFile(options.pszInclude, szFullname, szBuffer);
    20912129            }
     
    22202258            if (j >= CCHMAXPATH)
    22212259            {
    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);
    22232261                continue;
    22242262            }
     
    22662304 * @param     pszS2  String 2
    22672305 * @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)
    22692307 */
    22702308int strnicmpwords(const char *pszS1, const char *pszS2, int cch)
     
    29192957 * @returns   Pointer to the first char after word.
    29202958 * @param     psz  Where to start.
    2921  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     2959 * @author    knut st. osmundsen (bird@anduin.net)
    29222960 */
    29232961char *findEndOfWord(char *psz)
     
    29432981 * @param     psz       Where to start.
    29442982 * @param     pszStart  Where to stop.
    2945  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     2983 * @author    knut st. osmundsen (bird@anduin.net)
    29462984 */
    29472985char *findStartOfWord(const char *psz, const char *pszStart)
     
    29903028 * @param     psz   Pointer to the string which is to be trimmed.
    29913029 * @status    completely implmented.
    2992  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     3030 * @author    knut st. osmundsen (bird@anduin.net)
    29933031 */
    29943032INLINE char *trim(char *psz)
     
    30123050 * @param     psz   Pointer to the string which is to be right trimmed.
    30133051 * @status    completely implmented.
    3014  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     3052 * @author    knut st. osmundsen (bird@anduin.net)
    30153053 */
    30163054INLINE char *trimR(char *psz)
     
    30323070 * @param     psz   Pointer to the string which is to be quote-trimmed.
    30333071 * @status    completely implmented.
    3034  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     3072 * @author    knut st. osmundsen (bird@anduin.net)
    30353073 */
    30363074INLINE char *trimQuotes(char *psz)
     
    30563094 * @param   pszOut  Ouput (preprocessed) string.
    30573095 * @param   pszIn   Input string.
    3058  * @author  knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     3096 * @author  knut st. osmundsen (bird@anduin.net)
    30593097 */
    30603098char *PreProcessLine(char *pszOut, const char *pszIn)
Note: See TracChangeset for help on using the changeset viewer.