
Copyright (C) 1996 by Jim Wakeen.  All rights reserved.

This software was developed by Jim Wakeen. Permission to use, copy, modify,
and distribute this software for any purpose is hereby granted without fee,
provided that the above copyright notice and this notice accompany all
copies, and that the name of the author not be used in advertising or
publicity pertaining to distribution of the software without specific, written
prior permission.

THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY.  IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION OR WARRANTY OF
ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR
ANY PARTICULAR PURPOSE.

                            *** USAGE NOTES ***

depend.exe will generate dependency lists for C/C++ source files that can be
inserted directly into a makefile.  This readme provides more information
about the options.

usage:
    depend [-options] files...

Note:  all options must be separated by a space from their following arguments.

Options:

    -1        Output one dependency per line

      Most makefiles are simpler to interpret if there is only one dependency
      per line.  This is exactly what this option does.  Here are 2 runs of
      the same file with and without the -1 option.  Use whichever format you
      perfer.

      C:\src\depend>depend string.cpp
      string.obj: string.cpp string.hpp forcelib.h


      C:\src\depend>depend -1 string.cpp
      string.obj: \
              string.cpp \
              string.hpp \
              forcelib.h

///////////////////////////////////////////////////////////////////////////////

    -d        Display dependency tree listing

      Since depend uses a recursive algorithm to depend in each dependant
      file, it is sometimes valuable for debugging purposes to see which
      level a file was included at.  Each level in indented by a tab char and
      is written to stderr, so to capture it in a file you'll have to
      re-route the stderr to a file.  I don't know how to capture the stderr
      in dos.  In NT you can use
      
         depend (args) > outfile 2>&1

      to connect the stdout and stderr and throw the whole mess into outfile.
      Here is a sample run:

      C:\winproj\petools>depend -d date.cpp
      date.cpp
              petools.h
                      peassert.h
              date.h
      date.cpp[4]
      date.obj: date.cpp petools.h peassert.h date.h

      This output says that date.cpp depends on (includes) petools.h and
      date.h.  petools.h depends on (includes) peasert.h.  Notice that
      petools.h and date.h are both indented at the same level. [4] means
      date.cpp is dependant on a total of 4 files.

///////////////////////////////////////////////////////////////////////////////

    -ex @file Specify files to ignore in file

      Use this option to name a file that contains include files to exclude
      from a dependency list.  MSDev v2.* uses a file named sysincl.dat.  The
      format of the exclude file is one file per line and the exclude file
      must be either in the current directory or be named with an absolute
      (full) path.  For example:

      depend -ex @\msdev\bin\sysincl.dat date.cpp

///////////////////////////////////////////////////////////////////////////////

    -i  path  Add path to include search

      Use this option to add includes to the list of directories to search to
      find included files.   This path can be relative or absolute.  This is
      the same as the compiler option.  The INCLUDE environment variable is
      checked after all of these included directories are checked and the file
      being sought is not found.  For example:

      depend -i ..\include -i ..\packages date.cpp

///////////////////////////////////////////////////////////////////////////////

    -o  file  Write output to file

      Use the option to save the output into file.  The same thing can be done
      with redirection.

///////////////////////////////////////////////////////////////////////////////

    -oe file  Write output and errors to file

      Use the option to save the output and any errors into file.  The same
      thing can be done with redirection as in the -d option description.

///////////////////////////////////////////////////////////////////////////////

    -s        Scan system includes (files included with <...> form)

      Normally, you don't want to include files from the standard C/C++
      library in you dependency lists since you shouldn't be changing these
      very often!  If for some reason you want to see how these files fit into
      the dependency scheme, you can search them by turning on this option.

///////////////////////////////////////////////////////////////////////////////

    -v        Display extra dependency and search information (verbose)

      This option display where it is searching for a file when it finds an
      included file.  This output is helpful when you have 2 files identically
      named and want to be sure one is being included and one is not.  For
      example, here is a sample run:

      C:\winproj\pedb>depend -v -i ..\petools unititr.cpp
      Searching for 'unititr.cpp' in:
      Searching for 'peassert.h' in:
              peassert.h
              ..\petools\peassert.h
      Searching for 'ts3iox.h' in:
              ts3iox.h
              ..\petools\ts3iox.h
              c:\msdev\include\ts3iox.h
              c:\msdev\mfc\include\ts3iox.h

      ts3iox.h:  file not found
      Searching for 'unitkey.h' in:
              unitkey.h
      Searching for 'key.h' in:
              key.h
      unititr.obj: unititr.cpp pedbstd.h ..\petools\peassert.h ts3iox.h unitkey.h

      The last file in the searching for ... output is the one that was
      found. Notice that in this example the file ts3iox.h was not found.  (I
      intentionally did not add ..\include to the search path to show this
      eror).  This gives you an idea of where the generator looked for the
      includes as it found them.  

