home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cshell69.zip / ENGLISH.DOC < prev    next >
Text File  |  1992-05-21  |  27KB  |  641 lines

  1. CS 6.8 - Compiler Shell - (c) Kai Uwe Rommel - Jan 18 1992
  2.  
  3.  
  4. 1. Introduction
  5. ---------------
  6.  
  7. CS is a driver program or shell for the following
  8. Microsoft program development tools:
  9.  
  10. - Macro Assembler (5.00 and newer, 6.00 is supported)
  11. - C Compiler (5.00 and newer, 6.00 is supported)
  12. - 386 C Compiler
  13. - Pascal Compiler (4.00 and newer)
  14. - FORTRAN Compiler (4.00 and newer)
  15. - Windows Resource Compiler (2.00 and newer)
  16. - Whitewater Ressource Toolkit for Windows
  17. - OS/2 Resource Compiler
  18. - LINK (5.00 and newer), LINK386
  19. - ILINK
  20. - BIND
  21. - EXE2BIN
  22. - CVPACK
  23. - LIB (3.08 and newer)
  24. - PWBRMAKE
  25.  
  26. In addition, the following programs are supported:
  27.  
  28. - FLEX scanner generator (2.3 and newer)
  29. - GNU BISON parser generator (1.03 and newer)
  30.  
  31. CS simplifies the usage of these programs and preserves you from
  32. typing of often used options and commands, looks for files in configured
  33. directories and calls your compiler(s) with a MAKE-like strategy.
  34.  
  35. You do not have to create a complicated description of all dependencies
  36. and commands in a makefile. Instead, you write the names of all input
  37. files of a project into a CS project file (see below) together with
  38. some options or enter them directly on the command line (depending of
  39. the size of your project). CS detects the file types from the extension
  40. of their names and automatically knows, what it has to do with them,
  41. call a compiler, add them to the LINK or BIND command and so on.
  42. It also knows from the file dates which files are out of date and have
  43. to be recompiled and which files are up to date. This is similar to the
  44. strategy of the MAKE program. Another feature of CS is, that it allows
  45. you to maintain sets of often used options for the compilers and the
  46. linker in sections of the CS.INI file. All configuration data for CS
  47. is also held in CS.INI.
  48.  
  49. CS is a family mode application and runs under MS-DOS and under OS/2
  50. in both real and protected mode.
  51.  
  52. The following program file types can be produced from your sources using CS:
  53.  
  54.    - DOS (EXE format)
  55.    - DOS (COM format)
  56.    - Windows or WLO (Windows Libraries for OS/2)
  57.    - Mirrors (Windows Emulation for OS/2)
  58.    - OS/2 (16- and 32-bit)
  59.    - OS/2 Presentation Manager (16- and 32-bit)
  60.    - Family applications for OS/2 and DOS or DOS Box of OS/2
  61.  
  62.    For Windows/WLO, Mirrors, OS/2 and OS/2 PM also DLL's can be generated.
  63.  
  64. Other output files:
  65.  
  66.    - linker maps
  67.    - listings
  68.    - object libraries
  69.  
  70.  
  71. 2. Syntax
  72. ---------
  73.  
  74. Usage:    CS argument*
  75.  
  76.     argument  = globalopt | fileset
  77.     fileset   = filespec  | '(' item+ ')'
  78.     item      = localopt  | filespec | '(' special ')'
  79.     special   = genopt    | filespec
  80.     filespec  = filename  | filename '{' filename+ '}'
  81.  
  82. Where:    globalopt ε { -? -H -Am -Ff -Le -Sn -Oid -Q -I -F -X -P 
  83.               -C -L -E -N -B -M -LS -SB -K -NS -NF }
  84.  
  85.         m         = model identifier T, S, M, C, L, H or MT
  86.         f         = float type identifier E, 7, A or D
  87.         e         = program type identifier R, C, P, PM, B, W or L
  88.         id        = name of CS.INI section with compiler options
  89.         n         = stack size in bytes (decimal or hex with prefix 0x)
  90.  
  91.     filename  = any valid DOS filename, all filenames in a fileset in ()
  92.             must have the same extension (C, PAS, FOR or ASM)
  93.     localopt  = any option available for the compiler associated with the
  94.             extension of the files in a fileset
  95.     genopt    = any parser or scanner generator option
  96.  
  97. Input files can have the extensions C, PAS, FOR, ASM, L, Y, OBJ, LIB, RC, RES
  98. or DEF (linker definition file), BAD (list for BIND of symbols to be
  99. bound to BadDynLink) or CS (CS project file). The '(' special ')' argument
  100. is only allowed for files with L or Y extensions. A file with extension MDT
  101. can also be given, to specify the file for incremental compilation info of
  102. the C 6.00 QCC (see option -Q). Files with extensions LOG or BAT/CMD
  103. specify the names of files for the screen log or batch file to generate.
  104. BSC specifies the PWB browser database file to create or maintain.
  105.  
  106. When a directory name is passed as an argument, it is used as the output
  107. directory. It must be specified as the first non-option argument.
  108.  
  109. To specify additional API libraries/objects for BIND instead for LINK (they
  110. have the same extension), append an exclamation mark directly to the name of
  111. the library/object to distinguish it from LINK libraries/objects. CS looks
  112. for BIND API libraries through the PLIB variable and for additional BIND
  113. API objects through the OBJ variable (see section 5.1).
  114.  
  115. If there are special options for one ore more source files to the compiler
  116. associated with their type, they can be enclosed with the files for
  117. which they should be used in parentheses. For all filesets enclosed
  118. in () the compiler is called separately (normally, the compilers are
  119. called with as much file names as arguments as fit on the command line,
  120. for those compilers that support multiple file arguments, namely CL and FL).
  121. For FLEX and BISON source files, both options for these programs and for
  122. the C compiler can be given (see below).
  123.  
  124. To help CS to handle more complicated dependencies, one or more files
  125. can be associated with each source file, which depends on them. This is
  126. often useful for include or header files. All names of files on which
  127. a particular source file depends, must be enclosed in curly brackets {}
  128. and follow the source file immediately. This files are used ONLY for
  129. the MAKE-strategy, i.e. to determine if a source file has to be recompiled
  130. or not.
  131.  
  132. If there are files given on the command line or in the project file
  133. with extensions EXE, SYS, DLL, COM, MAP, LST or BSC, then these names define
  134. the names of the output files and define their type (EXE/COM/DLL) or cause
  135. their production (MAP/LST/BSC) if given. That means, if you give the names
  136. FOO.COM and BAR.MAP as arguments to CS, it will try to compile the source
  137. files to a DOS COM program named FOO.COM and it will tell LINK to write
  138. a link map to the file BAR.MAP. DLL and SYS are just synonyms for EXE. To
  139. create a DOS SYS device driver in binary format, the option -LC has to be
  140. specified in addition to the SYS name, but DOS can also load device drivers
  141. in EXE format.
  142.  
  143. Example:
  144. CS -lp main.c{def.h} prog.exe (mod1.c mod2.c -Gt) mod3.asm mod4.c mod5.pas
  145.  
  146. (If this appears to be cryptical of difficult to type, this shows the
  147. usefulness of CS project files, see the equivalent project file below.)
  148.  
  149. Wildcard expansion is supported, with the restriction, that names containing
  150. wildcards have to be separated with blanks from the context on both sides.
  151. Wildcard expansion is not supported in project files.
  152.  
  153. Wrong:  CS main.c (mod*.c -G2)
  154. Right:  CS main.c ( mod*.c -G2)
  155.  
  156. For BISON and FLEX, it is often needed to specify options for these
  157. generators as well as for the C compiler, when it is called to compile
  158. the generated C programs. For this purpose, a second () nesting level
  159. is allowed for BISON and FLEX source files (but only for these).
  160.  
  161. Example: CS -lp main.c (-W1 (-d grammar.y))
  162.  
  163. The -d option is passed to BISON while the -W1 option is passed to the C
  164. compiler when called to compile the generated grammar.c.
  165. This is not a true nesting level but only a way to separate the options.
  166. Therefore, in the following example
  167.  
  168. CS -lp main.c (-W1 (-d gram1.y) (-v gram2.y))
  169.  
  170. the -d AND the -v options are passed to BISON for BOTH grammar files.
  171. The correct syntax for this purpose is
  172.  
  173. CS -lp main.c (-W1 (-d gram1.y)) (-W1 (-v gram2.y))
  174.  
  175. The BISON and FLEX generators are called with the appropriate options to
  176. create output files with the same base name as the input file, but with .C
  177. extension. The output files are created in the same directory where the input
  178. files are, NOT in the OUTPUT directory (see section 5.1).
  179. Therefore, the -t option of FLEX and the -o option of BISON must not be used.
  180. They are always used by CS.
  181.  
  182.  
  183. 3. CS project files
  184. -------------------
  185.  
  186. If CS encounters any file with extension CS in its arguments, the
  187. contents of the file is read and evaluated if it was given as arguments.
  188. The text read from the file is logically placed on the command line
  189. instead of the file name. These files are called PROJECT FILES.
  190. They can have any number of lines but must not contain wildcards
  191. in filenames listed in them.
  192.  
  193. The extension CS of project files can be omitted. This is the ONLY
  194. type of file known to CS of which the extension is optional. That means
  195. you only have to enter "CS foo" if FOO.CS exists in the current directory
  196. or in any directory listed in the SOURCE variable (see below).
  197.  
  198. For better readability, the text of a project file can (should) be
  199. written on multiple lines. Lines starting with ; or # are treated as
  200. comment lines and are ignored up to the next line feed.
  201.  
  202. CS project files are intended for bigger projects which consist of
  203. many files and more complicated dependency trees or special options.
  204. The usage of () and {} on the command line is not very comfortable,
  205. for projects which require their usage, you will probably use
  206. project files.
  207.  
  208. Such a project file is MUCH shorter and easier to wite than a makefile.
  209. For programs like GNU awk or perl (widely used freeware programs) the
  210. makefiles are 100 or more lines long but the equivalent CS project files
  211. fit into 10 lines. Also, they require less "debugging".
  212.  
  213. The project file for the sample command line above could look like:
  214.  
  215. ; Project: xyz
  216. ; Date:   1.4.1989
  217. ;
  218. ; main module
  219. main.c {def.h}
  220. ;
  221. ; subroutines with special options
  222. (mod1.c mod2.c -Gt)
  223. ;
  224. ; other subroutines
  225. mod3.asm
  226. mod4.c
  227. mod5.pas
  228. ;
  229. ; output file name for family mode application
  230. prog.exe -lb
  231.  
  232. If CS is called without any arguments or the arguments to CS do not
  233. contain any file name of a source file with extension C, PAS, FOR, ASM or
  234. OBJ, it looks fo a file PROJECT.CS in the current directory. If it
  235. exists it is read as if it was given to CS as an argument. This makes
  236. the functionality of PROJECT.CS almost like "makefile" for the standard
  237. make utility.
  238.  
  239.  
  240. 4. Options
  241. ----------
  242.  
  243. -Am     Defines the memory model for C, FORTRAN and MASM. To MASM, the
  244.         model is passed as "-Dmodel=small" etc. which requires your
  245.         sources to contain a statement like "% .MODEL model" at the very
  246.         beginning of the text if you want to choose the memory model at
  247.         compile time for assembler programs.
  248.         For m the letters T, S, M, C, L, H and MT are valid. MT stands for
  249.         the custom model for multithreaded OS/2 programs with LLIBCMT.LIB.
  250.         T (tiny) is only valid for C 6.00 and newer. 3 selects the 386 small
  251.         model and 386 compiler and linker.
  252.  
  253. -Le     Defines the output format of the linker (e = R, C, W, P, PM, B oder L).
  254. -LR     -> Real-Mode-EXE for DOS
  255. -LC     -> Real-Mode-COM for DOS
  256. -LW     -> Windows-EXE for DOS-Windows or OS/2-WLO
  257. -LM     -> Mirrors-EXE for OS/2
  258. -LP     -> Protected-Mode-EXE for OS/2 (without Presentation Manager)
  259. -LPM    -> Protected-Mode-EXE for OS/2 (with Presentation Manager)
  260. -LB     -> Bound-EXE
  261. -LL     -> LIB is used instead of LINK to create an object library
  262.            where the object modules of all sources are put.
  263.  
  264. -Ff     Defines the type of the floating point arithmetics.
  265. -FE     Floating point with emulator.                    This also influences
  266. -F7     Floating point with 80x87 coprocessor.           the type of standard
  267. -FCE    Floating point with calls to emulator.           library used !
  268. -FC7    Floating point with calls to 80x87 coprocessor.  
  269. -FA     Alternate floating point library.                
  270. -FD     Decimal arithmetics (only for Pascal).
  271.  
  272. -Oid    The id selects the section in CS.INI with the compiler options
  273.         to be used. CS looks for a section named [CS-id]. From this section
  274.         the values for the environment variables CL, PL, FL, MASM and LINK
  275.         are read. The id should be 15 characters or less in length.
  276.  
  277. -Sn     Defines the stack size for the linker. It can be entered decimal
  278.         or hex with the prefix 0x (standard C notation).
  279.  
  280. -C      Compile only.
  281.  
  282. -L      Link only.
  283.  
  284. -E      Echo all commands before executing them.
  285.  
  286. -N      No execution of commands, only show them.
  287.  
  288. -G      No execution of commands, but generate batch file.
  289.  
  290. -K      Keep logfile of all program output (see below).
  291.  
  292. -B      Don't use MAKE strategy, build all files regardless of file dates.
  293.  
  294. -X      Link without standard libraries.
  295.  
  296. -Q      Compile incrementally with QCC (only C 6.00 and newer)
  297.  
  298. -I      Link incrementally with ILINK whenever possible (see below).
  299.  
  300. -F      Compile and link normally (full).
  301.  
  302. -P      Call CVPACK if the output executable contains debugging information.
  303.  
  304. -M      Create a linker map and, if -LB is used, also a binder map.
  305.  
  306. -LS     Create compiler listings.
  307.  
  308. -SB     Create PWB source browser database (with BSC extension).
  309.         This is currently only supported by C 6.00 and MASM 6.00 but no
  310.         other languages. The SBR files from each C module are created in
  311.         the output directory automatically but you can optionally specify
  312.         the name and path of the BSC file.
  313.  
  314. -NF     Use full qualified path names when passing names of source files
  315.         to the compilers. This is useful when using CodeView because it
  316.         can always find the source files even if they are not in the
  317.         current directory.
  318.  
  319. -NS     Opposite of above option. Use simple file names whenever posible
  320.         except for the source files located via SOURCE variable.
  321.  
  322.  
  323. 5. CS.INI
  324. ------------
  325.  
  326. The characteristics of your system needed for CS have to be configured
  327. in the file CS.INI. This file must be accessible through environment 
  328. variables INIT or PATH. It is similar in its format to WIN.INI of Microsoft
  329. Windows. Each program that knows about it can create sections denoted
  330. with "[name]" and store data in it in "name=value" or "name:value" formats.
  331. That makes it ideal as a system-wide database for initialization and
  332. configuration information. The OS2.INI file is an extension of this
  333. method but uses a binary format not readable by humans.
  334. See the sample configuration in the enclosed CS.INI. You can copy this file
  335. to your own CS.INI and modifiy the setting for your needs.
  336.  
  337.  
  338. 5.1. Section [CS]
  339. -----------------
  340.  
  341. In this section various default values for CS are specified that can
  342. be overridden by command line options or project files.
  343.  
  344. MODEL=<model>
  345. Valid models are TINY, SMALL, MEDIUM, COMPACT, LARGE, HUGE or MTHREAD.
  346. This defines the default memory model if no -Am option is used on the
  347. CS command line or in a project file. Equivalent to -Am option.
  348.  
  349. EXETYPE=<type>
  350. Valid types are DEFAULT, DOS, COM, OS2, OS2PM, BOUND, WINDOWS, MIRRORS
  351. or LIBRARY. If DEFAULT is specified, depending on the machine mode
  352. either DOS or OS2 is choosen automatically. When LIBRARY is used,
  353. all object modules are written to an object library with LIB and
  354. no EXE file is created. Equivalent to -Le option.
  355.  
  356. FLOAT=<type>
  357. Valid types are EMULATOR, 80X87, CALLEMULATOR, CALL80X87, ALTERNATE or DECIMAL.
  358. Equivalent to -Ff option.
  359.  
  360. OPTIONS=<id>
  361. Specifies the name of the CS.INI section with the default compiler
  362. and linker options. Equivalent to -Oid option.
  363.  
  364. NAMES=FULL or NAMES=SHORT
  365. Equivalent to -NF and -NS command line options (see above). This
  366. specifies default behaviour, if none of the both command line options
  367. is used.
  368.  
  369. BUILD=NO or BUILD=YES
  370. The setting BUILD=YES disables the MAKE strategy of CS. Normally,
  371. BUILD=NO should be used. See -B command line option.
  372.  
  373. MASM=5 or MASM=6
  374. This setting tells CS if MASM version 5.00 or 5.10 is used or the new
  375. ML.EXE driver of MASM 6.00 is used.
  376.  
  377. STACK=<size>
  378. Defines the default stack size for LINK. Equivalent to -Sn option.
  379.  
  380. ILINK=<options>
  381. Defines the options to be used for link in order to prepare an executable
  382. file for incremental linking (seem ILINK manual). It should contain
  383. /PADC:x and /PADD:y options but not the /INC option. Set x and y after
  384. your personal requirements. No command line equivalent.
  385.  
  386. RAMDISK=<path>
  387. If a nonempty path is specified that points into a RAM disk, then some
  388. header or include files for the compilers to be called later are copied
  389. to this directory if they are not already there. This can reduce harddisk
  390. access considerably. List the path in your INCLUDE variable too (see below).
  391. See section 4.3.
  392.  
  393. SOURCE=<pathlist>
  394. You can define several directories in PATH syntax which are searched
  395. for source files that were specified on the command line or in a project
  396. file but do not exist in the current directory. CS searches using this
  397. variable for file of types ASM, C, PAS, FOR, DEF, BAD and CS.
  398.  
  399. OBJ=<pathlist>
  400. Same purpose as SOURCE but used to search for object files.
  401.  
  402. OBJ386=<pathlist>
  403. Same purpose as SOURCE but used to search for 386 object files.
  404.  
  405. OUTPUT=<path>
  406. Specifies the output directory for all files created by the programs
  407. called by CS. Best is to let it point to a big RAM disk. If you want to
  408. override this setting on the command line or in a project file,
  409. include drives or paths to the file names.
  410.  
  411. INCLUDE=<pathlist>
  412. INCLUDE386=<pathlist>
  413. TMP=<path>
  414. These variables specify the values of the environment variables with
  415. the same names that are set before the compilers and the linker are called.
  416. INCLUDE386 is used for INCLUDE when the 386 C compiler is called.
  417.  
  418. RLIB=<pathlist> 
  419. PLIB=<pathlist>
  420. PLIB386=<pathlist>
  421. WLIB=<pathlist>
  422. These variables define the value of the LIB environment variable for
  423. the linker. RLIB is used when real mode programs (EXE or COM) are created,
  424. PLIB is used when protected mode programs (with or without PM and bound
  425. programs) are created (PLIB386 for 32-bit protected mode programs)
  426. and WLIB is used for linking Windows/WLO and Mirrors programs.
  427.  
  428. In the variables RAMDISK, SOURCE, OBJ, OUTPUT, INCLUDE, TMP, RLIB, PLIB und
  429. WLIB you can use the values of environment variables. Enclose their names
  430. in % for this purpose (like in batch files).
  431. Example: INCLUDE=%TMP%\INCLUDE;D:\LIB\INCLUDE;C:\MS\INCLUDE
  432. The %TMP% will be replaced by the value of the environment variable TMP.
  433.  
  434.  
  435. 5.2. Sections [CS-id]
  436. ---------------------
  437.  
  438. This sections contain the five entries for the environment variables
  439. with the options to be used for them compilers and the linker.
  440.  
  441. Example:
  442.  
  443. [CS-STD]
  444. CL=-W3 -Zdep1 -J -G2s -Oxn
  445. CL386=-W3 -Zdep1 -J -Gs -Oxn
  446. PL=-w3 -Zdz
  447. FL=-W1 -Zd -FPi -G2s -Ox
  448. ML=-W2 -Zm -Zd -Zp1 -Cp
  449. MASM=-W2 -Ml -X -Zd
  450. LINK=/BAT /NOIG /NOE
  451.  
  452.  
  453. 5.3. Sections [CS+ASM], [CS+C], [CS+FOR] and [CS+PAS]
  454. -----------------------------------------------------
  455.  
  456. In this sections is defined, which include files for the languages
  457. have to be copied to the RAMDISK directory and where they are located
  458. on the harddisk.
  459.  
  460. Each section may have as much entries as needed. They should have
  461. the format:
  462.  
  463. FLAGFILE=SOURCE
  464.  
  465. where FLAGFILE is the name of a file, that is tested for existence in
  466. the RAMDISK before the compiler for this language is called. If it does
  467. not exist in the RAM disk, the file name specification (with wildcards)
  468. in SOURCE is copied to the RAM disk directory. SOURCE has to contain a
  469. full path name.
  470.  
  471. Example:
  472.  
  473. [CS+ASM]
  474. DOS.INC=C:\INCLUDE\*.INC
  475. OS2.INC=C:\INCLUDE\OS2\*.INC
  476. MACROS.INC=D:\INCLUDE\*.INC
  477.  
  478. That means, that CS looks for DOS.INC in the directory specified in the
  479. RAMDISK variable before calling MASM to assemble a source file. If CS does
  480. not find it there, it copies C:\INCLUDE\*.INC to this directory. It is
  481. important, that the SOURCE file pattern matches also for the FLAGFILE
  482. to get this also copied to the RAMDISK. Then further tests will find it
  483. there. If you do not need this feature, leave this sections empty, but
  484. do not delete their [names] and set the RAMDISK variable empty (section 5.1).
  485.  
  486.  
  487. 6. Other features
  488. -----------------
  489.  
  490. If the linker encounters any error, its standard input response file
  491. is left as CS.INP in the OUTPUT directory. You may take a look at it
  492. to see if the right options and libraries were specified.
  493.  
  494. If the linker bundled with the compilers and the assembler is used to
  495. create Windows/WLO applications, you should put the statement
  496. "EXETYPE WINDOWS" into the linker definition file of your program.
  497. The default setting of the normal segmented-executable linker is
  498. "EXETYPE OS2" where the default setting of the version in ther
  499. Windows SDK is "EXETYPE WINDOWS". Windows would not load a program
  500. with "EXETYPE OS2" even if it is a Windows program but this is not
  501. documented in the Microsoft documentation anywhere.
  502.  
  503. The standard libraries of Microsoft C, Pascal and FORTRAN must have
  504. the machine-mode suffix on their names, i.e. CLIBCER.LIB, CLIBCEP.LIB
  505. and CLIBCEW.LIB instead of CLIBCE.LIB and LIBPASER.LIB, LIBPASEP.LIB
  506. instead of LIBPASE.LIB and MLIBFER.LIB, MLIBFEP.LIB instead of MLIBFORE.LIB
  507. and so on for all memory and floating point models.
  508.  
  509. Although CS uses the SOURCE variable to look for missing source files,
  510. it may be better to have the current directory set to your sources
  511. because they may include files from this directory without explicit path
  512. name (#include "name.h" in C programs) which the compilers will NOT find
  513. because they do know nothing about the SOURCE variable.
  514.  
  515. This is required for the Windows resource compiler because it does not
  516. accept full path names.
  517.  
  518. The resource compiler puts the RES file into the same directory where
  519. the RC file is, not in the OUTPUT directory.
  520.  
  521. Alternatively to specifying a RC file, a RES file (compiled RC file) is
  522. accepted. This is for users of the Whitewater Ressource Toolkit.
  523.  
  524. There are two different resource compilers RC.EXE, one for OS/2
  525. Presentation Manager and one for Windows. Make shure that the Windows
  526. one is accessible through the DOS executable search PATH when creating
  527. Windows executables and the OS/2 one is accessible through the OS/2
  528. PATH when creating OS/2 PM executables. For Windows/WLO Programs, the
  529. Windows RC is required. The Windows RC.EXE should be renamed to
  530. RCWIN.EXE. Be sure the correct RCPP.EXE is accessible.
  531.  
  532.  
  533. 7. Automatic file names
  534. -----------------------
  535.  
  536. If no names are defined for the output files (EXE, MAP, LST ...)
  537. then CS will create them from the first name passed to it as an argument
  538. but with the correct extension.
  539.  
  540. If a protected mode program or family mode application is created and
  541. no DEF or BAD file was given, CS looks for a DEF and BAD file with the same
  542. base name as the first file name argument and automatically passed these
  543. files to LINK or BIND if they exist.
  544.  
  545. If a Windows/WLO or Mirrors program is created and no names of the DEF
  546. or RC files were given, CS looks for them the same way. This applies
  547. also for OS/2 PM programs for the DEF and RC files.
  548.  
  549. That means, if you call, for example, "CS -AS -LW winprog.c" and there
  550. exist a winprog.def and a winprog.rc file, CS passes winprog.def to
  551. the linker and calls the resource compiler with winprog.rc automatically.
  552.  
  553. This simplifies the compilation of small programs for which no project
  554. file is needed therefore. You only have to give all related DEF, BAD
  555. and RC files the same base name.
  556.  
  557. Tho create OS/2 PM programs you have to link with the OS2.LIB import
  558. library instead of the DOSCALLS.LIB import library. This is achieved by
  559. using -LPM instead of -LP or by setting EXETYPE=OS2PM in CS.INI.
  560. The import library and that CS processes a resource file if -LPM is given,
  561. are the only differences between -LP and -LPM and EXETYPE=OS2 and
  562. EXETYPE=OS2PM.
  563.  
  564.  
  565. 8. Log file
  566. -----------
  567.  
  568. Sometimes it is useful to keep a protocol of all output of CS and the
  569. called compilers, linker etc. in a log file. This would allow, for example,
  570. to start a big job and the go to lunch and look for all the hundredths
  571. of warnings on return ...
  572. With the -K option, a protocol is written to a file with same base name
  573. and in the same directory as the target executable file but with extension
  574. LOG. All output of the called programs and from CS (produced by -E option,
  575. for example) is duplicated to that file.
  576. Under DOS, this has the disadvantage, that the output from each step
  577. (compiler, linker ...) is only echoed to the display, when the step
  578. finished. Under OS/2, with the -K option, the programs are run through
  579. pipes which are splitted to display and log file. This provides both
  580. immediate screen output and a log file.
  581. A log file is useful in particular, when switching to a higher warning
  582. level for a compiler. This may cause LOTS of warnings on older sources
  583. which can be captured in the log file and read with a text editor later
  584. without beeing without feedback at compilation time (with large programs,
  585. for example, or on slow machines).
  586.  
  587.  
  588. 9. DLL's
  589. --------
  590.  
  591. DLL's are most often created with custom memory models like "-Asnu" or
  592. "-ASnw" or "-Alfw" and so on. As the C compiler manual says, are these models
  593. equivalent to "-AS -Au" or "-AS -Aw" and "-AL -Aw" and so on.
  594. That means you should specify one of the standard memory models to CS
  595. and put -Aw or -Au into () with the source files to which they apply.
  596.  
  597. -Asnw --> -AS -Aw    dto. for -Au
  598. -Asfw --> -AC -Aw
  599. -Alnw --> -AM -Aw
  600. -Alfw --> -AL -Aw
  601.  
  602. To get CS calling "CL -Asnw -G2s graflib.c", you have to enter
  603. "CS -AS (-Aw -G2s graflib.c)" or write an equivalent project file.
  604.  
  605. For linking DLL's the option -X is often useful to exclude the
  606. standard libraries ftom the link run.
  607.  
  608. For DLL's are several extensions used. For Windows EXE, DLL or DRV are used,
  609. for OS/2 is DLL most commonly used. CS allows an extension of DLL alternatively
  610. to EXE on the command line or in project files. For other extensions, rename
  611. the EXE file.
  612.  
  613. Remember to put the LIBRARY statement into the DEF file instead of the
  614. NAME statement.
  615.  
  616.  
  617. 10. Exit codes
  618. --------------
  619.  
  620. CS returns the following exit codes to the caller:
  621.  
  622.   0 - successful run
  623.   1 - nothing to do (everything was up to date)
  624.   2 - a called program produced an error
  625.       (compiler, assembler, linker ...)
  626.   3 - syntax error in the command line or in a project file
  627.   4 - wrong configuration in CS.INI
  628.   5 - an input file does not exist.
  629.   6 - error in CS.EXE (not enough memory, I/O error ...)
  630.  
  631.   256 - termination by user (^C, ^BREAK)
  632.  
  633.  
  634. 11. Restrictions
  635. ----------------
  636.  
  637. - none since version 5 :-)
  638.  
  639. I don't know other features to put into this program.
  640. Let me know, if you wish to have a new feature ...
  641.