Changeset 3120 for trunk/tools


Ignore:
Timestamp:
Mar 15, 2000, 4:02:11 PM (26 years ago)
Author:
bird
Message:

Added option: -o- which removes the object filename path.
Corrected the -Eall+ option.

File:
1 edited

Legend:

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

    r3020 r3120  
    1 /* $Id: fastdep.c,v 1.4 2000-03-04 23:51:57 bird Exp $
     1/* $Id: fastdep.c,v 1.5 2000-03-15 15:02:11 bird Exp $
    22 *
    33 * Fast dependents. (Fast = Quick and Dirty!)
     
    7474    const char *    pszObjectExt;
    7575    const char *    pszObjectDir;
     76    BOOL            fObjectDir;        /* replace object directory? */
    7677    const char *    pszRsrcExt;
    7778    BOOL            fObjRule;
     
    214215        szObjectExt,     /* pszObjectExt */
    215216        szObjectDir,     /* pszObjectDir */
     217        FALSE,           /* fObjectDir */
    216218        szRsrcExt,       /* pszRsrcExt */
    217219        TRUE,            /* fObjRule */
     
    326328                    }
    327329
    328                     /* path */
     330                    /* path: -o or -o- */
     331                    options.fObjectDir = TRUE;
    329332                    if (strlen(argv[argi]) > 2)
    330                         strcpy(szObjectDir, argv[argi]+2);
     333                    {
     334                        if (argv[argi][2] == '-')  /* no object path */
     335                            szObjectDir[0] = '\0';
     336                        else
     337                            strcpy(szObjectDir, argv[argi]+2);
     338                    }
    331339                    else
    332340                    {
     
    334342                        argi++;
    335343                    }
    336                     if (szObjectDir[strlen(szObjectDir)-1] != '\\'
     344                    if (szObjectDir[0] != '\0'
     345                        && szObjectDir[strlen(szObjectDir)-1] != '\\'
    337346                        && szObjectDir[strlen(szObjectDir)-1] != '/'
    338347                        )
     
    444453        "   -e excludepath  Exclude paths. If a filename is found in any\n"
    445454        "                   of these paths only the filename is used, not\n"
    446         "                   the path+filename (which is default).\n"
    447         "   -eall<[+]|->    -eall+: No path are added to the filename.\n"
     455        "                   the path+filename (which is default) (don't work?).\n"
     456        "   -eall<[+]|->    Include and source filenames, paths or no paths.\n"
     457        "                   -eall+: No path are added to the filename.\n"
    448458        "                   -eall-: The filename is appended the include path\n"
    449459        "                           was found in.\n"
     
    453463        "   -o <objdir>     Path were object files are placed. This path replaces the\n"
    454464        "                   entire filename path\n"
     465        "   -o-             No object path\n"
    455466        "   -obr<[+]|->     -obr+: Object rule.\n"
    456467        "                   -obr-: No object rule, rule for source filename is generated.\n"
     
    562573        else
    563574            fprintf(phDep, "%s%s.%s:",
    564                     (*pOptions->pszObjectDir != '\0') ?
     575                    pOptions->fObjectDir ?
    565576                        pOptions->pszObjectDir : filePathSlash(pszFilename, szBuffer),
    566577                    fileNameNoExt(pszFilename, szBuffer + CCHMAXPATH),
     
    568579
    569580        if (pOptions->fSrcWhenObj)
    570             fprintf(phDep, " \\\n%4s %s", "", pszFilename);
     581            fprintf(phDep, " \\\n%4s %s", "",
     582                    pOptions->fExcludeAll ? fileName(pszFilename, szBuffer) : pszFilename
     583                    );
    571584    }
    572585    else
     
    824837        else
    825838            fprintf(phDep, "%s%s.%s:",
    826                     (*pOptions->pszObjectDir != '\0') ?
     839                    pOptions->fObjectDir ?
    827840                        pOptions->pszObjectDir : filePathSlash(pszFilename, szBuffer),
    828841                    fileNameNoExt(pszFilename, szBuffer + CCHMAXPATH),
     
    830843
    831844        if (pOptions->fSrcWhenObj)
    832             fprintf(phDep, " \\\n%4s %s", "", pszFilename);
     845            fprintf(phDep, " \\\n%4s %s", "",
     846                    pOptions->fExcludeAll ? fileName(pszFilename, szBuffer) : pszFilename
     847                    );
    833848    }
    834849    else
     
    938953        else
    939954            fprintf(phDep, "%s%s.res:",
    940                     (*pOptions->pszObjectDir != '\0') ?
     955                    pOptions->fObjectDir ?
    941956                        pOptions->pszObjectDir : filePathSlash(pszFilename, szBuffer),
    942957                    fileNameNoExt(pszFilename, szBuffer + CCHMAXPATH),
     
    944959
    945960        if (pOptions->fSrcWhenObj)
    946             fprintf(phDep, " \\\n%4s %s", "", pszFilename);
     961            fprintf(phDep, " \\\n%4s %s", "",
     962                    pOptions->fExcludeAll ? fileName(pszFilename, szBuffer) : pszFilename
     963                    );
    947964    }
    948965    else
     
    10541071        else
    10551072            fprintf(phDep, "%s%s.%s:",
    1056                     (*pOptions->pszObjectDir != '\0') ?
     1073                    pOptions->fObjectDir ?
    10571074                        pOptions->pszObjectDir : filePathSlash(pszFilename, szBuffer),
    10581075                    fileNameNoExt(pszFilename, szBuffer + CCHMAXPATH),
     
    10601077
    10611078        if (pOptions->fSrcWhenObj)
    1062             fprintf(phDep, " \\\n%4s %s", "", pszFilename);
     1079            fprintf(phDep, " \\\n%4s %s", "",
     1080                    pOptions->fExcludeAll ? fileName(pszFilename, szBuffer) : pszFilename
     1081                    );
    10631082    }
    10641083    else
     
    12651284
    12661285/**
    1267  * Copies the path name (with extention) into pszBuffer and returns
     1286 * Copies the filename (with extention) into pszBuffer and returns
    12681287 * a pointer to the buffer.
    1269  * If no path is found "" is returned.
    12701288 * @returns   Pointer to pszBuffer with path.
    12711289 * @param     pszFilename  Pointer to readonly filename.
Note: See TracChangeset for help on using the changeset viewer.