This file contains a copy of the WinWord Document MDEPUSER.DOC,
saved as a simple text file with some minimal formatting by hand.

If you have Microsoft Word for Windows version 6, use MDEPUSER.DOC.
If you have Microsoft Word for Windows version 2, use MDEPUSER.WW2.


MDEP
User Guide
1 INTRODUCTION	2
2 QUICK START	3
3 THE MAKEFILE FORMAT	4
3.1 GENERAL FORMAT OF THE MAKEFILE	4
3.2 SECTIONS IN THE INFORMATION BLOCK	4
3.3 MDEP OPTIONS	5
4 MDEP REFERENCE: MDEP DIRECTIVES	6
4.1 ### MDEP_START	6
4.2 ### MDEP_END	6
4.3 ### MDEP_CUT	6
4.4 ### MDEP_MACROS	6
4.5 ### MDEP_OBJECTS	7
4.6 ### MDEP_OPTION	9
4.7 ### MDEP_OPTION_ELSE	10
4.8 ### MDEP_OPTION_END	10
5 MDEP REFERENCE: SECTIONS IN THE INFORMATION BLOCK	11
5.1 [MODULES]	11
5.2 [INCLUDE]	11
5.3 [STANDARDINC]	12
5.4 [SOURCE]	12
5.5 [OBJECT]	13
5.6 [DEFINE]	13
5.7 [CC]	13
5.8 [ASM]	15
6 MDEP REFERENCE: COMMAND LINE SYNTAX	16
7 MDEP TIPS	17
7.1 USING THE OBJECTS MACRO	17
7.2 USING THE INCN MACROS	17
8 ADDITIONAL INFORMATION	18
8.1 HOW MDEP SCANS FILES	18
8.2 SCANNING FOR NESTED INCLUDE FILES	18
8.3 THE GETALL LIST	18
8.4 SCANNING ASSEMBLER FILES	18
9 LICENCE INFORMATION	20

1 INTRODUCTION
==============

What is MDEP?

MDEP is a program which automatically generates the dependecy lists in a makefile. 
It is intended for use on projects using C, C++ or Assembler. MDEP is particularly 
useful on projects which are not developed using an integrated development 
environment (IDE).
Unlike other similar programs, MDEP does not assume that all of the source and 
header files are in a single directory. MDEP will search a specified list of directorys, 
not only for header files, but also for source files.
MDEP does not generate the whole makefile, but only the dependency lists and 
optionally the compiler commands for C and ASM modules. 
MDEP is `driven' by an information block at the top of the makefile in which you 
specify the filenames, the directorys to be searched for source files and for header 
files and, optionally, the rules for compiling C files and assembling ASM files.
MDEP assumes that all include directives in C source files specify the filename and 
extension, but not the file path. The actual include file will be found by searching a 
series of one or more include directories.

What development environment does MDEP support?

The current version of MDEP runs as a DOS program or as a text-mode Windows 
(QuickWin) program.
The makefiles generated by MDEP have so far principally been used with Microsoft 
NMAKE, but may also work with other MAKE programs.
MDEP is not designed to support any specific target environment, but it is probably 
most useful if you are using a PC as your development environment, but not as your 
target environment.

2 QUICK START
=============

The following annotated example is a good basis for generating your own makefile 
and for getting a feel for what MDEP does.

### MDEP_START                      Start of MDEP information block
#
#[MODULES]                          List of source files
#aaa.c
#bbb.c
#ccc.c
#
#[INCLUDE]                          List of directories containing project 
#c:\project\inc                     specific include files. Include files
#h:\standard\inc                    which are found in one of these
#                                   directories will  be added to the
#                                   dependency list.
#
#[STANDARDINC]                      List of directories containing compiler
#h:\compiler\include                or operating system specific include files.
#h:\sdk\include                     Include files which are found in one of
#                                   these directories will NOT be added to the
#                                   dependency list and will NOT be scanned for
#                                   nested include files.
#
#[SOURCE]                           List of directories containing source
#c:\project\src                     files.
#h:\standard\src
#
#[OBJECT]                           Directory in which object files will be
#c:\project\obj                     placed.
#
#[CC]                               Compiler command.
#  cl @<<
#/Fo$@ /G2 /Gs /f- /c /AL /DDOS     $(INC0), $(INC1) etc. refer to the
#/I$(INC0)                          include directories defined above.
#/I$(INC1)                          %s will be replaced by the source
#/I$(INC2)                          filename with it's full path when the
#/I$(INC3)                          command is generated by MDEP.
#%s
#<<NOKEEP
#
#
### MDEP_MACROS                     MDEP generates the macros $(OBJECTS) and
OBJECTS =  \                        $(INC0), $(INC1) etc. between the directive
c:\project\obj\aaa.obj \            ###MDEP_MACROS and the next comment line.
c:\project\obj\bbb.obj \
c:\project\obj\bbb.obj
INC0  = c:\project\inc
INC1  = h:\standard\inc
INC2  = h:\compiler\include
INC3  = h:\sdk\include
#
### MDEP_END                        End of MDEP information block.

$(OBJ)\target.exe: $(OBJECTS)       Linker command.
  link @<<                          Note that NMAKE allows substitution within
/B +                                macros. This is used with the $(OBJECTS)
$(OBJECTS:  = +^                    macro to exchange <space><space> for
)                                   +<new line>.
$@
$*.MAP
llibce;
<<NOKEEP

### MDEP_CUT                        End of user generated makefile. MDEP will
                                    delete all of the file following this
                                    directive and generate the new dependency 
                                    lists and compiler commands.

3 THE MAKEFILE FORMAT
=====================

The central part of a makefile which can be used with MDEP is the information block. 
This is written as comment lines (starting with #) at the top of the makefile.

3.1 General format of the makefile

The makefile is split into sections using the following directives:
###MDEP_START
###MDEP_END
###MDEP_CUT
The directives ###MDEP_START and ###MDEP_END are used to mark the start 
and end of the MDEP information block.
The directive ###MDEP_CUT is used to mark the end of the part of the makefile 
which has been created by hand. Following this directive, all lines in the file will be 
discarded by MDEP and replaced by the automatically generated dependency lists.
The general format of a makefile, using the above directives is as follows:

<File header>
### MDEP_START
<MDEP information block>
### MDEP_END
<other MAKE statements, e.g. Linker commands>
### MDEP_CUT
<automatically generated dependency lists>

3.2 Sections in the information block

The information block is split into sections with lines in the following format:
#[<section name>]
e.g.
#[MODULES]
Each section contains specific information for MDEP, as summarised below:

MODULES
All C, C++ or ASM source modules are listed in this section. The 
modules are listed with the filename and extension only. The 
Directory must not be listed.

INCLUDE
All project specific include directories are listed in this section.

STANDARDINC
All non project specific include directories are listed in this section. 
This might include operating system and compiler specific 
directories.

SOURCE
All source directories are listed in this section.

OBJECT
The object directory is specified in this section.

CC
The compiler command line or lines are specified in this section.

ASM
The assembler command line or lines are specified in this section.

3.3 MDEP Options

MDEP options provide a means to define conditional subblocks within the MDEP 
information block using the following directives:
###MDEP_OPTION
###MDEP_OPTION_ELSE
###MDEP_OPTION_END
These directives may be used anywhere within the MDEP information block.
An option may be specified on the command line in the format /O:<option>.
It is only possible to specify one option on the command line. Options cannot be 
nested.

Possible use of MDEP options

- Supposing you have a large project with frozen versions of all source 
  modules in a project archive. If you are going to edit one or two files, 
  you may copy these to a separate development directory. 
  Using MDEP options, you could define one version of the makefile which 
  takes all source files from the project archive and a second version which 
  takes source files from the development directory or from the project 
  archive.
  For example:

  ###MDEP_OPTION:LOCAL
  #
  #[SOURCE]
  #C:\PROJECT\SRC
  #H:\PROJECT\SRC
  #
  #[INCLUDE]
  #C:\PROJECT\INC
  #H:\PROJECT\INC
  #
  ###MDEP_OPTION_ELSE
  #
  #[SOURCE]
  #H:\PROJECT\SRC
  #
  #[INCLUDE]
  #H:\PROJECT\INC
  #
  ###MDEP_OPTION_END
  #
- Supposing you require some different source modules for a test version of 
  your program.

  Using MDEP options, you could provide two versions of the module list.
  For example:

  #[MODULES]
  #aaa.c
  #bbb.c
  ###MDEP_OPTION:TEST
  #test.c
  ###MDEP_OPTION_END

4 MDEP REFERENCE: MDEP DIRECTIVES
=================================

4.1 ### MDEP_START
Description:
The directive ###MDEP_START indicates the start of the MDEP 
information block.

Scope:
###MDEP_START should be the first MDEP directive in the makefile.

Example:
See section 2

4.2 ### MDEP_END
Description:
The directive ###MDEP_END marks the end of the MDEP 
information block.

Scope:
###MDEP_END should be placed after the directive 
###MDEP_START and after all of the individual sections in the 
MDEP information block.

Example:
See section 2

4.3 ### MDEP_CUT
Description:
The directive ###MDEP_CUT marks the end of all user defined text 
in the makefile. All text following this directive will be deleted and 
regenerated by MDEP.

Scope:
###MDEP_CUT must be the last line of the user generated part of 
the makefile.

Example:
See section 2

4.4 ### MDEP_MACROS
Description:
The directive ###MDEP_MACROS instructs MDEP to generate the 
following macros:
OBJECTS
This macro specifies a complete list of all object files, based on the 
list of modules specified in the [MODULES] section. Each file is given 
the file extension .obj and prefixed with the path specified in the 
[OBJECT] section.
INC0, INC1, ...
These macros are defined to refer to the include directories specified 
in the [INCLUDE] and [STANDARDINC] sections.
If these macros are used in the compiler and/or assembler 
commands specified in the [CC] and [ASM] sections, then you can 
change the specific directories listed in the [INCLUDE] and 
[STANDARDINC] sections, without having to modify the compiler 
and/or assembler commands.
In the original makefile, the line containing ###MDEP_MACROS 
must be followed by another comment line (starting with #). This may 
be another MDEP directive, such as ###MDEP_END.
When MDEP is run for the first time using this makefile, it will insert 
the macros directly following the line with ###MDEP_MACROS and 
thus before the comment line which follows it.
When MDEP is run again, it will delete the lines between the line 
containing ###MDEP_MACROS and the next comment line, before 
insering new macros.

Scope:
###MDEP_MACROS may be placed anywhere in the makefile 
following the [INC], [STANDARDINC], [MODULES] and [OBJECT] 
sections in the MDEP information block.
It may appear within the information block (before ###MDEP_END) 
or following it.
A good position is directly before the ###MDEP_END directive.

Example:
In the following example, type in this style indicates text 
which is entered by the user and type in this style indicates 
text which is generated by MDEP.
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
#[STANDARDINC]
#M:\OS\INC
#M:\CC\INC
#
#[OBJECT]
#C:\PROJECT\OBJ
#
###MDEP_MACROS
OBJECTS =  \
C:\PROJECT\OBJ\module_a.obj \
C:\PROJECT\OBJ\module_b.obj \
C:\PROJECT\OBJ\module_c.obj \
C:\PROJECT\OBJ\module_d.obj
INC0  = C:\PROJECT\INC
INC1  = H:\PROJECT\INC
INC2  = M:\OS\INC
INC3  = M:\CC\INC
###MDEP_END

...

###MDEP_CUT

4.5 ### MDEP_OBJECTS
Description:
The directive ###MDEP_OBJECTS instructs MDEP to generate a list 
of all of the object files, with one file per line.
The exact format of each line is specified following the directive, 
separated by a single space. The object file is indicated with the 
character sequence %s (see example).
In the original makefile, the line containing ###MDEP_OBJECTS 
must be followed by another comment line (starting with #).
When MDEP is run for the first time using this makefile, it will insert 
the list of object files directly following the line with 
###MDEP_OBJECTS and thus before the comment line which 
follows it.
When MDEP is run again, it will delete the lines between the line 
containing ###MDEP_OBJECTS and the next comment line, before 
generating a new list of object files.
This directive provides one way of generating a list of object files as 
part of the linker command. However, it will only work if the linker 
treats lines which start with # as a comment. (One example is 
Watcom wlink). 
Note:	It is normally better to use the OBJECTS macro instead of the 
the ###MDEP_OBJECTS directive.

Scope:
###MDEP_OBJECTS may be placed anywhere in the makefile 
following the [INC], [STANDARDINC], [MODULES] and [OBJECT] 
sections in the MDEP information block.

Example:
In the following example, type in this style indicates text 
which is entered by the user and type in this style indicates 
text which is generated by MDEP.
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
#[STANDARDINC]
#M:\OS\INC
#M:\CC\INC
#
#[OBJECT]
#C:\PROJECT\OBJ
#
###MDEP_END

###MDEP_OBJECTS file %s
file C:\PROJECT\OBJ\module_a.obj
file C:\PROJECT\OBJ\module_b.obj
file C:\PROJECT\OBJ\module_c.obj
file C:\PROJECT\OBJ\module_d.obj
#

...

###MDEP_CUT


4.6 ### MDEP_OPTION
Description:
The directive ###MDEP_OPTION introduces a series of optional 
lines within the MDEP information block and specifies an option 
name. The optional lines continue until the next ###MDEP_OPTION, 
###MDEP_OPTION_ELSE or ###MDEP_OPTION_END directive.
The option name follows the directive, separated by a colon, with the 
format:
###MDEP_OPTION:<option name>
The optional lines will only be analysed by MDEP if the same option 
name was specified on the MDEP command line in the format 
/O:<option name>.
Note that only one option may be specified on the command line and 
that optional blocks may not be nested. Multiple ###MDEP_OPTION 
directives may be used to create a CASE construction.

Scope:
###MDEP_OPTION may only be used within the MDEP information 
block.

Example:
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
###MDEP_OPTION:LOCAL
#
#[SOURCE]
#C:\PROJECT\SRC
#H:\PROJECT\SRC
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
###MDEP_OPTION_ELSE
#
#[SOURCE]
#H:\PROJECT\SRC
#
#[INCLUDE]
#H:\PROJECT\INC
#
###MDEP_OPTION_END
#
#[STANDARDINC]
#M:\OS\INC
#M:\CC\INC
#
#[OBJECT]
#C:\PROJECT\OBJ
#
###MDEP_END

...

###MDEP_CUT

If MDEP is called with the parameter /O:LOCAL then source and 
include files will first be searched for in the local directory tree 
C:\PROJECT. Files which are not found will be searched for in the 
nework directory tree H:\PROJECT.
If this parameter is not used, then the local directorys will not be 
searched. All sources will be taken from the network drive H.

4.7 ### MDEP_OPTION_ELSE
Description:
The directive ###MDEP_OPTION_ELSE follows an optional block 
introduced with ###MDEP_OPTION and introduces a default block. 
This default block will be analysed if the optional block directly 
preceding it was not analysed.

Scope:
###MDEP_OPTION_ELSE may only be used within the MDEP 
information block, following an optional block introduced with 
###MDEP_OPTION.

Example:
See ###MDEP_OPTION.

4.8 ### MDEP_OPTION_END
Description:
The directive ###MDEP_OPTION_END terminates an optional block 
introduced with ###MDEP_OPTION or a default block introduced 
with ###MDEP_OPTION_ELSE.

Scope:
###MDEP_OPTION_END may only be used within the MDEP 
information block, following an optional or default block introduced 
with ###MDEP_OPTION or ###MDEP_OPTION_ELSE.

Example:
See ###MDEP_OPTION.

5 MDEP REFERENCE: SECTIONS IN THE INFORMATION BLOCK
===================================================

The MDEP information block is split into sections by lines containing a 
keyword in square brackets, eg. [MODULES].
Each of these sections contains a list of one or more items. Each item is 
listed on a separate line.
All lines in the MDEP information block start with a single # character, 
except for lines containing MDEP directives which start with ###.
Spaces and tabs are generally ignored, except within the [CC] and [ASM] 
sections.

5.1 [MODULES]
Description:
The MODULES section contains a list of source modules used by the 
makefile. Only the filename and extension is listed. The directory 
must not be listed.
Note: The directory is listed in the SOURCE section.

Example:
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
#[SOURCE]
#C:\PROJECT\SRC
#
# ...
#
###MDEP_END

...

###MDEP_CUT

5.2  [INCLUDE]
Description:
The INCLUDE section contains a list of directories to be searched for 
include files. The directorys will be searched in the order specified.
If the ###MDEP_MACROS directive is used, then MDEP will 
generate a macro (INC0, INC1,...) for each include path. It is 
recommened that the macros be used in the compiler command, 
instead of specifying the include directory directly. This makes it 
easier to modify the list of include directories.

Example:
###MDEP_START
#
# ...
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
# ...
#
###MDEP_END

...

###MDEP_CUT

5.3 [STANDARDINC]
Description:
The section STANDARDINC contains an additional list of directories 
to be searched for include files. MDEP searches in these directories 
after it has searched the direcories listed in the INCLUDE section.
It is intended that directories containing standard (i.e. not project 
specific) include files be listed in this section.
Include files which are found in one of the `stardard' include 
directories are:
  not searched recursivly for further include files,
  not added to the dependency list and
  not added to the GETALL list at the end of the makefile.
If the ###MDEP_MACROS directive is used, then MDEP will 
generate a macro (INC0, INC1,...) for each include path. It is 
recommened that the macros be used in the compiler command, 
instead of specifying the include directory directly. This makes it 
easier to modify the list of include directories.

Example:
###MDEP_START
#
# ...
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
#[STANDARDINC]
#M:\OS\INC
#M:\CC\INC
#
# ...
#
###MDEP_END

...

###MDEP_CUT

5.4  [SOURCE]
Description:
The section SOURCE contains a list of all directories to be searched 
for the source files specified in the MODULES section.

Example:
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
#[SOURCE]
#C:\PROJECT\SRC
#H:\PROJECT\SRC
#
# ...
#
###MDEP_END

...

###MDEP_CUT

5.5  [OBJECT]
Description:
The section OBJECT specifies a single directory to be used for all 
object files.
MDEP uses this directory to generate the object filenames, used in 
the OBJECTS macro and in the list created by the 
###MDEP_OBJECTS directive. For MDEP this is simply a text string.
You may find it useful to define a macro for the object directory, so 
that you can use the same directory for the linker output file. In this 
case, you can specify the macro name, e.g. $(OBJ) in the OBJECTS 
section.

Example:
Example 1:
###MDEP_START
#
# ...
#
#[OBJECT]
#C:\PROJECT\OBJ
#
# ...
#
###MDEP_END

...

###MDEP_CUT
Example 2:
OBJ = C:\PROJECT\OBJ

###MDEP_START
#
# ...
#
#[OBJECT]
#$(OBJ)
#
# ...
#
###MDEP_END

...

###MDEP_CUT

5.6  [DEFINE]
Description:
This section is obsolete.

5.7  [CC]
Description:
The CC section is used to specify the exact command with which the 
C or C++ compiler should be called. The source filename should be 
specified with the character sequence %s.
MDEP will insert this command following each dependency list and 
replace the %s with the appropriate source filename (including path).
Although the same effect can be achieved using inference rules in 
the makefile, these are often difficult to understand and to debug. By 
specifying the compiler command after each dependency list, the 
behaviour on the make program is well defined and easy to predict.
The compiler command may extend over many lines. Spaces and 
tabs will be copied exactly as specified. Only the # at the start of the 
line will be removed. The command must be indented by a space or a 
tab (UNIX versions may require a tab) so that MAKE can distinguish 
it from the next dependency list.

Example:
In the following example, type in this style indicates text 
which is entered by the user and type in this style indicates 
text which is generated by MDEP.
###MDEP_START
#
#[MODULES]
#module_a.c
#module_b.c
#module_c.c
#module_d.c
#
#[SOURCE]
#C:\PROJECT\SRC
#H:\PROJECT\SRC
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
#[STANDARDINC]
#M:\OS\INC
#C:\C700\INC
#
#[OBJECT]
#C:\PROJECT\OBJ
#
#[CC]
#  cl @<<
#/Fo$@ /G2 /Gs /f- /c /AL /DDOS
#/I$(INC0)
#/I$(INC1)
#/I$(INC2)
#/I$(INC3)
#%s
#<<NOKEEP
#
###MDEP_MACROS
OBJECTS =  \
C:\PROJECT\OBJ\module_a.obj \
C:\PROJECT\OBJ\module_b.obj \
C:\PROJECT\OBJ\module_c.obj \
C:\PROJECT\OBJ\module_d.obj
INC0  = C:\PROJECT\INC
INC1  = H:\PROJECT\INC
INC2  = M:\OS\INC
INC3  = C:\C700\INC
###MDEP_END

...

###MDEP_CUT

...

C:\PROJECT\OBJ\module_a.obj: C:\PROJECT\SRC\module_a.c \
                    <include files> ...
  cl @<<
/Fo$@ /G2 /Gs /f- /c /AL /DDOS
/I$(INC0)
/I$(INC1)
/I$(INC2)
/I$(INC3)
C:\PROJECT\SRC\module_a.c
<<NOKEEP

... 

5.8  [ASM]
Description:
The ASM section is used to specify the command with which the 
Assembler should be called. 
This section is analogous to the CC section, except that is is used 
only for those modules which have the extension .asm.

Example:
###MDEP_START
#
#[MODULES]
#module_a.asm
#module_b.asm
#module_c.asm
#module_d.asm
#
#[SOURCE]
#C:\PROJECT\SRC
#H:\PROJECT\SRC
#
#[INCLUDE]
#C:\PROJECT\INC
#H:\PROJECT\INC
#
#[STANDARDINC]
#M:\OS\INC
#
#[OBJECT]
#C:\PROJECT\OBJ
#
#[ASM]
#  masm /I$(INC0) /I$(INC1) /I$(INC2) %s,$@,$*.lst;
#
###MDEP_MACROS
###MDEP_END

...

###MDEP_CUT

...



6 MDEP REFERENCE: COMMAND LINE SYNTAX
=====================================

The MDEP command line usually has the format:
MDEP <makefile>
where <makefile> indicates the name of the makefile. If the name of the 
makefile is omitted, then MDEP will prompt for it.
The command line may also contain optional switches, before or after the 
makefile name.

Optional command line switches
/O:<option name>
This switch indicates the name of an option, to be used with the directive 
###MDEP_OPTION.
Only one option may be specified on the command line.
/R 
Print registration information and exit without processing a makefile.

7 MDEP TIPS
===========

7.1 Using the OBJECTS macro
If you are using Microsoft NMAKE, then it is often useful to use the OBJECTS 
macro in conjunction with the NMAKE's ablity to substitute text within macros. 
This is invoked with the syntax:
$(macroname:string1=string2)
Every occurance of string1 is replaced with string2.
If string2 contains a newline character, then a list of object files can be 
generated in which each file is on a separate line. A literal newline 
character is specified by preceding the actual newline character with a 
circumflex (^).
Consider the following example:
OBJECTS =  \
C:\PROJECT\OBJ\module_a.obj \
C:\PROJECT\OBJ\module_b.obj \
C:\PROJECT\OBJ\module_c.obj \
C:\PROJECT\OBJ\module_d.obj

file $(OBJECTS:  =^
file )
When the macro is expanded, the result is as follows:
file C:\PROJECT\OBJ\module_a.obj
file C:\PROJECT\OBJ\module_b.obj
file C:\PROJECT\OBJ\module_c.obj
file C:\PROJECT\OBJ\module_d.obj
During the macro expansion, the string "<space><space>" was replaced with the 
string "<newline>file ". It is necessary to specify two spaces for string1, 
because NMAKE interprets the newline in the macro definition as a space.
This construction is extremely useful in generating a linker command. 

7.2 Using the INCn macros
The correct functioning of MDEP assumes that the include directories specified 
in the INCLUDE and STANDARDINC sections correspond exactly to the include 
directories specified to the compiler (and/or assembler). It is also critical, 
that the order in which the directories are searched is identical, in case a 
given include file is present in more than one of the directories.
It is usually necessary to specify the include directories in the compiler 
command (unless all necessary files are in a single directory).
It is most convenient, if the macros INC0, INC1 etc. are used in the compiler 
command in place of the actual include directory names. In this case, the 
actual include directories may be changed, without modifying the compiler 
command. It is, of course, necessary to run MDEP, to regenerate the macros 
and to scan the include files in the new directories.

8 ADDITIONAL INFORMATION
========================

8.1 How MDEP scans files
In the current version of MDEP, rigour has been sacrificed for speed. In 
particular you should note:
  MDEP reads a maximum of 32 Kbytes from the file and scans only this part 
  of the file. This is based on the assumption that all include directives 
  are close to the start of the file.
  MDEP does not analyse the C preprocesor directives for conditional 
  compilation (#if, #ifdef etc.).
  MDEP does not take any notice of comments.
If there are #include directives in conditional branches which are not 
compiled, or if you have commented some #include directives out, MDEP 
will nevertheless read these directives and search for the include files.
If MDEP fails to find an include file, it issues an error message. If the 
#include directive for that include file was in a part of the source file 
which will not be compiled, then the error message may be ignored.

8.2 Scanning for nested include files
MDEP will scan include files for nested include files, if the include file 
is found in one of the directories specified in the [INCLUDE] section.
If the include file is found in one of the directories specified in the 
[STANDARDINC] section, then it will not be scanned for nested include files.
(It will also not be included in the dependency list).

8.3 The GETALL list
At the end of the makefile, MDEP adds the target GETALL, followed by a of COPY 
commands for each of the source and include files.
This list does not include include files found in the `standardinc' directories.

8.4 Scanning assembler files
MDEP will locate include directives in assembler files in one of the following 
formats:
$INCLUDE (filename)
(Intel ASM86, ASM386)

INCLUDE filename
(Microsoft MASM, Borland TASM)

In both cases, the keyword include may be lower or upper case.
Problems with Intel ASM86 and ASM386
The Intel assemblers, e.g. ASM386, present a special problem, in that they do 
not provide a command line option to specify an include directory. It is 
therefore often necessary to specify a path with the filename.
MDEP will strip the path off the filename and search for the include file in 
the include directorys specified in the information block.
The Intel tools will accept a logical pathname in the form :name:. Under DOS, 
:name: must be defined as an environment variable.
One approach would be to use the logical names :I0:, :I1:, etc. in include 
directives, e.g.
$include (:I1:xxx.inc)
and to set these equal to the include paths in makefile, as in the following 
example:
#
#[ASM]
#  SET :I0:=$(INC0)
#  SET :I1:=$(INC1)
#  SET :I2:=$(INC2)
#  SET :I3:=$(INC3)
#  -1 ASM386 & < <<asm.cmd
#%s &
#oj($@) &
#PR($(LST)\$(@B).LST)
#<<KEEP
#  GREP WARNING $(LST)\$(@B).LST
#
This method is, however, very inflexible, since ASM386 will only look for an 
include file in the specified directory, instead of searching them all in the 
given order.

9 LICENCE INFORMATION
=====================

MDEP is shareware. You may use it free of charge for an evaluation period of 
20 days. If you continue to use MDEP following this period you must register 
it.
When you register it, you will receive a copy of the registration file 
MDEP.REG, which you must copy into same directory as MDEP.EXE. This file 
will be sent be E-Mail only.
The registration fee for MDEP is $35.00 or DM 50.00.
You may register by one of the following methods:

CompuServe Shareware Registration
---------------------------------
GO SWREG
Registration ID 5603
This is the favoured method of payment for non Europeans. The fee of $35.00 
will be charged to your CompuServe account.

Eurocheque
----------
Send a Eurocheque for DM 50.00 to
Phil Jollans
Andreasstrasse 19
82515 Wolfratshausen
Germany

Bank transfer
-------------
German users may register with a bank transfer of DM 50.00 to 
Phil Jollans
Dresdner Bank, Munich
Konto	920151800
BLZ	70080000
Write your E-Mail address on the bank transfer form.

10 CONTACTING THE AUTHOR
========================

MDEP was written by Phil Jollans.
You can contact me
by E-Mail                               CompuServe 100275,2756

by Fax                                  +49.8171.16717

by Mail                                 Andreasstrasse 19
                                        82515 Wolfratshausen
                                        Germany

I am very interested in your comments on MDEP. Feel free to suggest 
improvements!
