The WATCOM make utility is WMAKE. The makefiles associated with the examples that ship with this NDK are written to be used by WMAKE. To compile an example, you simply move to the directory where the example is located and type:
WMAKE
To assist you in creating WMAKE-style makefiles for your programs, this NDK ships with the QMK386 utility. QMK386 generates makefiles for WMAKE based on user input and entries in the MAKEINIT file generated by the MAKEINIT.EXE file. You can customize the makefiles after QMK386 creates them. QMK386 is located in the TOOLS directory.
Information about this utility consists of the following sections:
[d:][path]QMK386 <progname> [/options]
[d:][path] specifies the drive and path containing the QMK386 command file.
<progname> specifies the name of the modules whose makefile is being created. If this parameter is not set, the default name is "NONAME."
[/options] See Options for QMK386.EXE
To display the QMK386 options, type:
QMK386 ?
The following environment variables may be used with QMK386:
SWITCHAR sets the character that QMK386 uses as the delimiter for parameters. By default, the forward slash `/ā is used.
QMK386 can be used to set options that are commonly used. For example, if you commonly use /Z and /IDT, set the environment variables as follows to avoid entering these options at the command line:
SET QMK386=/z /idt
SILENT places the SILENT directive in the makefile when set.
QMKVER allows you to specify the default way to build an application. If QMKVER is not specified, it will default to `dā, which uses DEBUG compile switches, and includes debug information in the output file.
CCF386 specifies the command line switches to be used when rebuilding an application.
This section contains some examples of common build options used with QMK386. The parameters can appear in any order, and no spaces are required between options unless the options require a directory path or function name.
To create a WLINK style makefile for a program called HELLO, with an 8K stack, importing from CLIB.IMP, THREADS.IMP and NLMLIB.IMP:
F:\> qmk386 hello /ih /in
HINT:Import files can be included individually with the /i option (for example, /oh includes the THREADS.IMP file). To inlcude the ALL.IMP file (which includes all the import files), do not use the /i option (ALL.IMP is the default setting).
Using the ALL.IMP file might require more memory than is available in your environment.
To create a WLINK style makefile for a program called TEST1, with a 12K stack, importing from CLIB.IMP and TLI.IMP:
F:\> qmk386 /s12 /it test1
To create an NLMLINK style makefile for the example above:
F:\> qmk386 /s12 /it test1 /z
To create an NLMLINK style makefile, and run the NLMPACK utility:
F:\> qmk386 /s12 /it test1 /z /p
The /CS option allows you to specify source files. You can specify multiple /C<x> options, as well as use wildcards. This allows you to specify multiple dependencies for the first target. For example, to create a MAKEFILE for an NLM called MYNLM, made up of all the .C files in the current directory, importing a file called EXLIB.IMP and specifying a NetWare Loader module dependency on EXLIB.NLM:
F:\SRC> qmk386 mynlm /CS*.c /CIexlib /Cmexlib
QMK386 MAKEFILEs define the following macros for your .C programs:
t vMAJ - Major version number
t vMIN - Minor version number
t vREV - Revision number
The WMAKE macros which define the values of these are pvmaj, pvmin and pvrev. They are defined at the top of your MAKEFILE, and if you change the values, they are reflected in both the C macros as well as the version number passed to the linker. One way to create a version string in your NLM might be:
#define VERSION "Widget Monitor NLM v"vMAJ"."vMIN
This would expand to:
#define VERSION "Widget Monitor NLM v1.00"
if the default values were used.