Microsoft KB Archive/81541

= Using PWB to Maintain Libraries =

Article ID: 81541

Article Last Modified on 10/23/2003

-

APPLIES TO


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

-



This article was previously published under Q81541



SUMMARY
This article describes how to add a template of build switches to the TOOLS.INI file, which will allow you to maintain libraries of object modules. This article also describes how to add new object modules to an existing library using the Programmer's WorkBench. One drawback to using these templates is that the library must exist before they can be used.

This articles was originally written for PWB 1.X, but the process is the same for PWB 2.0. However, some of the steps to select the build options are different.



MORE INFORMATION
Add the following template to the TOOLS.INI file in the subdirectory specified by the INIT environment variable. This template will allow you to replace .OBJ modules in an existing library. Note that the object module must be in the library to make use of this template.

Note: The lines that are split should be concatenated. These lines were broken for readability. [pwb-Build Options:Replace OBJ in Library] build: macro PWBRMAKE &quot;pwbrmake&quot; build: macro NMAKEBSC1 &quot;set&quot; build: macro NMAKEBSC2 &quot;nmake&quot; build: macro CC &quot;cl&quot; build: macro CFLAGS_G &quot;/AL /W2 /G2 /BATCH /FR$*.sbr&quot; build: macro CFLAGS_D &quot;/qc /Od /Zi /Zr&quot; build: macro CFLAGS_R &quot;/Ot /Oi /Ol /Oe /Og /Gs&quot; build: macro ASM &quot;ml&quot; build: macro AFLAGS_G &quot;/W2 /WX /FR$*.sbr&quot; build: macro AFLAGS_D &quot;/Sf /Sa /Sg /Sx /Zi /Fl&quot; build: macro AFLAGS_R &quot;/nologo&quot; build: macro MAPFILE_D &quot;$(PROJ).map&quot; build: macro MAPFILE_R &quot;NUL&quot; build: macro BRFLAGS &quot; /o $(PROJ).bsc&quot; build: macro BROWSE &quot;1&quot; build: macro LIB &quot;lib&quot; build: all $(PROJ).lib build: target $(PROJ).bsc pwbrmake build: target $(PROJ).lib lib nmakebsc1 nmakebsc2 build: inference .c.sbr cc_c_sbr build: inference .asm.sbr asm_asm_sbr build: inference .c.obj cc_c_obj lib_obj_lib build: inference .asm.obj asm_asm_obj lib_obj_lib build: inference .h.inc h2inc_h_inc build: command pwbrmake &quot;$(PWBRMAKE) @<<\n$(BRFLAGS) $(SBRS)\n<<&quot; build: command nmakebsc1 &quot;$(NMAKEBSC1) MAKEFLAGS=&quot; build: command nmakebsc2 &quot;$(NMAKEBSC2) $(NMFLAGS) -f $(PROJFILE) $(PROJ).bsc&quot; build: command lib_obj_lib &quot;$(LIB) $(PROJ).lib -+$(@B).obj;&quot; build: command lib &quot;@echo $(OBJS) >NUL&quot; build: release command cc_c_sbr &quot;$(CC) /Zs $(CFLAGS_G) $(CFLAGS_R) /FR$@ $<&quot; build: debug command cc_c_sbr &quot;$(CC) /Zs $(CFLAGS_G) $(CFLAGS_D) /FR$@ $<&quot; build: release command asm_asm_sbr &quot;$(ASM) /Zs $(AFLAGS_G) $(AFLAGS_R) /FR$@ $<&quot; build: debug command asm_asm_sbr &quot;$(ASM) /Zs $(AFLAGS_G) $(AFLAGS_D) /FR$@ $<&quot; build: release command cc_c_obj &quot;$(CC) /c $(CFLAGS_G) $(CFLAGS_R) /Fo$@ $<&quot; build: debug command cc_c_obj &quot;$(CC) /c $(CFLAGS_G) $(CFLAGS_D) /Fo$@ $<&quot; build: release command asm_asm_obj &quot;$(ASM) /c $(AFLAGS_G) $(AFLAGS_R) /Fo$@ $<&quot; build: debug command asm_asm_obj &quot;$(ASM) /c $(AFLAGS_G) $(AFLAGS_D) /Fo$@ $<&quot; build: release command h2inc_h_inc &quot;$(H2INC) /c $(CFLAGS_G) $(CFLAGS_R) $<&quot; build: debug command h2inc_h_inc &quot;$(H2INC) /c $(CFLAGS_G) $(CFLAGS_D) $<&quot;

This template will allow you to add new OBJ modules to an existing library. Add the following template to the TOOLS.INI file in the subdirectory specified by the INIT environment variable.

Note: The object module must not be in the library to make use of this template. [pwb-Build Options:Add OBJ to library] build: macro PWBRMAKE &quot;pwbrmake&quot; build: macro NMAKEBSC1 &quot;set&quot; build: macro NMAKEBSC2 &quot;nmake&quot; build: macro CC &quot;cl&quot; build: macro CFLAGS_G &quot;/AL /W2 /G2 /BATCH /FR$*.sbr&quot; build: macro CFLAGS_D &quot;/qc /Od /Zi /Zr&quot; build: macro CFLAGS_R &quot;/Ot /Oi /Ol /Oe /Og /Gs&quot; build: macro ASM &quot;ml&quot; build: macro AFLAGS_G &quot;/W2 /WX /FR$*.sbr&quot; build: macro AFLAGS_D &quot;/Sf /Sa /Sg /Sx /Zi /Fl&quot; build: macro AFLAGS_R &quot;&quot; build: macro MAPFILE_D &quot;$(PROJ).map&quot; build: macro MAPFILE_R &quot;NUL&quot; build: macro BRFLAGS &quot; /o $(PROJ).bsc&quot; build: macro BROWSE &quot;1&quot; build: macro LIB &quot;lib&quot; build: all $(PROJ).lib build: target $(PROJ).bsc pwbrmake build: target $(PROJ).lib lib nmakebsc1 nmakebsc2 build: inference .c.sbr cc_c_sbr build: inference .asm.sbr asm_asm_sbr build: inference .c.obj cc_c_obj lib_obj_lib build: inference .asm.obj asm_asm_obj lib_obj_lib build: inference .h.inc h2inc_h_inc build: command pwbrmake &quot;$(PWBRMAKE) @<<\n$(BRFLAGS) $(SBRS)\n<<&quot; build: command nmakebsc1 &quot;$(NMAKEBSC1) MAKEFLAGS=&quot; build: command nmakebsc2 &quot;$(NMAKEBSC2) $(NMFLAGS) -f $(PROJFILE) $(PROJ).bsc&quot; build: command lib_obj_lib &quot;$(LIB) $(PROJ).lib +$(@B).obj;&quot; build: command lib &quot;@echo $(OBJS) >NUL&quot; build: release command cc_c_sbr &quot;$(CC) /Zs $(CFLAGS_G) $(CFLAGS_R) /FR$@ $<&quot; build: debug command cc_c_sbr &quot;$(CC) /Zs $(CFLAGS_G) $(CFLAGS_D) /FR$@ $<&quot; build: release command asm_asm_sbr &quot;$(ASM) /Zs $(AFLAGS_G) $(AFLAGS_R) /FR$@ $<&quot; build: debug command asm_asm_sbr &quot;$(ASM) /Zs $(AFLAGS_G) $(AFLAGS_D) /FR$@ $<&quot; build: release command cc_c_obj &quot;$(CC) /c $(CFLAGS_G) $(CFLAGS_R) /Fo$@ $<&quot; build: debug command cc_c_obj &quot;$(CC) /c $(CFLAGS_G) $(CFLAGS_D) /Fo$@ $<&quot; build: release command asm_asm_obj &quot;$(ASM) /c $(AFLAGS_G) $(AFLAGS_R) /Fo$@ $<&quot; build: debug command asm_asm_obj &quot;$(ASM) /c $(AFLAGS_G) $(AFLAGS_D) /Fo$@ $<&quot; build: release command h2inc_h_inc &quot;$(H2INC) /c $(CFLAGS_G) $(CFLAGS_R) $<&quot; build: debug command h2inc_h_inc &quot;$(H2INC) /c $(CFLAGS_G) $(CFLAGS_D) $<&quot;

To demonstrate the use of these templates, do the following.  At the command prompt, type the following:

lib example

 The library manager will ask you if you would like to create the new library. Answer &quot;Y&quot;. Press ENTER for the remaining prompts. Start PWB. Create a program list EXAMPLE.MAK. Add a .C or .ASM file to the program list.</li> From the Options menu, choose Build Options. If you are using PWB version 1.1, set the main language to none. Set Initial Build Options to Add OBJ to library.</li> Choose Rebuild All from the Make menu.</li> In the Compile Results window, you should see the results of NMAKE compiling your file and adding it to the existing library.</li> Now choose Build Options from the Options menu.</li> Set Initial Build Options to Replace OBJ in Library.</li> Choose Rebuild All from the Make menu.</li> In the Compile Results window, you should see the results of NMAKE compiling or assembling your file and replacing it in the existing library.</li></ol>

For information on how to make libraries dependents of the current target, query on the following words:

library pwb dependent

For more information about the PWB build switches and how to modify the above switches, see the &quot;Microsoft Programmers WorkBench&quot; application note, which can be obtained from Microsoft Product Support or query on SW0330.

Additional query words: kbinf 1.00 1.10 2.00

Keywords: kb16bitonly KB81541

-

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

© Microsoft Corporation. All rights reserved.