Copy with NMAKE, Correction to "Basic 7.0: Programmer's Guide" (76741)



The information in this article applies to:

  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0

This article was previously published under Q76741

SUMMARY

The following example on page 645 of the "Microsoft Basic 7.0: Programmer's Guide" versions 7.0 and 7.1 manuals is incorrect:
    # Include files depend on versions in current directory
   DIR=C:\INCLUDE
   $(DIR)\GLOBALS.H : GLOBALS.H
           COPY GLOBALS.H $@
   $(DIR)\TYPES.H : TYPES.H
           COPY TYPES.H  $@
   $(DIR)\MACROS.H : MACROS.H
           COPY MACROS.H $@
				
When the above example is run under NMAKE, only the first description block will be processed, causing the file GLOBALS.H to be updated. The remaining two description blocks will be ignored such that the files TYPES.H and MACROS.H will never be updated by NMAKE.

This example is missing the ALL target-dependency, which ties multiple, independent targets to a single target. The ALL target-dependency is required by NMAKE so that all of the targets will be made. The example should be changed to read as follows:
    # Include files depend on versions in current directory
   DIR=C:\INCLUDE
   ALL:$(DIR)\GLOBALS.H $(DIR)\TYPES.H $(DIR)\MACROS.H
   $(DIR)\GLOBALS.H : GLOBALS.H
           COPY GLOBALS.H $@
   $(DIR)\TYPES.H : TYPES.H
           COPY TYPES.H  $@
   $(DIR)\MACROS.H : MACROS.H
           COPY MACROS.H $@
				
Note the addition of the third line.

MORE INFORMATION

For more information on how to copy files with NMAKE, query on the following words:

Copying and Files and NMAKE


Modification Type:MajorLast Reviewed:10/20/2003
Keywords:KB76741