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 #< for ) +. $@ $*.MAP llibce; < ### MDEP_START ### MDEP_END ### MDEP_CUT 3.2 Sections in the information block The information block is split into sections with lines in the following format: #[
] 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: