Microsoft KB Archive/76739

= Updating Backup Files with NMAKE & ALL Target-Dependency =

Article ID: 76739

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.3
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4

-



This article was previously published under Q76739



SUMMARY
The text below demonstrates using NMAKE and the ALL target-dependency (an NMAKE keyword) to copy or backup files that are out-of-date with respect to the previous copy or archive.



MORE INFORMATION
The steps below create a .MAK file that copies the AUTOEXEC.BAT and CONFIG.SYS files to a directory named C:\BACKUP:

  Use a text editor to create COPY.MAK that contains the following text:      ALL: c:\backup\autoexec.bat c:\backup\config.sys

c:\backup\autoexec.bat: c:\autoexec.bat copy c:\autoexec.bat c:\backup\autoexec.bat c:\backup\config.sys: c:\config.sys copy c:\config.sys c:\backup\config.sys NOTE: The .MAK file above copies the AUTOEXEC.BAT files from the source directory (C:\) to the target directory (C:\BACKUP). The files are copied only if the files in the source directory have an older time/date stamp than the files in the target directory.  Create the C:\BACKUP directory if it does not already exist. To do so, type the following at the MS-DOS command prompt:

mkdir c:\backup

 To backup any changes you made to your AUTOEXEC.BAT or CONFIG.SYS files, type the following at the MS-DOS command prompt:

nmake /f copy.mak



NMAKE processes only one dependency per makefile. If the makefile did not include the ALL target-dependency (an NMAKE keyword), only the first file would be copied and the second copy command would be ignored completely. The ALL target creates a dependency that depends on the completion of every task in the makefile. Without this statement, two dependencies are declared, only one of which would be processed.

Page 645 of the &quot;Microsoft Basic 7.0: Programmer's Guide&quot; for versions 7.0 and 7.1 presents a similar example. However, this example lacks the ALL target-dependency and does not work correctly as presented.

Additional query words: kbinf 1.20 1.30 1.40 1.50 gp fault trap 13 lock

Keywords: KB76739

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.