Microsoft KB Archive/69751

= How to Make a Library File a Dependent of the Target in PWB =

Article ID: 69751

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft Programmer's Workbench for MS-DOS 1.0
 * Microsoft Programmer's Workbench for MS-DOS 1.1
 * Microsoft Programmer's Workbench for OS/2 1.0
 * Microsoft Programmer's Workbench for OS/2 1.1

-



This article was previously published under Q69751



SUMMARY
In the Programmer's WorkBench (PWB), additional libraries may be specified in a Program List. However, these libraries are not put into the makefile as dependents of the target file. Thus, if one of these libraries is changed, this does not cause the project to be rebuilt unless you delete the existing target file or select Rebuild All to rebuild the entire project.

To make a project automatically relink after an external library has been modified, you need to modify two build switches. This can be done permanently in the TOOLS.INI file or temporarily inside PWB in the Editor Settings (which can be reached from the Options menu). Then you must place the library(s) in the project's program list (as opposed to the Additional Libraries list in the Link Options dialog box).



MORE INFORMATION
The following information describes the two methods for making the build-switch changes that are required to have libraries recognized as dependents of the target file in a project. For those who would like more extensive information on modifying and creating build switches, an application note is available from Microsoft on this subject. For details, query on the keyword &quot;SW0330&quot;.

You can verify the results of either of these build-switch changes by looking at the PWB-generated makefile and observing that external libraries are, in fact, listed as dependents of the project target.

Making Permanent Build Switch Modifications in TOOLS.INI
 Use the Options menu items Build Options, C Compiler Options, and Link Options to setup the various compiler and link options the way you want them. Select the Save Current Build Options function in the Build Options dialog box and save the current build options under a unique name. Bring your TOOLS.INI file into the editor and locate the section that begins with the unique name you just specified in step 2 above. Within this section, locate the line that reads

build: target $(PROJ).exe lrf_exe link_exe

and change it to:

build: target $(PROJ).exe lrf_exe link_exe new_libs

 Add a new line (anywhere in this section) that reads:

build: command new_libs &quot;ECHO $(LIBS) >NUL&quot;



This will cause the target to be dependent upon any library(s) placed in the program list whenever these new build options are in effect; when you change an external library, the project will be relinked even if no other modules have changed.

Making Temporary Build Switch Modifications in the Editor Settings
 Select the Editor Settings function from the Options menu.</li> Find the section containing the build switches.</li> Within this section, locate the line that reads

build: target $(PROJ).exe lrf_exe link_exe

and change it to:

build: target $(PROJ).exe lrf_exe link_exe new_libs

</li> Add a new line (somewhere in this section) that reads:

build: command new_libs &quot;ECHO $(LIBS) >NUL&quot;

</li></ol>

These changes will be in effect only for the current programming session. Thus, this method is useful for testing, but the previous method is recommended for regular use.

Additional query words: kbinf 1.00 1.10 PWBIss

Keywords: kb16bitonly KB69751

-

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

© Microsoft Corporation. All rights reserved.