
                            /*** HI ! ***/
                                
  /* This is full documentations about CL386.EXE & MK386.EXE programs ! */


char *Table_Of_Contents[] = 
{
   "Introduction.",
   "How CL386 & MK386 work?",
        "What program need for CL386 & MK386?",
        "Algorithm of CL386 & MK386.",
        "Difference between CL386 & MK386.",
   "Options of Cl386 & MK386.",
   "Errorlevel.",
   "Remarks.",
   "Appendix.",
        "Tips for MASM v5.1"
        "Tips for LINK"
        "Tips for using TASM v4.1 for DOS !",
   	"The warranties.",
   	"Copyright.",
   	"Contact address."
};

/*
**  I.  Introduction.
*/

    CL386 & MK386 is shell for compile, assemble and link with C
compiler CC386.EXE. It written special for David Lindauer compiler's !

    I compile it with next C/C++ compilers:
        Turbo C/C++ v1.0
        Borland C/C++ v3.1 
        Watcom C/C++ v10.6 and v11.0
    Analogs CL386 is :
        BCC.EXE (Borland C/C++)
        WCL.EXE (Watcom C/C++) 
        CL.EXE  (MS C/C++)
    Analogs MK386 is :
        MAKER  (make makefile for C/C++ compilers)
        genmkf (generate MAKEFILE for Watcom C/C++ )


/*
**  II.  How CL386 & MK386 work?
*/


//  II.1  What is need for CL386?

    For CL386 & MK386 are necessary next files: 

        David C Compiler:
                CC386.EXE (include to CC386 packadge)
        One from next assembler :
                NASM.EXE (include to CC386 packadge),
                TASM.EXE, TASMX.EXE, TASM32.EXE, MASM.EXE, ML.EXE,
                LASM.EXE or WASM.EXE
        One from next linker :
                VALX.EXE (include to CC386 packadge),
                TLINK.EXE, WLINK.EXE or LINK.EXE (I tested OPTLINK)
   
     For MK386 also need one from next maker :
                IMAKE.EXE (include to CC386 packadge),
                MAKE.EXE (Borland), WMAKE.EXE (Watcom)
       
    Check (or add) path to this programs in environment variable PATH !


//  II.2  Algorithm of CL386 & MK386.

    1) Parameters get.  The parameters are <file> or <option>.

        Parameters you can set in :
   
            - configuration file CL386.CFG (MK386 use MK386.CFG). If you
        rename CL386.EXE to XXX.EXE, name of config file must be XXX.CFG.
        CL386.CFG search in current directory, and if NOT found - in the
        directory, where CL386.EXE start.
            - variable of environment CL386 (MK386 use MK386). Example:
        SET CL386=-A -$L#WLINK
            - in command line. Files can be with wildcards '?' and '*'.
    
    2) For compile, assemble & link CL386 generate file TEMP.$$$ in current
    directory. Them called CC386, assembler and linker. 
    MK386 generate MAKEFILE. and them run MAKE.
   
    3) If found option /? (/h or /H ) or no file in parameters - output 
    help message.


//  II.3 Difference between CL386 & MK386.

    Cl386 & MK386 use one source, but generate difference output :)
    Difference :
        - CL386 ALWAYS compile all files, MK386 - only updated;
        - MK386 generate MAKEFILE and them run MAKE.EXE;
        - MK386 uses less memory.
        - MK386 DON'T compile & assemble - ONLY BUILD !!!;
       
/*
**  III. Options of CL386 & MK386.
*/

    Usage: CL386.EXE [options] files
        or
    Usage: MK386.EXE [options] files

    Options is :
    
        @fname    specify response file, file with options and files
        /A[+|-]   disable extensions, for more info see CC386.DOC
        /?,/h,/H  this help message
        /Dxxx     define something, by example /DDOS32=1
        /Ennn     max number of errors, for more info see CC386.DOC
        /Ipath    specify include path, when search include files
        /Lpath    specify .LIB & .OBJ dir, when search .OBJ & .LIB files
        /Oxxx     optimize parameters for CC386, for more info see CC386.DOC
        /Cxxx     codegen parameters for CC386, for more info see CC386.DOC
        /K[-|+]   keep response file, TEMP.$$$ for CL386
        /k[-|+]   keep generate files, .ASM & .OBJ files
        /e[+|-]   dump errors to file, for more info see CC386.DOC
        /m[-|+]   generate .MAP file       
        /l[-|+]   dump listing file, for more info see CC386.DOC
        /i[-|+]   dump preprocessed file, for more info see CC386.DOC
        /w-xxx    disable a warning, for more info see CC386.DOC
        /n[-|+]   no default .LIB & .OBJ, no link startup & CLDOS.LIB
        /e=name   set name of .EXE file
        /v[-|+]   debug info, for PMODE use DEBUG startup version
        /a        compile, run ONLY CC386 ( don't work in MK386 )
        /c        assemble, run ONLY CC386 & assembler ( don't work in MK386 )
        /B[-|+]   build all ( don't work in CL386 )
        /M[+|-]   run MAKE.EXE ( don't work in CL386 )
        /$C=name  alternate C compiler, name is ONLY 'CC386'
        /$A=name  alternate assembler, name is 'NASM', 'TASM', 'TASMX',
                                'TASM32', 'MASM', 'ML', 'WASM', 'LASM'
        /$L=name  alternate linker, name is 'VALX', 'TLINK', 'LINK', 'WLINK'
        /$M=name  alternate maker, name is 'IMAKE', 'MAKE', 'WMAKE' ( MK386 )
        /$D=name  alternate DOS extender, name is 'PMODE', 'PMODEW', 'DOS4G', 
                                                  'WDOSX', 'DOS32A', 'ZRDX',
                                                  'CAUSEWAY'

/*
**  IV.  Errorlevel.
*/

    Program return next exitcode :

          == 0  - Ok
          != 0  - Error !
        
    Also return errorlevel's CC386 etc !


/*
**  V.  Remarks.
*/

    - don't use included response files ! By example,
        file1: @file2  file2: @file1  ;
    - use option /K for view response file TEMP.$$$ ;
    - use option /k for view .ASM & .OBJ files;
    - use option /a for ONLY assemble and /c for ONLY compile;
    - use option /v for make the debug version of the program 
       (work ONLY with PMODE);
    - in options -$C=name, -$A=name, -$L=name, -$D=name and -$M=name you
       can use -$C#name, -$A#name, -$L#name, -$D#name and -$M#name ;
    - change DOS extender -$D=name option. DOS/4G[W], PMODE/W, WDOSX uses
       ONLY with WLINK, PMODE else... ;
    - don't add option /? (/h, /H) in CL386.CFG (MK386.CFG) or CL386 (MK386)
       environ var ;
    - generate .OBJ and .ASM files put to current directory, MK386 DON'T
       delete .OBJ file and delete generate .ASM files, CL386 delete all
       generate .ASM & .OBJ files ;
    - if you want see response file for compile(assemble), use -c -k ( -a -k );
    - name of listing file CC386 and TASM equ, use option -a or -c for see it;
    - if you want see listing file for compile(assemble), use -c -l ( -a -l );
    - CL386 used about 50 Kb memory, for less memory use MK386.EXE;
    - you can add path to libs, /Lpath1;path2; , BUT only first path ( path1 )
        used for search CLDOS.LIB & C0DOS.OBJ !
    - change 'CC=CC386.EXE /C+N' to 'CC=CC386.EXE' in BUILTINS.MAK !!!

/*
**  VI.  Appendix.
*/

//  VI.1        MASM v5.1 know only .386p .387 instruction, but no .486p :(

//  VI.2        LINK.EXE - I tested OPTLINK from Symantec C/C++ v7.2,
                LINK.EXE from MASM is suxx !

//  VI.3        Tips for using TASM v4.1 for DOS !!!

Don't use TASM v4.1 !!! For example compile with TASM v4.1 :

============================================= 1.ASM
        .model tiny
        .code
        .386
start:
        rept 1024
        local hi
        jc hi
hi:
        endm
        end start
=============================================

        tasm /m2 1.ASM
        tlink /3/c/t 1.OBJ

and see in disassembler code in 1.COM :(
PS: Now I use TASM32 v5.2 ...
PPS: This bug correct in TASM32.EXE v5.2b (from C++ Builder v3.0).

//  VI.4        Warranty.

The program CL386 is FREEWARE and is delivered with source codes.  The
author does not  bear ANY  responsibility for damage  brought by  this
program. You use this program at own risk!!!

//  VI.5        Copyright.

    (c) CL386 & MK386   Kirill Joss
    (c) CC386           David Lindauer (gclind01@starbase.spd.louisville.edu)
    (c) PMODE           Tran

//  VI.6        How to contact to the author?

Your notes, warnings, beer etc send on addresses:

Kirill Joss

 E-mail: jk@zi3.cyb.univ.kiev.ua
FidoNet: 2:463/218.12
     AKA 2:463/59.29
                                                       Kirill Joss

   PS : Sorry for my English, is not my favorite language ...

